]> git.ipfire.org Git - location/libloc.git/commitdiff
importer: Add the option to only update one feed
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 11:00:26 +0000 (11:00 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 2 Mar 2024 11:00:26 +0000 (11:00 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/location-importer.in

index 3fa8357299fdcbc428914f712814be60b060b7e1..45b18dd6c0ce6c3ad80511a133cc4ad861da8c57 100644 (file)
@@ -107,6 +107,8 @@ class CLI(object):
                # Update feeds
                update_feeds = subparsers.add_parser("update-feeds",
                        help=_("Update Feeds"))
+               update_feeds.add_argument("feeds", nargs="*",
+                       help=_("Only update these feeds"))
                update_feeds.set_defaults(func=self.handle_update_feeds)
 
                # Update overrides
@@ -1812,6 +1814,10 @@ class CLI(object):
 
                # Walk through all feeds
                for name, callback, url, *args in feeds:
+                       # Skip any feeds that were not requested on the command line
+                       if ns.feeds and not name in ns.feeds:
+                               continue
+
                        try:
                                self._process_feed(downloader, name, callback, url, *args)