summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenfe-Mickael Laventure <mickael.laventure@gmail.com>2016-06-02 20:55:53 -0700
committerKenfe-Mickael Laventure <mickael.laventure@gmail.com>2016-06-02 21:01:57 -0700
commitacd67e25a9d419f2933ea2d6afacdfa60519e3b9 (patch)
tree18a5b5ed1d1ac204cd28c366f81a074406d5f8a9
parentd1b1b6a98ef5381d2f3702d2c11856f692a0a412 (diff)
downloaddocker-acd67e25a9d419f2933ea2d6afacdfa60519e3b9.tar.gz
Do not overwrite already published deb files when releasing
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
-rwxr-xr-xhack/make/release-deb29
1 files changed, 20 insertions, 9 deletions
diff --git a/hack/make/release-deb b/hack/make/release-deb
index f1edf77235..70d64ea544 100755
--- a/hack/make/release-deb
+++ b/hack/make/release-deb
@@ -102,18 +102,29 @@ for dir in contrib/builder/deb/${PACKAGE_ARCH}/*/; do
version="$(basename "$dir")"
codename="${version//debootstrap-}"
+ tempdir="$(mktemp -d /tmp/tmp-docker-release-deb.XXXXXXXX)"
DEBFILE=( "bundles/$VERSION/build-deb/$version/docker-engine"*.deb )
- # if we have a $GPG_PASSPHRASE we may as well
- # dpkg-sign before copying the deb into the pool
- if [ ! -z "$GPG_PASSPHRASE" ]; then
- dpkg-sig -g "--no-tty --passphrase '$GPG_PASSPHRASE'" \
- -k "$GPG_KEYID" --sign builder "${DEBFILE[@]}"
- fi
-
- # add the deb for each component for the distro version into the pool
+ # add the deb for each component for the distro version into the
+ # pool (if it is not there already)
mkdir -p "$APTDIR/pool/$component/d/docker-engine/"
- cp "${DEBFILE[@]}" "$APTDIR/pool/$component/d/docker-engine/"
+ for deb in ${DEBFILE[@]}; do
+ d=$(basename "$deb")
+ # We do not want to generate a new deb if it has already been
+ # copied into the APTDIR
+ if [ ! -f "$APTDIR/pool/$component/d/docker-engine/$d" ]; then
+ cp "$deb" "$tempdir/"
+ # if we have a $GPG_PASSPHRASE we may as well
+ # dpkg-sign before copying the deb into the pool
+ if [ ! -z "$GPG_PASSPHRASE" ]; then
+ dpkg-sig -g "--no-tty --passphrase '$GPG_PASSPHRASE'" \
+ -k "$GPG_KEYID" --sign builder "$tempdir/$d"
+ fi
+ mv "$tempdir/$d" "$APTDIR/pool/$component/d/docker-engine/"
+ fi
+ done
+
+ rm -rf "$tempdir"
# build the right directory structure, needed for apt-ftparchive
for arch in "${arches[@]}"; do