diff options
author | Oliver Smith <osmith@sysmocom.de> | 2023-03-15 13:33:22 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2023-03-17 11:33:55 +0100 |
commit | dc1415959fb47190a5a5f5e2e48a871548e242b6 (patch) | |
tree | 8918919212f8ab7442659b4b6794e4c4a22242f9 | |
parent | 3ccebc45149a311a8048467209584fac08067e4a (diff) |
obs: add --allow-unknown-package
Prepare to add a wireshark package. It will be in its own
osmocom:wireshark repository, and not in osmocom:nightly, :latest,
:master, so it's not added to lib/config.py.
Move lib.set_args() before parse_packages(), so the latter is able to
use lib.args.allow_unknown_package.
Related: OS#2537
Change-Id: I007f937ccb629e0593ec9253541ed05df42fac66
-rw-r--r-- | scripts/obs/lib/__init__.py | 6 | ||||
-rwxr-xr-x | scripts/obs/update_obs_project.py | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/scripts/obs/lib/__init__.py b/scripts/obs/lib/__init__.py index 675bcec..964b298 100644 --- a/scripts/obs/lib/__init__.py +++ b/scripts/obs/lib/__init__.py @@ -27,6 +27,9 @@ def add_shared_arguments(parser): " other feeds build their respective branch.", metavar="FEED", default="nightly", choices=lib.config.feeds) + parser.add_argument("-a", "--allow-unknown-package", action="store_true", + help="don't complain if the name of the package is not" + " stored in lib/config.py") parser.add_argument("-b", "--git-branch", help="instead of using a branch" " based on the feed, checkout this git branch", metavar="BRANCH", default=None) @@ -102,6 +105,9 @@ def set_proper_package_name(package): if os.path.basename(package_cfg) == package: return package_cfg + if lib.args.allow_unknown_package: + return package + print(f"ERROR: unknown package: {package}") print("See packages_osmocom and packages_other in obs/lib/config.py") exit(1) diff --git a/scripts/obs/update_obs_project.py b/scripts/obs/update_obs_project.py index 24dba8f..da796ad 100755 --- a/scripts/obs/update_obs_project.py +++ b/scripts/obs/update_obs_project.py @@ -194,9 +194,8 @@ def main(): help="package name, e.g. libosmocore or open5gs," " default is all packages") args = parser.parse_args() - packages = parse_packages(args.package) - lib.set_args(args) + packages = parse_packages(args.package) if args.docker: lib.docker.run_in_docker_and_exit("update_obs_project.py", True) |