Fix logic of build.sh for REUSE_EXISTING_ORIG_TARBALL for synstructure
Ximin Luo
4 years ago
42 | 42 | } |
43 | 43 | |
44 | 44 | if shouldbuild ${DEBSRC}_${DEBVER}.dsc "$PKGNAME/debian/changelog" ]; then |
45 | ( cd "$PKGNAME" && dpkg-buildpackage -d -S --no-sign ) | |
46 | 45 | if [ "$REUSE_EXISTING_ORIG_TARBALL" = 1 ]; then |
47 | 46 | UPSVER="${DEBVER%-*}" |
48 | 47 | mv "${DEBSRC}_${UPSVER}.orig.tar.gz" "${DEBSRC}_${UPSVER}.orig.tar.gz.new" |
49 | apt-get -t unstable source "${DEBSRC}" # "=${DEBVER}" | |
48 | apt-get -t unstable source --download-only "${DEBSRC}" # "=${DEBVER}" | |
50 | 49 | # check that old tarball contains same contents as new tarball |
51 | 50 | if ! diff -ru \ |
52 | 51 | --label "${DEBSRC}_${UPSVER}.orig.tar.gz.new" \ |
56 | 55 | read -p "contents differ, continue with old tarball or abort? [y/N] " x |
57 | 56 | if [ "$x" != "y" ]; then exit 1; fi |
58 | 57 | fi |
59 | ( cd "$PKGNAME" && dpkg-buildpackage -d -S --no-sign ) | |
58 | # extract old tarball into new directory, to avoid "modified files" problems with dpkg-source later | |
59 | ( cd "$PKGNAME" && dpkg-source --after-build . && tar --strip-components=1 -xf "../${DEBSRC}_${UPSVER}.orig.tar.gz" ) | |
60 | 60 | fi |
61 | ( cd "$PKGNAME" && dpkg-buildpackage -d -S --no-sign ) | |
61 | 62 | # sign if not UNRELEASED |
62 | 63 | if echo "$DEBDIST" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then |
63 | 64 | debsign ${DEBSRC}_${DEBVER}_source.changes |