From d97a0a376b92bded036275079eeee78714b0fb81 Mon Sep 17 00:00:00 2001 From: simo Date: Mon, 20 Jun 2005 07:30:09 +0000 Subject: Tupkgupdate now uses updatesync --- tupkg/update/tupkgupdate | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'tupkg/update') diff --git a/tupkg/update/tupkgupdate b/tupkg/update/tupkgupdate index 7e8c67bd..5c20abfa 100755 --- a/tupkg/update/tupkgupdate +++ b/tupkg/update/tupkgupdate @@ -297,6 +297,16 @@ def runGensync(repo, pkgbuild): command = "gensync '" + pkgbuild + "' '" + target + "'" 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 ############################################################ @@ -528,8 +538,22 @@ if (switches.get("--delete") == True): for file in copy: deleteFile(file) # Run gensync to build the repo index -if (len(copy) + len(delete) > 0): - retval = runGensync(repo_dir, pkgbuild_dir) - if (retval != 0): - error("Gensync returned an error!") - sys.exit(-1) +#if (len(copy) + len(delete) > 0): +# retval = runGensync(repo_dir, pkgbuild_dir) +# if (retval != 0): +# error("Gensync returned an error!") +# 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 -- cgit v1.2.3-24-g4f1b