Close #4757, bad permissions in repo db generation

This commit is contained in:
simo 2006-06-12 23:02:25 +00:00
parent c94000db49
commit 885f309fba

View file

@ -306,12 +306,20 @@ def runGensync(repo, pkgbuild):
return execute(command) return execute(command)
def runUpdatesyncUpd(repo, pkgbuild): def runUpdatesyncUpd(repo, pkgbuild):
global havefakeroot
targetDB = os.path.join(repo, "community.db.tar.gz") targetDB = os.path.join(repo, "community.db.tar.gz")
if havefakeroot:
command = "fakeroot updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
else:
command = "updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'" command = "updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
return execute(command) return execute(command)
def runUpdatesyncDel(repo, pkgname): def runUpdatesyncDel(repo, pkgname):
global havefakeroot
targetDB = os.path.join(repo, "community.db.tar.gz") targetDB = os.path.join(repo, "community.db.tar.gz")
if havefakeroot:
command = "fakeroot updatesync del '" + targetDB + "' '" + pkgname +"'"
else:
command = "updatesync del '" + targetDB + "' '" + pkgname +"'" command = "updatesync del '" + targetDB + "' '" + pkgname +"'"
return execute(command) 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>" print >>sys.stderr, "syntax: tupkgupdate [-n] [--delete] [--paranoid] <repo_dir> <pkgbuild_tree> <build_tree>"
sys.exit(-1) 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 repo_dir, pkgbuild_dir, build_dir = args_proper
# Open the database so we find out now if we can't! # Open the database so we find out now if we can't!