laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ci/+/31935 )
Change subject: obs: add --allow-unknown-package
......................................................................
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
---
M scripts/obs/lib/__init__.py
M scripts/obs/update_obs_project.py
2 files changed, 24 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
laforge: Looks good to me, approved
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 @@
" 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 @@
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 @@
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)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/31935
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I007f937ccb629e0593ec9253541ed05df42fac66
Gerrit-Change-Number: 31935
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged