Fixed change to root privileges #152

This commit is contained in:
Dimitris Zlatanidis 2022-12-17 22:17:05 +02:00
parent cbd03a4a98
commit 45434a34d7

View file

@ -179,13 +179,17 @@ class Slackbuilds:
def build_the_script(self, path: str, name: str):
""" Run the .SlackBuild script. """
folder = f'{path}/{name}/'
slackbuild = f'./{name}.SlackBuild'
execute = folder + slackbuild
execute = f'{folder}./{name}.SlackBuild'
# Change to root privileges
os.chown(folder, 0, 0)
for file in os.listdir(folder):
os.chown(f'{folder}{file}', 0, 0)
if '--jobs' in self.flags:
self.set_makeflags()
stdout = subprocess.call(execute)
stdout = subprocess.call(execute, shell=True)
if stdout > 0:
raise SystemExit(stdout)