mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Tupkgupdate now uses updatesync
This commit is contained in:
parent
02b82cf9ba
commit
d97a0a376b
1 changed files with 29 additions and 5 deletions
|
@ -297,6 +297,16 @@ def runGensync(repo, pkgbuild):
|
||||||
command = "gensync '" + pkgbuild + "' '" + target + "'"
|
command = "gensync '" + pkgbuild + "' '" + target + "'"
|
||||||
return execute(command)
|
return execute(command)
|
||||||
|
|
||||||
|
def runUpdatesyncUpd(repo, pkgbuild):
|
||||||
|
targetDB = os.path.join(repo, "community.db.tar.gz")
|
||||||
|
command = "updatesync upd '" + targetDB + "' '" + pkgbuild + "' '" + repo +"'"
|
||||||
|
return execute(command)
|
||||||
|
|
||||||
|
def runUpdatesyncDel(repo, pkgname):
|
||||||
|
targetDB = os.path.join(repo, "community.db.tar.gz")
|
||||||
|
command = "updatesync del '" + targetDB + "' '" + pkgname +"'"
|
||||||
|
return execute(command)
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# Functions for error handling
|
# Functions for error handling
|
||||||
############################################################
|
############################################################
|
||||||
|
@ -528,8 +538,22 @@ if (switches.get("--delete") == True):
|
||||||
for file in copy:
|
for file in copy:
|
||||||
deleteFile(file)
|
deleteFile(file)
|
||||||
# Run gensync to build the repo index
|
# Run gensync to build the repo index
|
||||||
if (len(copy) + len(delete) > 0):
|
#if (len(copy) + len(delete) > 0):
|
||||||
retval = runGensync(repo_dir, pkgbuild_dir)
|
# retval = runGensync(repo_dir, pkgbuild_dir)
|
||||||
if (retval != 0):
|
# if (retval != 0):
|
||||||
error("Gensync returned an error!")
|
# error("Gensync returned an error!")
|
||||||
sys.exit(-1)
|
# sys.exit(-1)
|
||||||
|
|
||||||
|
# Run updatesync where it is needed
|
||||||
|
for package in dbremove:
|
||||||
|
retval = runUpdatesyncDel(repo_dir, package.name)
|
||||||
|
if (retval != 0):
|
||||||
|
error("Updatesync del returned an error!")
|
||||||
|
sys.exit(-1)
|
||||||
|
for package in dbmodify:
|
||||||
|
retval = runUpdatesyncUpd(repo_dir, os.path.join(pkgbuild_dir,package.category,package.name,"PKGBUILD"))
|
||||||
|
if (retval != 0):
|
||||||
|
error("Updatesync upd returned an error!")
|
||||||
|
sys.exit(-1)
|
||||||
|
|
||||||
|
# vim: ft=python ts=2 sw=2 noet
|
||||||
|
|
Loading…
Add table
Reference in a new issue