diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-02-24 21:20:58 +0000 |
---|---|---|
committer | Paul Eggleton <paul.eggleton@linux.intel.com> | 2013-02-24 21:22:49 +0000 |
commit | 3b5c7ad8257b197b82ae7454bb7999a47c351f91 (patch) | |
tree | 93b573b57ab6014bdbf6e89f5450fa6f36ca4a06 /layerindex/update.py | |
parent | f3174e16f6d8c466bb6510d48a253d7efffc1aa7 (diff) | |
download | openembedded-core-contrib-3b5c7ad8257b197b82ae7454bb7999a47c351f91.tar.gz |
Add ability to update specific layers by name
Add a -l / --layers option to the update script.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'layerindex/update.py')
-rwxr-xr-x | layerindex/update.py | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/layerindex/update.py b/layerindex/update.py index d5e5e32a0f..f1af5df365 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -126,6 +126,9 @@ def main(): usage = """ %prog [options]""") + parser.add_option("-l", "--layer", + help = "Specify layers to update (use commas to separate multiple). Default is all published layers.", + action="store", dest="layers") parser.add_option("-r", "--reload", help = "Discard existing recipe data and fetch it from scratch", action="store_true", dest="reload") @@ -180,17 +183,27 @@ def main(): tinfoil.config_data.setVar('LICENSE', '') - # Fetch all layers fetchdir = settings.LAYER_FETCH_DIR if not fetchdir: logger.error("Please set LAYER_FETCH_DIR in settings.py") sys.exit(1) + if options.layers: + layerquery = LayerItem.objects.filter(name__in=options.layers.split(',')) + if layerquery.count() == 0: + logger.error('No layers matching specified query "%s"' % options.layers) + sys.exit(1) + else: + layerquery = LayerItem.objects.filter(status='P') + if layerquery.count() == 0: + logger.info("No published layers to update") + sys.exit(1) + if not os.path.exists(fetchdir): os.makedirs(fetchdir) fetchedrepos = [] failedrepos = [] - for layer in LayerItem.objects.filter(status='P'): + for layer in layerquery: transaction.enter_transaction_management() transaction.managed(True) try: |