| 1 |
#!/usr/bin/python2.6 |
| 2 |
# |
| 3 |
# $Id: update_contents_cache.py 10541 2010-07-19 08:39:22Z wahwah $ |
| 4 |
# |
| 5 |
# This file only creates an instance of SystemPkgmap in order to update the |
| 6 |
# package cache (if necessary), and display the information about the update. |
| 7 |
|
| 8 |
import optparse |
| 9 |
import os |
| 10 |
import os.path |
| 11 |
import sys |
| 12 |
import logging |
| 13 |
|
| 14 |
# The following bit of code sets the correct path to Python libraries |
| 15 |
# distributed with GAR. |
| 16 |
path_list = [os.path.dirname(__file__), |
| 17 |
"..", "lib", "python"] |
| 18 |
sys.path.append(os.path.join(*path_list)) |
| 19 |
import checkpkg |
| 20 |
|
| 21 |
def main(): |
| 22 |
parser = optparse.OptionParser() |
| 23 |
parser.add_option("-d", "--debug", |
| 24 |
dest="debug", |
| 25 |
default=False, |
| 26 |
action="store_true") |
| 27 |
parser.add_option("-p", "--profile", |
| 28 |
dest="profile", |
| 29 |
default=False, |
| 30 |
action="store_true", |
| 31 |
help="A disabled option") |
| 32 |
(options, args) = parser.parse_args() |
| 33 |
if options.debug: |
| 34 |
logging.basicConfig(level=logging.DEBUG) |
| 35 |
else: |
| 36 |
logging.basicConfig(level=logging.INFO) |
| 37 |
test_pkgmap = checkpkg.SystemPkgmap(debug=options.debug) |
| 38 |
test_pkgmap.InitializeDatabase() |
| 39 |
|
| 40 |
|
| 41 |
if __name__ == '__main__': |
| 42 |
main() |