1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Do not overwrite already published deb files when releasing

Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
Kenfe-Mickael Laventure 2016-06-02 20:55:53 -07:00
parent d1b1b6a98e
commit acd67e25a9

View file

@ -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