summaryrefslogtreecommitdiffstats
path: root/tupkg/update/tupkgupdate
diff options
context:
space:
mode:
Diffstat (limited to 'tupkg/update/tupkgupdate')
-rwxr-xr-xtupkg/update/tupkgupdate19
1 files changed, 17 insertions, 2 deletions
diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate
index 41f87d48..320ccbe9 100755
--- a/tupkg/update/tupkgupdate
+++ b/tupkg/update/tupkgupdate
@@ -306,13 +306,21 @@ def runGensync(repo, pkgbuild):
return execute(command)
def runUpdatesyncUpd(repo, pkgbuild):
+ global havefakeroot
targetDB = os.path.join(repo, "community.db.tar.gz")
- command = "updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
+ if havefakeroot:
+ command = "fakeroot updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
+ else:
+ command = "updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
return execute(command)
def runUpdatesyncDel(repo, pkgname):
+ global havefakeroot
targetDB = os.path.join(repo, "community.db.tar.gz")
- command = "updatesync del '" + targetDB + "' '" + pkgname +"'"
+ if havefakeroot:
+ command = "fakeroot updatesync del '" + targetDB + "' '" + pkgname +"'"
+ else:
+ command = "updatesync del '" + targetDB + "' '" + pkgname +"'"
return execute(command)
############################################################
@@ -348,6 +356,13 @@ if (len(args_proper) < 3):
print >>sys.stderr, "syntax: tupkgupdate [-n] [--delete] [--paranoid] <repo_dir> <pkgbuild_tree> <build_tree>"
sys.exit(-1)
+# Make sure we can use fakeroot, warn if not
+havefakeroot = False
+if os.access('/usr/bin/fakeroot', os.X_OK):
+ havefakeroot = True
+else:
+ warning("Not using fakeroot for repo db generation")
+
repo_dir, pkgbuild_dir, build_dir = args_proper
# Open the database so we find out now if we can't!