diff options
author | Loïc Minier <lool@dooz.org> | 2010-01-25 17:32:00 +0100 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2010-01-25 17:32:00 +0100 |
commit | c31448846df8326741195e0aaf1659b94c95aade (patch) | |
tree | 424170c2360531251cf692d3e1970a472aa0c56b /pbuilder-apt-config | |
parent | 05cbe6d5ca5f7c15cbe32f08c7c2cee014790661 (diff) | |
download | pbuilder-c31448846df8326741195e0aaf1659b94c95aade.tar pbuilder-c31448846df8326741195e0aaf1659b94c95aade.tar.gz |
Add support for debootstrap-mirror and -suite
Diffstat (limited to 'pbuilder-apt-config')
-rwxr-xr-x | pbuilder-apt-config | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/pbuilder-apt-config b/pbuilder-apt-config index 2da6937..307e0ad 100755 --- a/pbuilder-apt-config +++ b/pbuilder-apt-config @@ -8,6 +8,7 @@ self="$(basename "$0")" # TODO # - support setting --mirror-map (for --profile) # - Debian security entries? +# - oldstable log() { echo "$@" >&2 @@ -106,6 +107,9 @@ output_sources() { } sources="" +debootstrap_suite="" +debootstrap_mirror="" + add_output_sources() { local output="$(output_sources "$@")" @@ -113,6 +117,33 @@ add_output_sources() { }$output" } +set_debootstrap_suite() { + local archive="$1" + local suite="$2" + + case "$archive" in + debian) + case "$suite" in + unstable) + debootstrap_suite="sid" + ;; + testing) + debootstrap_suite="squeeze" + ;; + stable) + debootstrap_suite="lenny" + ;; + *) + debootstrap_suite="$suite" + ;; + esac + ;; + *) + debootstrap_suite="$suite" + ;; + esac +} + getopt_output="`getopt -o "" -l help,with-sources::,arch:,components:,mirror:,suite:,pockets:,profile: -n "$self" -s sh -- "$@"`" eval set -- "$getopt_output" @@ -249,7 +280,7 @@ if [ -n "$profile" ]; then ;; esac ;; - ubuntu) + ubuntu|ubuntu-ports) if [ "$base_dist" != "${profile%%-*}" ]; then die "Unknown Ubuntu based profile=$profile" fi @@ -282,6 +313,8 @@ if [ -n "$profile" ]; then die "Unknown profile for base_archive=$base_archive" ;; esac + set_debootstrap_suite "$base_archive" "$base_dist" + debootstrap_mirror="$base_mirror" fi if [ -n "$suite" ]; then @@ -295,6 +328,12 @@ if [ -n "$suite" ]; then for pocket in $pockets; do add_output_sources "$with_sources" "$mirror" "$suite-$pocket" "$components" done + # NB: archive might be empty; best effort to try to guess it + if [ -z "$archive" ]; then + archive="`guess_dist_arch_archive "$suite" "$arch"`" 2>/dev/null || true + fi + set_debootstrap_suite "$archive" "$suite" + debootstrap_mirror="$mirror" fi command="$1" @@ -303,8 +342,10 @@ case $1 in echo "$sources" ;; debootstrap-mirror) + echo "$debootstrap_mirror" ;; debootstrap-suite) + echo "$debootstrap_suite" ;; *) usage |