diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-09-06 22:13:49 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-09-06 22:13:55 +0200 |
commit | 28c611a5d4638f7eb0abf66880000f5f6b73888d (patch) | |
tree | 5e9824db235e5d755f8dace44971f078a33508f9 /bin/sbuild-deb-package | |
parent | 077bc548a718eb1ee6d9453c0f0c5b3736d0e7ad (diff) | |
download | buildscripts-28c611a5d4638f7eb0abf66880000f5f6b73888d.tar.gz buildscripts-28c611a5d4638f7eb0abf66880000f5f6b73888d.tar.bz2 buildscripts-28c611a5d4638f7eb0abf66880000f5f6b73888d.zip |
sbuild-deb-package: also support DEBSRCPKG name in clean-up and upload function
Diffstat (limited to 'bin/sbuild-deb-package')
-rwxr-xr-x | bin/sbuild-deb-package | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/bin/sbuild-deb-package b/bin/sbuild-deb-package index 7dcc1a5..eddac1f 100755 --- a/bin/sbuild-deb-package +++ b/bin/sbuild-deb-package @@ -76,6 +76,7 @@ set_vars() { PROJECT_PATH="${1}" PROJECT_PATH="${PROJECT_PATH/%.git/}" PROJECT="$(basename "${PROJECT_PATH}")" + DEBSRCPKG="${PROJECT}" # grab repository component area from command line (2nd argv) or guess it ARGV2_COMPONENT="$(cut -d"/" -f1 <<< "${2}/")" @@ -140,6 +141,11 @@ prepare_workspace() { cd "${PROJECT_DIR}" + # extract Debian source package name from debian/changelog + if [ -e debian/changelog ]; then + DEBSRCPKG="$(dpkg-parsechangelog -S Source)" + fi + return 0 } @@ -169,11 +175,11 @@ clear_pkgdist() { [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { mkdir -p -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/dupload.conf" - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${PROJECT}_"*.changes - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${PROJECT}_"*.upload - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${PROJECT}_"*.build - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${PROJECT}_"*.dsc - rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${PROJECT}_"*.tar.gz + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${DEBSRCPKG}_"*.changes + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${DEBSRCPKG}_"*.upload + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${DEBSRCPKG}_"*.build + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${DEBSRCPKG}_"*.dsc + rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/${DEBSRCPKG}_"*.tar.gz rm -f -- "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}/"*.deb } done @@ -290,7 +296,6 @@ build_packages() { # build the source package dpkg-buildpackage -uc -us -S -d - DEBSRCPKG="$(dpkg-parsechangelog -S Source)" cd .. DSCFILE="$(pwd)/$(ls -1 "${DEBSRCPKG}_"*.dsc | head -n1)" @@ -360,7 +365,7 @@ upload_packages() { [ "x${SKIP_ARCH}" != "x${l_ARCH}" ] && { cd "${PKGDIST}/${l_DIST}/${l_CODENAME}/${l_ARCH}" test -f "./dupload.conf" || ln -s -- "${HOME}/.dupload.conf.${PREFIX}" "./dupload.conf" && true - ls -- "${PROJECT}_"*.changes >/dev/null 2>&1 && dupload --to "${PREFIX}-${l_DIST}-${COMPONENT}" "${PROJECT}_"*.changes 0<&- + ls -- "${DEBSRCPKG}_"*.changes >/dev/null 2>&1 && dupload --to "${PREFIX}-${l_DIST}-${COMPONENT}" "${DEBSRCPKG}_"*.changes 0<&- } done done |