Kaydet (Commit) 8e6a9633 authored tarafından Your Name's avatar Your Name

fakeroot integration

üst 914bafa9
...@@ -286,6 +286,9 @@ class Builder: ...@@ -286,6 +286,9 @@ class Builder:
self.has_icecream = False self.has_icecream = False
self.variable_buffer = {} self.variable_buffer = {}
self.destdir=os.getcwd() self.destdir=os.getcwd()
if os.getuid() != 0:
if os.system("fakeroot --version &>/dev/null") == 0:
os.environ['USER']="root"
def set_spec_file(self, specuri): def set_spec_file(self, specuri):
if not specuri.is_remote_file(): if not specuri.is_remote_file():
...@@ -751,6 +754,7 @@ class Builder: ...@@ -751,6 +754,7 @@ class Builder:
# we'll need our working directory after actionscript # we'll need our working directory after actionscript
# finished its work in the archive source directory. # finished its work in the archive source directory.
curDir = os.getcwd() curDir = os.getcwd()
command=""
self.specdiruri = os.path.dirname(self.specuri.get_uri()) self.specdiruri = os.path.dirname(self.specuri.get_uri())
pkgname = os.path.basename(self.specdiruri) pkgname = os.path.basename(self.specdiruri)
self.destdir = util.join_path(ctx.config.tmp_dir(), pkgname) self.destdir = util.join_path(ctx.config.tmp_dir(), pkgname)
...@@ -762,13 +766,15 @@ class Builder: ...@@ -762,13 +766,15 @@ class Builder:
os.environ['CURDIR'] = curDir os.environ['CURDIR'] = curDir
os.environ['SRCDIR'] = self.pkg_work_dir() os.environ['SRCDIR'] = self.pkg_work_dir()
os.environ['OPERATION'] = func os.environ['OPERATION'] = func
if os.getuid() != 0:
if os.system("fakeroot --version &>/dev/null") == 0:
command+="fakeroot "
if os.path.exists(src_dir): if os.path.exists(src_dir):
os.chdir(src_dir) os.chdir(src_dir)
else: else:
raise Error( raise Error(
_("ERROR: WorkDir ({}) does not exist\n").format(src_dir)) _("ERROR: WorkDir ({}) does not exist\n").format(src_dir))
if os.system(command+'python3 -c \'import sys\nsys.path.append("{1}")\nimport actions\nif(hasattr(actions,"{0}")): actions.{0}()\''.format(func, curDir)):
if os.system('python3 -c \'import sys\nsys.path.append("{1}")\nimport actions\nif(hasattr(actions,"{0}")): actions.{0}()\''.format(func, curDir)):
raise Error( raise Error(
_("unable to call function from actions: \'{}\'").format(func)) _("unable to call function from actions: \'{}\'").format(func))
os.chdir(curDir) os.chdir(curDir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment