From b513130f3ac9f291326a3bcf455252c0c31c0e71 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Mon, 24 Nov 2008 05:08:04 -0500 Subject: Rework tupkgupdate scripts. Most work is done on tupkgupdate. Fix some indentation problems. Add some whitespace for style points. Add a new --config switch to specify a config file path. Add a new usage() function that documents the switches more clearly. Delete all gensync code. Signed-off-by: Loui Chang --- tupkg/update/tupkgupdate64 | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'tupkg/update/tupkgupdate64') diff --git a/tupkg/update/tupkgupdate64 b/tupkg/update/tupkgupdate64 index d577ed5c..80c19d91 100755 --- a/tupkg/update/tupkgupdate64 +++ b/tupkg/update/tupkgupdate64 @@ -1,14 +1,19 @@ #!/usr/bin/python -O -import re, os, sys, pacman, getopt -import MySQLdb, MySQLdb.connections +import re +import os +import sys +import pacman +import getopt +import MySQLdb +import MySQLdb.connections import ConfigParser ########################################################### # Deal with configuration ########################################################### -conffile = '/home/aur/tupkgs64.conf' +conffile = '/etc/tupkgs64.conf' if not os.path.isfile(conffile): print "Error: cannot access config file ("+conffile+")" @@ -299,12 +304,6 @@ def deleteFile(filename): command = "rm '" + filename + "'" return execute(command) -def runGensync(repo, pkgbuild): -#target = os.path.join(repo, os.path.basename(repo) + ".db.tar.gz") - target = os.path.join(repo, "community.db.tar.gz") - command = "gensync '" + pkgbuild + "' '" + target + "'" - return execute(command) - def runRepoAdd(repo, package): global havefakeroot targetDB = os.path.join(repo, "community.db.tar.gz") @@ -554,20 +553,16 @@ for file in copy: if (retval != 0): error("Could not copy file to repo: '" + file + "'") sys.exit(-1) + # Delete (second, for safety's sake) for file in delete: deleteFile(file) + # Now that we've copied new files and deleted, we should delete the source # files, if we're supposed to 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) # Run updatesync where it is needed for package in dbremove: -- cgit v1.2.3-24-g4f1b