bzr branch
/bzr/packagedb/0.5.x
| Line | Revision | Contents |
| 1 | 562.1.4 | #!/usr/bin/python |
| 2 | __requires__ = 'fedora_packagedb' |
|
| 3 | ||
| 4 | import os.path |
|
| 5 | import sys |
|
| 6 | ||
| 7 | CONFDIR='@CONFDIR@' |
|
| 8 | PKGDBDIR=os.path.join('@DATADIR@', 'fedora-packagedb') |
|
| 9 | sys.path.append(PKGDBDIR) |
|
| 10 | ||
| 11 | import pkg_resources |
|
| 12 | ||
| 13 | from turbogears import config, update_config |
|
| 14 | from migrate.versioning.shell import main |
|
| 15 | ||
| 16 | # first look on the command line for a desired config file, |
|
| 17 | # if it's not on the command line, then |
|
| 18 | # look for setup.py in this directory. If it's not there, this script is |
|
| 19 | # probably installed |
|
| 20 | cfg_file = None |
|
| 21 | if len(sys.argv) > 1: |
|
| 22 | for idx, arg in enumerate(sys.argv): |
|
| 23 | if arg=='-c': |
|
| 24 | # remove -c <cfgfile> from args |
|
| 25 | cfg_file = sys.argv[idx+1] |
|
| 26 | del sys.argv[idx+1] |
|
| 27 | del sys.argv[idx] |
|
| 28 | break |
|
| 29 | if not cfg_file and os.path.exists(os.path.join(os.path.dirname(__file__), "setup.py")): |
|
| 30 | 590.1.2 | cfg_file = "db_setup.cfg" |
| 31 | 562.1.4 | elif not cfg_file: |
| 32 | 590.1.2 | cfg_file = os.path.join(CONFDIR,'db_setup.cfg') |
| 33 | 562.1.4 | |
| 34 | update_config(configfile=cfg_file, modulename="pkgdb.config") |
|
| 35 | ||
| 36 | 562.1.8 | main(url=config.get('sqlalchemy.dburi'),repository=config.get('database.repo')) |
Loggerhead 1.18.1 is a web-based interface for Bazaar branches