summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/sbuild-deb-package19
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