mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
tupkgupdate: add config_use_db check to allow skipping of DB operations
This should prevent us from needing to completely duplicate the tupkgupdate script for x86_64, where we currently skip the DB updates step. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
7a1169431a
commit
3c8442d70c
1 changed files with 22 additions and 19 deletions
|
@ -17,6 +17,7 @@ if not os.path.isfile(conffile):
|
||||||
|
|
||||||
config = ConfigParser.ConfigParser()
|
config = ConfigParser.ConfigParser()
|
||||||
config.read(conffile)
|
config.read(conffile)
|
||||||
|
config_use_db = config.has_section('mysql')
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
|
|
||||||
|
@ -366,7 +367,8 @@ else:
|
||||||
|
|
||||||
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 if we need it so we find out now if we can't!
|
||||||
|
if config_use_db:
|
||||||
db = PackageDatabase(config.get('mysql', 'host'),
|
db = PackageDatabase(config.get('mysql', 'host'),
|
||||||
config.get('mysql', 'username'),
|
config.get('mysql', 'username'),
|
||||||
config.get('mysql', 'password'),
|
config.get('mysql', 'password'),
|
||||||
|
@ -531,7 +533,8 @@ if (had_error == 1):
|
||||||
# PASS 3: EXECUTION
|
# PASS 3: EXECUTION
|
||||||
#
|
#
|
||||||
|
|
||||||
# First, do all the database updates
|
if config_use_db:
|
||||||
|
# First, do all the database updates if asked for
|
||||||
for package in dbremove:
|
for package in dbremove:
|
||||||
id = db.lookup(package.name)
|
id = db.lookup(package.name)
|
||||||
# Note: this could remove a package from unsupported; probably want to restrict to locationId and/or non-dummy
|
# Note: this could remove a package from unsupported; probably want to restrict to locationId and/or non-dummy
|
||||||
|
|
Loading…
Add table
Reference in a new issue