Fix podctl build itself
This commit is contained in:
@@ -95,12 +95,15 @@ class Script:
|
||||
|
||||
async def run(self, *args, **kwargs):
|
||||
if self.unshare and os.getuid() != 0:
|
||||
from podctl.console_script import console_script
|
||||
# restart under buildah unshare environment !
|
||||
argv = [
|
||||
'buildah', 'unshare',
|
||||
sys.argv[0], # current podctl location
|
||||
] + console_script.parser.argv + [
|
||||
type(self).__name__.lower() # script name ?
|
||||
] + list(args)
|
||||
print('Executing', ' '.join(argv))
|
||||
pp = subprocess.Popen(
|
||||
argv,
|
||||
stderr=sys.stderr,
|
||||
|
||||
@@ -11,4 +11,3 @@ from .pip import Pip # noqa
|
||||
from .run import Run # noqa
|
||||
from .template import Append, Template # noqa
|
||||
from .user import User # noqa
|
||||
from .uwsgi import uWSGI # noqa
|
||||
|
||||
@@ -14,12 +14,12 @@ class Copy:
|
||||
self.owner = script.variable('user')
|
||||
|
||||
async def build(self, script):
|
||||
await script.run(f'sudo mkdir -p {self.dst}')
|
||||
await script.crexec(f'mkdir -p {self.dst}')
|
||||
for item in self.src:
|
||||
await script.append(f'cp -a {item} $mnt{self.dst}')
|
||||
await script.exec(f'cp -a {item} {script.mnt}{self.dst}')
|
||||
|
||||
if self.mode:
|
||||
await script.run(f'sudo chmod {self.mode} $mnt{self.dst}')
|
||||
await script.crexec(f'chmod {self.mode} {script.mnt}{self.dst}')
|
||||
|
||||
if self.owner:
|
||||
await script.run(f'sudo chown -R {self.owner} $mnt{self.dst}')
|
||||
await script.crexec(f'chown -R {self.owner} {script.mnt}{self.dst}')
|
||||
|
||||
@@ -29,9 +29,9 @@ class Packages:
|
||||
install='apt-get -y --no-install-recommends install',
|
||||
),
|
||||
dnf=dict(
|
||||
update='dnf update',
|
||||
upgrade='dnf upgrade --exclude container-selinux --best --assumeyes', # noqa
|
||||
install='dnf install --exclude container-selinux --setopt=install_weak_deps=False --best --assumeyes', # noqa
|
||||
update='dnf makecache --assumeyes',
|
||||
upgrade='dnf upgrade --best --assumeyes --skip-broken', # noqa
|
||||
install='dnf install --setopt=install_weak_deps=False --best --assumeyes', # noqa
|
||||
),
|
||||
yum=dict(
|
||||
update='yum update',
|
||||
|
||||
Reference in New Issue
Block a user