summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2020-05-25 11:25:03 +0200
committerosmith <osmith@sysmocom.de>2020-05-28 10:01:23 +0000
commit79b63d35a21d45005c1af1518a9aac643df588ca (patch)
treedcbf23e58a3575b7ea927a1170522a85b98e2cd4
parent1d0b144ad4a364d9971ce226b1f4fa746cf37cdc (diff)
OBS: support more than one conflicting package
For the upcoming network:osmocom:next repository, it would be inconsistent to have the debian package conflict mechanism only support latest and nightly, even if the next repository is currently not built for debian. Change-Id: I2c07313fbbdffe5571e447059b08fe74c853cef0
-rw-r--r--scripts/common-obs.sh28
1 files changed, 22 insertions, 6 deletions
diff --git a/scripts/common-obs.sh b/scripts/common-obs.sh
index 137887b..3aa2a36 100644
--- a/scripts/common-obs.sh
+++ b/scripts/common-obs.sh
@@ -26,17 +26,17 @@ osmo_cmd_require \
# └── source
# └── format
# $1: name of dummy package (e.g. "osmocom-nightly")
-# $2: name of conflicting package (e.g. "osmocom-latest")
+# $2-*: name of conflicting packages (e.g. "osmocom-latest")
osmo_obs_prepare_conflict() {
local pkgname="$1"
- local pkgname_conflict="$2"
+ shift
local pkgver="0.0.0"
local oldpwd="$PWD"
mkdir -p "$pkgname/debian/source"
cd "$pkgname/debian"
- # Fill control, changelog, rules
+ # Fill control
cat << EOF > control
Source: ${pkgname}
Section: unknown
@@ -48,16 +48,32 @@ Standards-Version: 3.9.8
Package: ${pkgname}
Depends: \${misc:Depends}
Architecture: any
-Conflicts: ${pkgname_conflict}
-Description: Dummy package, which conflicts with ${pkgname_conflict}
EOF
+ printf "Conflicts: " >> control
+ first=1
+ for i in "$@"; do
+ if [ "$first" -eq 1 ]; then
+ first=0
+ else
+ printf ", " >> control
+ fi
+ printf "%s" "$i" >> control
+ done
+ printf "\n" >> control
+ cat << EOF >> control
+Description: Dummy package, which conflicts with: $@
+EOF
+
+ # Fill changelog
cat << EOF > changelog
${pkgname} (${pkgver}) unstable; urgency=medium
- * Dummy package, which conflicts with ${pkgname_conflict}.
+ * Dummy package, which conflicts with: $@
-- Oliver Smith <osmith@sysmocom.de> Thu, 13 Jun 2019 12:50:19 +0200
EOF
+
+ # Fill rules
cat << EOF > rules
#!/usr/bin/make -f
%: