Change in osmo-ci[master]: OBS: add_depend_deb: no self-dependencies

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

osmith gerrit-no-reply at lists.osmocom.org
Fri Jan 15 15:54:08 UTC 2021


osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/22219 )


Change subject: OBS: add_depend_deb: no self-dependencies
......................................................................

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
---
M scripts/common-obs.sh
M scripts/osmocom-latest-packages.sh
M scripts/osmocom-nightly-packages.sh
3 files changed, 15 insertions(+), 5 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/19/22219/1

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 @@
 
 # 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
diff --git a/scripts/osmocom-latest-packages.sh b/scripts/osmocom-latest-packages.sh
index 271824f..2689e35 100755
--- a/scripts/osmocom-latest-packages.sh
+++ b/scripts/osmocom-latest-packages.sh
@@ -73,7 +73,7 @@
     ./git-version-gen . > .tarball-version 2>/dev/null
   fi
 
-  osmo_obs_add_depend_deb "./debian/control" "osmocom-latest"
+  osmo_obs_add_depend_deb "./debian/control" "$project" "osmocom-latest"
 
   if [ "$project" = "open5gs" ]; then
     # we cannot control the output directory of the generated source :(
diff --git a/scripts/osmocom-nightly-packages.sh b/scripts/osmocom-nightly-packages.sh
index 4234021..3f95d17 100755
--- a/scripts/osmocom-nightly-packages.sh
+++ b/scripts/osmocom-nightly-packages.sh
@@ -129,7 +129,7 @@
 
   if [ "$changelog" = "commit" ] ; then
     VER=$(get_commit_version)
-    osmo_obs_add_depend_deb "./debian/control" "osmocom-$FEED"
+    osmo_obs_add_depend_deb "./debian/control" "$name" "osmocom-$FEED"
     dch -b -v "$VER" -m "Snapshot build"
     git commit -m "$VER snapshot" debian/
   fi

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/22219
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I439079c00259d73a18cb8617a3e76d05df5a7a35
Gerrit-Change-Number: 22219
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210115/2725263f/attachment.htm>


More information about the gerrit-log mailing list