diff options
author | Oliver Smith <osmith@sysmocom.de> | 2021-01-14 15:07:05 +0100 |
---|---|---|
committer | Oliver Smith <osmith@sysmocom.de> | 2021-01-15 16:51:09 +0100 |
commit | 38fccbdd188fbb25dec65e0e29ceab64f2fd0e24 (patch) | |
tree | 7755b77626a04aadc15326a57d14d9a507a04bb7 /scripts/common-obs-conflict.sh | |
parent | 912a2d36dfcff8f914678d8894377abfc5d88e7f (diff) |
OBS: conflict: move common code from _deb to main
Move logic to create the package directory, change into it, and to put
the directory into a git repository and tag it with the package version,
into the common function. Again, in preparation to add a _rpm function.
Related: OS#4733
Change-Id: I3066147ef5469cce9d269b119d9ffa3e53f00403
Diffstat (limited to 'scripts/common-obs-conflict.sh')
-rw-r--r-- | scripts/common-obs-conflict.sh | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/scripts/common-obs-conflict.sh b/scripts/common-obs-conflict.sh index ec877a1..ecd21c7 100644 --- a/scripts/common-obs-conflict.sh +++ b/scripts/common-obs-conflict.sh @@ -10,22 +10,21 @@ OSMO_OBS_CONFLICT_PKGVER="1.0.0" # $2-*: name of conflicting packages (e.g. "osmocom-latest") # # Generates the following directory structure: -# osmocom-nightly -# └── debian -# ├── changelog -# ├── compat -# ├── control -# ├── copyright -# ├── rules -# └── source -# └── format +# debian +# ├── changelog +# ├── compat +# ├── control +# ├── copyright +# ├── rules +# └── source +# └── format osmo_obs_prepare_conflict_deb() { local pkgname="$1" shift local oldpwd="$PWD" - mkdir -p "$pkgname/debian/source" - cd "$pkgname/debian" + mkdir -p "debian/source" + cd "debian" # Fill control cat << EOF > control @@ -77,13 +76,6 @@ EOF echo "3.0 (native)" > source/format touch copyright - # Put in git repository - cd .. - git init . - git add -A - git commit -m "auto-commit: $pkgname dummy package" || true - git tag -f "$OSMO_OBS_CONFLICT_PKGVER" - cd "$oldpwd" } @@ -91,5 +83,19 @@ EOF # $1: name of dummy package (e.g. "osmocom-nightly") # $2-*: name of conflicting packages (e.g. "osmocom-latest") osmo_obs_prepare_conflict() { + local pkgname="$1" + local oldpwd="$PWD" + + mkdir -p "$pkgname" + cd "$pkgname" + osmo_obs_prepare_conflict_deb "$@" + + # Put in git repository + git init . + git add -A + git commit -m "auto-commit: $pkgname dummy package" || true + git tag -f "$OSMO_OBS_CONFLICT_PKGVER" + + cd "$oldpwd" } |