From 885f309fbacc61f996e6e448fdd5d9604b7c3c6d Mon Sep 17 00:00:00 2001 From: simo Date: Mon, 12 Jun 2006 23:02:25 +0000 Subject: Close #4757, bad permissions in repo db generation --- tupkg/update/tupkgupdate | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'tupkg/update/tupkgupdate') diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate index 41f87d4..320ccbe 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] " 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! -- cgit v1.2.3-70-g09d2