diff --git a/pbuilder-dist b/pbuilder-dist index 0f2cf92..cc77b12 100755 --- a/pbuilder-dist +++ b/pbuilder-dist @@ -1,11 +1,15 @@ #!/bin/sh # Copyright (C) Jamin W. Collins -# License: Public Domain +# and Jordan Mantha +# Copyright 2007 (C) Siegfried-A. Gevatter +# License: GPLv2 or later # # This script is a wrapper to use pbuilder with many different # distributions / versions. # -# Name this script 'pbuilder-dapper', 'pbuilder-feisty', 'pbuilder-gutsy', etc. +# If you want to use this copy of the script only for a single distribution +# / version, rename it to 'pbuilder-dapper', 'pbuilder-feisty', 'pbuilder-gutsy', +# or whatever it is. # # The only variable you really might need to change is BASE_DIR, if you # don't want pbuilder stuff in your home directory. @@ -14,34 +18,85 @@ BASE_DIR="$HOME/pbuilder" -OPERATION=$1 -DISTRIBUTION=`basename $0 | cut -f2 -d '-'` -PROCEED=false +if [ ! -z `echo \`basename $0\` | grep '-'` ] +then + if [ $# -lt 1 ] + then + echo "Insufficient number of arguments." + echo "Usage: $0 " + exit 1 + fi -case $OPERATION in - create|update|build|clean|login|execute ) - PROCEED=true - ;; + DISTRIBUTION=`basename $0 | cut -f2 -d '-'` + OPERATION=$1 + shift 1 +else + if [ $# -lt 2 ] + then + echo "Insufficient number of arguments." + echo "Usage: $0 " + exit 1 + fi + + DISTRIBUTION=$1 + OPERATION=$2 + shift 2 +fi + + +case $DISTRIBUTION in + #warty|hoary|breezy) + dapper|edgy|feisty|gutsy) + ARCHIVE="http://archive.ubuntu.com/ubuntu" + COMPONENTS="universe multiverse" + ;; + + oldstable|sarge|stable|etch|testing|lenny|unstable|sid|experimental) + ARCHIVE="http://ftp.debian.org" + COMPONENTS="main contrib non-free" + ;; + + *) + echo "Warning: Unknown distribution «$DISTRIBUTION»." + echo -n "Continue [y/N]? " + read continue + + if [ "$continue" != 'y' ] && [ "$continue" != 'Y' ] + then + echo " Aborting..." + exit 1 + fi + + ARCHIVE="http://archive.ubuntu.com/ubuntu" + COMPONENTS="universe multiverse" + ;; esac -if [[ $PROCEED = true ]]; then - shift - if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ] - then mkdir -p $BASE_DIR/${DISTRIBUTION}_result/ - fi - sudo pbuilder $OPERATION \ - --basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \ - --distribution $DISTRIBUTION \ - --buildresult $BASE_DIR/$DISTRIBUTION_result \ - --othermirror "deb http://archive.ubuntu.com/ubuntu $DISTRIBUTION universe multiverse" $@ -else - echo "Invalid command..." - echo "Valid commands are:" - echo " create" - echo " update" - echo " build" - echo " clean" - echo " login" - echo " execute" - exit 1 + +case $OPERATION in + create|update|build|clean|login|execute) + ;; + + *) + echo "Unrecognized argument. Please use one of those:" + echo " create" + echo " update" + echo " build" + echo " clean" + echo " login" + echo " execute" + exit 1 + ;; +esac + + +if [ ! -d $BASE_DIR/${DISTRIBUTION}_result ] +then + mkdir -p $BASE_DIR/${DISTRIBUTION}_result fi + +sudo pbuilder $OPERATION \ + --basetgz $BASE_DIR/$DISTRIBUTION-base.tgz \ + --distribution $DISTRIBUTION \ + --buildresult $BASE_DIR/$DISTRIBUTION_result \ + --othermirror "deb $ARCHIVE $DISTRIBUTION $COMPONENTS" $@ diff --git a/suspicious-source b/suspicious-source index 6fe6704..82d2b45 100755 --- a/suspicious-source +++ b/suspicious-source @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 2007 (C) Siegfried-A. Gevatter # Based upon a script by Martin Pitt -# License: GPL v3 or later +# License: GPLv3 or later # # This script outputs a list of files which are not common source files. This # should be run in the root of a source tree to find files which might not be diff --git a/update-maintainer b/update-maintainer index 460e67d..16f0fff 100755 --- a/update-maintainer +++ b/update-maintainer @@ -26,7 +26,7 @@ if [ -f debian/control -a -f debian/changelog ]; then elif [ -f control -a -f changelog ]; then DEBIANDIR=. else - echo "Please run that script in the source folder." >&2 && exit 1 + echo "Please execute «$0» in the source folder." >&2 && exit 1 fi IGNORE_DOMAINS="ubuntu\.com|ubuntu\.com\.au" diff --git a/what-patch b/what-patch index 7f12c5b..821aec8 100755 --- a/what-patch +++ b/what-patch @@ -1,6 +1,6 @@ #!/bin/bash # Copyright 2006-2007 (C) Kees Cook -# Modified by Siegfried-A. Gevatter +# Modified by Siegfried-A. Gevatter # License: GPLv2 if [[ -d debian ]]; then