From 3695c369af793871ee5e0c8e4fc56df3fd32c8d5 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 15 Apr 2010 10:27:14 +0200 Subject: [PATCH] Rename this script --- id-deb-build/id-pbuild-all.sh | 135 ----------------------------------------- id-deb-build/id-pbuild.sh | 135 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 135 insertions(+), 135 deletions(-) delete mode 100755 id-deb-build/id-pbuild-all.sh create mode 100755 id-deb-build/id-pbuild.sh diff --git a/id-deb-build/id-pbuild-all.sh b/id-deb-build/id-pbuild-all.sh deleted file mode 100755 index cde1dc5..0000000 --- a/id-deb-build/id-pbuild-all.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh -# This script builds Debian packages for one or more distributions -# in i386/amd64 architectures. It uses pbuilder. pbuilder requires root -# privilege and is invoked with sudo. -# -# In order to avoid having to type-in the password for it, you might -# use something like this in sudoers -# user ALL=NOPASSWD,SETENV: /usr/sbin/pbuilder -# where user is your username. - -usage() -{ - cat <&2 -fi - -if test -d deb-src; then - cd deb-src -fi -for f in *.dsc; do - if test -f "$f"; then - PKG=$f - fi -done -if test -z "$PKG"; then - echo "Specify .dsc file" - exit 1 -fi -if test ! -e "$PKG"; then - echo "${PKG} does not exist" - exit 1 -fi -PBUILDER=/usr/sbin/pbuilder -PRODUCT=`echo *.dsc|sed 's/_.*//g'` -ARCHS="i386 amd64" -echo "Dsc $PKG . Product $PRODUCT" -echo "Ubuntu distros: $UBUNTU_DIST" -echo "Debian distros: $DEBIAN_DIST" -if $upload; then - for dist in ${UBUNTU_DIST}; do - scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist} - done - for dist in ${DEBIAN_DIST}; do - scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/debian/${dist} - done - echo "Remember to update APT on ftp.indexdata.dk" - echo "cd git-tools/update-archive" - echo "sudo su" - echo "./update-archive.sh" - exit 0 -fi -i=0 -date -for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do - for arch in ${ARCHS}; do - rm -fr ${dist}-${arch} - ( - if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then - sudo DIST=$dist ARCH=$arch $PBUILDER create - fi - for f in `find /var/cache/pbuilder/${dist}-${arch}-base.tgz -ctime +7`; do - sudo DIST=$dist ARCH=$arch $PBUILDER update --override-config - done - sudo DIST=$dist ARCH=$arch $PBUILDER --build $PKG - ) >${dist}-${arch}.log 2>&1 & - i=`expr $i + 1` - if test $i -eq $concurrency; then - i=0 - wait - fi - done -done -wait -for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do - for arch in ${ARCHS}; do - if test -f ${dist}-${arch}/*.dsc; then - : - else - echo "No .dsc file for ${dist}-${arch}" - exit 1 - fi - done -done -date -echo "Done" -# Local Variables: -# mode:shell-script -# sh-indentation: 2 -# sh-basic-offset: 4 -# End: diff --git a/id-deb-build/id-pbuild.sh b/id-deb-build/id-pbuild.sh new file mode 100755 index 0000000..cde1dc5 --- /dev/null +++ b/id-deb-build/id-pbuild.sh @@ -0,0 +1,135 @@ +#!/bin/sh +# This script builds Debian packages for one or more distributions +# in i386/amd64 architectures. It uses pbuilder. pbuilder requires root +# privilege and is invoked with sudo. +# +# In order to avoid having to type-in the password for it, you might +# use something like this in sudoers +# user ALL=NOPASSWD,SETENV: /usr/sbin/pbuilder +# where user is your username. + +usage() +{ + cat <&2 +fi + +if test -d deb-src; then + cd deb-src +fi +for f in *.dsc; do + if test -f "$f"; then + PKG=$f + fi +done +if test -z "$PKG"; then + echo "Specify .dsc file" + exit 1 +fi +if test ! -e "$PKG"; then + echo "${PKG} does not exist" + exit 1 +fi +PBUILDER=/usr/sbin/pbuilder +PRODUCT=`echo *.dsc|sed 's/_.*//g'` +ARCHS="i386 amd64" +echo "Dsc $PKG . Product $PRODUCT" +echo "Ubuntu distros: $UBUNTU_DIST" +echo "Debian distros: $DEBIAN_DIST" +if $upload; then + for dist in ${UBUNTU_DIST}; do + scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/ubuntu/${dist} + done + for dist in ${DEBIAN_DIST}; do + scp ${dist}-*/* ftp.indexdata.dk:/home/ftp/pub/${PRODUCT}/debian/${dist} + done + echo "Remember to update APT on ftp.indexdata.dk" + echo "cd git-tools/update-archive" + echo "sudo su" + echo "./update-archive.sh" + exit 0 +fi +i=0 +date +for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do + for arch in ${ARCHS}; do + rm -fr ${dist}-${arch} + ( + if test ! -f /var/cache/pbuilder/${dist}-${arch}-base.tgz; then + sudo DIST=$dist ARCH=$arch $PBUILDER create + fi + for f in `find /var/cache/pbuilder/${dist}-${arch}-base.tgz -ctime +7`; do + sudo DIST=$dist ARCH=$arch $PBUILDER update --override-config + done + sudo DIST=$dist ARCH=$arch $PBUILDER --build $PKG + ) >${dist}-${arch}.log 2>&1 & + i=`expr $i + 1` + if test $i -eq $concurrency; then + i=0 + wait + fi + done +done +wait +for dist in ${DEBIAN_DIST} ${UBUNTU_DIST}; do + for arch in ${ARCHS}; do + if test -f ${dist}-${arch}/*.dsc; then + : + else + echo "No .dsc file for ${dist}-${arch}" + exit 1 + fi + done +done +date +echo "Done" +# Local Variables: +# mode:shell-script +# sh-indentation: 2 +# sh-basic-offset: 4 +# End: -- 1.7.10.4