From c64375842163fb46f79d6e6805ecbfb16be3a362 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 4 Jun 2021 22:01:13 +0200 Subject: Updating. Signed-off-by: Daniel Baumann --- bin/debian-chroot | 8 +-- bin/pbuild.sh | 35 ++++++++++- bin/pmove.sh | 185 ++++++++++++++++++++++++++++-------------------------- 3 files changed, 134 insertions(+), 94 deletions(-) diff --git a/bin/debian-chroot b/bin/debian-chroot index 0aa8ed7..1d67a5c 100755 --- a/bin/debian-chroot +++ b/bin/debian-chroot @@ -201,7 +201,7 @@ EOF cat > "${CHROOT}/build/.bash_history" << EOF cd */ && sudo apt-get build-dep -y . && dpkg-buildpackage -B && cd .. && rm -rf */ sudo apt-get install -y -t ${DERIVATIVE_DISTRIBUTION}-backports debhelper -clear && pbuild.sh -a -b binary-arch -d ${DERIVATIVE_DISTRIBUTION}-backports -p +clear && pbuild.sh -a -u -b binary-arch -d ${DERIVATIVE_DISTRIBUTION}-backports -p rsync -aPv --progress --stats * apt.progress-linux.org::upload && rm -rf * EOF @@ -212,7 +212,7 @@ EOF cat > "${CHROOT}/build/.bash_history" << EOF cd */ && sudo apt-get build-dep -y . && dpkg-buildpackage -A && cd .. && rm -rf */ sudo apt-get install -y -t ${DERIVATIVE_DISTRIBUTION}-backports debhelper -clear && pbuild.sh -a -b binary-indep -d ${DERIVATIVE_DISTRIBUTION}-backports -p +clear && pbuild.sh -a -u -b binary-indep -d ${DERIVATIVE_DISTRIBUTION}-backports -p rsync -aPv --progress --stats * apt.progress-linux.org::upload && rm -rf * EOF @@ -292,7 +292,7 @@ EOF cat > "${CHROOT}/build/.bash_history" << EOF cd */ && sudo apt-get build-dep -y . && dpkg-buildpackage -B && cd .. && rm -rf */ sudo apt-get install -y -t ${DERIVATIVE_DISTRIBUTION}-backports debhelper -clear && pbuild.sh -a -b binary-arch -d ${DERIVATIVE_DISTRIBUTION}-backports -p +clear && pbuild.sh -a -u -b binary-arch -d ${DERIVATIVE_DISTRIBUTION}-backports -p rsync -aPv --progress --stats * apt.progress-linux.org::upload && rm -rf * EOF @@ -303,7 +303,7 @@ EOF cat > "${CHROOT}/build/.bash_history" << EOF cd */ && sudo apt-get build-dep -y . && dpkg-buildpackage -A && cd .. && rm -rf */ sudo apt-get install -y -t ${DERIVATIVE_DISTRIBUTION}-backports debhelper -clear && pbuild.sh -a -b binary-indep -d ${DERIVATIVE_DISTRIBUTION}-backports -p +clear && pbuild.sh -a -u -b binary-indep -d ${DERIVATIVE_DISTRIBUTION}-backports -p rsync -aPv --progress --stats * apt.progress-linux.org::upload && rm -rf * EOF diff --git a/bin/pbuild.sh b/bin/pbuild.sh index a2bc7cb..f329c2a 100755 --- a/bin/pbuild.sh +++ b/bin/pbuild.sh @@ -43,8 +43,8 @@ esac Parameters() { - LONG_OPTIONS="auto,build:,distribution:,interactive,package:,tag:," - OPTIONS="a,b:,d:,i,p:,t:," + LONG_OPTIONS="auto,build:,distribution:,interactive,package:,tag:,upload," + OPTIONS="a,b:,d:,i,p:,t:,u," PARAMETERS="$(getopt --longoptions ${LONG_OPTIONS} --name=${PROGRAM} --options ${OPTIONS} --shell sh -- ${@})" @@ -89,6 +89,11 @@ Parameters() shift 2 ;; + -u|--upload) + UPLOAD="true" + shift + ;; + --) shift break @@ -222,6 +227,19 @@ do dpkg-source -b "${TARGET}-${UPSTREAM_VERSION}" rm -rf "${TARGET}-${UPSTREAM_VERSION}" + + # upload + case "${UPLOAD}" in + true) + FILES="$(sed -e '1,/^Files:$/ d' ${TARGET}_${SOURCE_VERSION}*.dsc | awk '/^ / { print $5 }')" + + for FILE in ${FILES} + do + rsync -aP "${FILE}" apt.progress-linux.org::upload + rm -f "${FILE}" + done + ;; + esac ;; binary*) @@ -320,6 +338,19 @@ do cd "${OLDPWD}" rm -rf "${SOURCE}" + + # upload + case "${UPLOAD}" in + true) + FILES="$(sed -e '1,/^Files:$/ d' ${TARGET}_${SOURCE_VERSION}_*.changes | awk '/^ / { print $5 }')" + + for FILE in ${FILES} + do + rsync -aP "${FILE}" apt.progress-linux.org::upload + rm -f "${FILE}" + done + ;; + esac ;; esac done diff --git a/bin/pmove.sh b/bin/pmove.sh index a3e18c5..bcd1425 100755 --- a/bin/pmove.sh +++ b/bin/pmove.sh @@ -24,121 +24,130 @@ do continue fi - CHANGES="$(ls ${UPLOAD}/*_${ARCHITECTURE}.changes)" + CHANGES="$(ls ${UPLOAD}/*_${ARCHITECTURE}.changes | sort -V)" - PACKAGE="$(basename ${CHANGES} .changes | awk -F_ '{ print $1 }')" + for CHANGE in ${CHANGES} + do + PACKAGE="$(basename ${CHANGE} .changes | awk -F_ '{ print $1 }')" - if [ "$(basename ${PWD})" != "${PACKAGE}" ] - then - mkdir -p "${PACKAGE}" - cd "${PACKAGE}" - fi + if [ "$(basename ${PWD})" != "${PACKAGE}" ] + then + mkdir -p "${PACKAGE}" + cd "${PACKAGE}" + fi - VERSION="$(grep -m1 '^Version: ' ${CHANGES} | awk '{ print $2 }')" + VERSION="$(grep -m1 '^Version: ' ${CHANGE} | awk '{ print $2 }')" - SOURCE_VERSION="$(echo ${VERSION} | awk -F: '{ print $2 }')" - SOURCE_VERSION="${SOURCE_VERSION:-${VERSION}}" + SOURCE_VERSION="$(echo ${VERSION} | awk -F: '{ print $2 }')" + SOURCE_VERSION="${SOURCE_VERSION:-${VERSION}}" - UPSTREAM_VERSION="$(echo ${SOURCE_VERSION} | awk -F- '{ $NF=""; print $0 }' | sed -e 's| |-|g' -e 's|-$||')" + UPSTREAM_VERSION="$(echo ${SOURCE_VERSION} | awk -F- '{ $NF=""; print $0 }' | sed -e 's| |-|g' -e 's|-$||')" - mkdir "${VERSION}_${ARCHITECTURE}" + mkdir "${VERSION}_${ARCHITECTURE}" - cd "${VERSION}_${ARCHITECTURE}" + cd "${VERSION}_${ARCHITECTURE}" - if ls ${UPLOAD}/*_${ARCHITECTURE}.deb > /dev/null 2>&1 - then - mv ${UPLOAD}/*_${ARCHITECTURE}.deb . - fi - if ls ${UPLOAD}/*_${ARCHITECTURE}.udeb > /dev/null 2>&1 - then - mv ${UPLOAD}/*_${ARCHITECTURE}.udeb . - fi - if ls ${UPLOAD}/*_${ARCHITECTURE}.buildinfo > /dev/null 2>&1 - then - mv ${UPLOAD}/*_${ARCHITECTURE}.buildinfo . + FILES="$(sed -e '1,/^Files:$/ d' ${CHANGE} | awk '/^ / { print $5 }' | grep -v '^<')" - # FIXING buildinfo file - sed -i -e '/^ DEB_BUILD_OPTIONS="/d' \ - -e 's|^ LANG="en_US.UTF-8"| LANG="C.UTF-8"|' \ - *_${ARCHITECTURE}.buildinfo - fi - mv ${UPLOAD}/*_${ARCHITECTURE}.changes . - reprepro_fix-changes.sh *_${ARCHITECTURE}.changes + for FILE in ${FILES} + do + mv "${UPLOAD}/${FILE}" . + done + + if ls *_${ARCHITECTURE}.buildinfo > /dev/null 2>&1 + then + # FIXING buildinfo file + sed -i -e '/^ DEB_BUILD_OPTIONS="/d' \ + -e 's|^ LANG="en_US.UTF-8"| LANG="C.UTF-8"|' \ + *_${ARCHITECTURE}.buildinfo + fi + mv ${CHANGE} . + reprepro_fix-changes.sh *_${ARCHITECTURE}.changes - case "${MODE}" in - progress-linux) - psign.sh - ;; + case "${MODE}" in + progress-linux) + psign.sh + ;; - bfh) - bsign.sh - ;; - esac + bfh) + bsign.sh + ;; + esac - cd .. - rm -f current_${ARCHITECTURE} - ln -s "${VERSION}_${ARCHITECTURE}" current_${ARCHITECTURE} + cd .. + rm -f current_${ARCHITECTURE} + ln -s "${VERSION}_${ARCHITECTURE}" current_${ARCHITECTURE} - cd "${CURDIR}" + cd "${CURDIR}" + done done -for DSC in ${UPLOAD}/*.dsc -do - if [ ! -e "${DSC}" ] - then - break - fi +if ls ${UPLOAD}/*.dsc > /dev/null 2>&1 +then + DSCs="$(ls ${UPLOAD}/*.dsc | sort -V)" - PACKAGE="$(basename ${DSC} .dsc | awk -F_ '{ print $1 }')" + for DSC in ${DSCs} + do + if [ ! -e "${DSC}" ] + then + break + fi - if [ "$(basename ${PWD})" != "${PACKAGE}" ] - then - mkdir -p "${PACKAGE}" - cd "${PACKAGE}" - fi + PACKAGE="$(basename ${DSC} .dsc | awk -F_ '{ print $1 }')" - VERSION="$(grep -m1 '^Version: ' ${DSC} | awk '{ print $2 }')" + if [ "$(basename ${PWD})" != "${PACKAGE}" ] + then + mkdir -p "${PACKAGE}" + cd "${PACKAGE}" + fi - SOURCE_VERSION="$(echo ${VERSION} | awk -F: '{ print $2 }')" - SOURCE_VERSION="${SOURCE_VERSION:-${VERSION}}" + VERSION="$(grep -m1 '^Version: ' ${DSC} | awk '{ print $2 }')" - UPSTREAM_VERSION="$(echo ${SOURCE_VERSION} | awk -F- '{ $NF=""; print $0 }' | sed -e 's| |-|g' -e 's|-$||')" + SOURCE_VERSION="$(echo ${VERSION} | awk -F: '{ print $2 }')" + SOURCE_VERSION="${SOURCE_VERSION:-${VERSION}}" - mkdir "${VERSION}_source" + UPSTREAM_VERSION="$(echo ${SOURCE_VERSION} | awk -F- '{ $NF=""; print $0 }' | sed -e 's| |-|g' -e 's|-$||')" - cd "${VERSION}_source" + mkdir "${VERSION}_source" + cd "${VERSION}_source" - if ls ../orig/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz > /dev/null 2>&1 - then - ln -s ../orig/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz ./ - fi + FILES="$(sed -e '1,/^Files:$/ d' ${DSC} | awk '/^ / { print $3 }' | grep -v '^<')" - mv ${UPLOAD}/*.dsc . - mv ${UPLOAD}/*.orig.tar.xz . - mv ${UPLOAD}/*.debian.tar.xz . + for FILE in ${FILES} + do + mv "${UPLOAD}/${FILE}" . - case "${MODE}" in - progress-linux) - psign.sh - ;; + if [ -e ../orig/${FILE} ] + then + ln -sf ../orig/${FILE} ${FILE} + fi + done - bfh) - bsign.sh - ;; - esac + mv ${DSC} . - if ls ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz > /dev/null 2>&1 && \ - [ ! -h "${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz" ] - then - mkdir -p ../orig + case "${MODE}" in + progress-linux) + psign.sh + ;; - mv "$(ls ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.*)" ../orig - ln -s $(ls ../orig/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.*) ./ - fi + bfh) + bsign.sh + ;; + esac - cd .. - rm -f current_source - ln -s "${VERSION}_source" current_source + if ls ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz > /dev/null 2>&1 && \ + [ ! -h "${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.xz" ] + then + mkdir -p ../orig - cd "${CURDIR}" -done + mv "$(ls ${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.*)" ../orig + ln -s $(ls ../orig/${PACKAGE}_${UPSTREAM_VERSION}.orig.tar.*) ./ + fi + + cd .. + rm -f current_source + ln -s "${VERSION}_source" current_source + + cd "${CURDIR}" + done +fi -- cgit v1.2.3