diff options
author | Oliver Smith <osmith@sysmocom.de> | 2021-01-14 15:33:40 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2021-01-15 16:51:13 +0100 |
commit | d0ab94579bf16d69727bf2539cac691eafb2e388 (patch) | |
tree | f75adab04ac21cdbfecb62a8c2f4c4efb9b655e7 /scripts/common-obs.sh | |
parent | b7f05a92e57650369b975d47b639989a6143454e (diff) |
OBS: add_depend_deb: no self-dependencies
Check if we are trying to make a package depend on itself, and skip in
that case. This happens for the osmocom-nightly etc. metapackages, as
they go through the same code path as regular packages. While at it, use
proper variable names in the function.
Add the new variable as second argument and not as third, because a
fourth argument will be added with the dependency version, and because
this order will be consistent with osmo_obs_add_rpm_spec() when it gets
extended in a future commit.
Fix the following warning:
W: osmocom-nightly source: package-depends-on-itself osmocom-nightly depends
Related: OS#4733
Change-Id: I439079c00259d73a18cb8617a3e76d05df5a7a35
Diffstat (limited to 'scripts/common-obs.sh')
-rw-r--r-- | scripts/common-obs.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh index 1566def..47f3f3d 100644 --- a/scripts/common-obs.sh +++ b/scripts/common-obs.sh @@ -18,13 +18,23 @@ osmo_cmd_require \ # Add dependency to all (sub)packages in debian/control and commit the change. # $1: path to debian/control file -# $2: name of the package to depend on +# $2: package name (e.g. "libosmocore") +# $3: dependency package name (e.g. "osmocom-nightly") osmo_obs_add_depend_deb() { + local d_control="$1" + local pkgname="$2" + local depend="$3" + + if [ "$pkgname" = "$depend" ]; then + echo "NOTE: skipping dependency on itself: $depend" + return + fi + # Note: adding the comma at the end should be fine. If there is a Depends: line, it is most likely not empty. It # should at least have ${misc:Depends} according to lintian. - sed "s/^Depends: /Depends: $2, /g" -i "$1" + sed "s/^Depends: /Depends: $depend, /g" -i "$d_control" - git -C "$(dirname "$1")" commit -m "auto-commit: debian: depend on $2" . + git -C "$(dirname "$d_control")" commit -m "auto-commit: debian: depend on $depend" . } # Copy a project's rpm spec.in file to the osc package dir, set the version/source and 'osc add' it |