diff options
author | Loïc Minier <lool@dooz.org> | 2010-01-25 16:00:20 +0100 |
---|---|---|
committer | Loïc Minier <lool@dooz.org> | 2010-01-25 16:00:20 +0100 |
commit | 05cbe6d5ca5f7c15cbe32f08c7c2cee014790661 (patch) | |
tree | 6b63612feeb23c00659c95d8fff2d4dfe8a23274 /pbuilder-apt-config | |
parent | 9880e5ad0e0ab83060825843c29a969ae82dfe69 (diff) | |
download | pbuilder-05cbe6d5ca5f7c15cbe32f08c7c2cee014790661.tar pbuilder-05cbe6d5ca5f7c15cbe32f08c7c2cee014790661.tar.gz |
Use apt-sources command to dump sources
Diffstat (limited to 'pbuilder-apt-config')
-rwxr-xr-x | pbuilder-apt-config | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/pbuilder-apt-config b/pbuilder-apt-config index 4fc0f7f..2da6937 100755 --- a/pbuilder-apt-config +++ b/pbuilder-apt-config @@ -105,6 +105,14 @@ output_sources() { esac } +sources="" +add_output_sources() { + local output="$(output_sources "$@")" + + sources="$sources${sources:+ +}$output" +} + getopt_output="`getopt -o "" -l help,with-sources::,arch:,components:,mirror:,suite:,pockets:,profile: -n "$self" -s sh -- "$@"`" eval set -- "$getopt_output" @@ -201,8 +209,8 @@ if [ -n "$profile" ]; then case "$profile" in experimental) base_dist="unstable" - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" - output_sources "$with_sources" "$base_mirror" "$profile" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$base_mirror" "$profile" "$components" ;; */volatile|*/volatile-sloppy) if [ "$base_dist" != "${profile%%/*}" ]; then @@ -211,10 +219,10 @@ if [ -n "$profile" ]; then archive="volatile" mirror="`get_archive_url "$archive"`" volatile_dist=${profile%%-*} - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" - output_sources "$with_sources" "$mirror" "$volatile_dist" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$mirror" "$volatile_dist" "$components" if [ "$volatile_dist" != "$profile" ]; then - output_sources "$with_sources" "$mirror" "$profile" "$components" + add_output_sources "$with_sources" "$mirror" "$profile" "$components" fi ;; *-backports) @@ -223,21 +231,21 @@ if [ -n "$profile" ]; then fi archive="backports.org" mirror="`get_archive_url "$archive"`" - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" - output_sources "$with_sources" "$mirror" "$profile" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$mirror" "$profile" "$components" ;; *-proposed-updates) if [ "$base_dist" != "${profile%%-*}" ]; then die "Unknown Debian updates based profile=$profile" fi - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" - output_sources "$with_sources" "$base_mirror" "$profile" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$base_mirror" "$profile" "$components" ;; *) if [ "$base_dist" != "$profile" ]; then die "Unknown Debian based profile=$profile" fi - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" ;; esac ;; @@ -265,16 +273,15 @@ if [ -n "$profile" ]; then fi ;; esac - output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist" "$components" for pocket in $pockets; do - output_sources "$with_sources" "$base_mirror" "$base_dist-$pocket" "$components" + add_output_sources "$with_sources" "$base_mirror" "$base_dist-$pocket" "$components" done ;; *) die "Unknown profile for base_archive=$base_archive" ;; esac - exit 0 fi if [ -n "$suite" ]; then @@ -284,16 +291,16 @@ if [ -n "$suite" ]; then fi mirror="`get_archive_url "$archive"`" fi - output_sources "$with_sources" "$mirror" "$suite" "$components" + add_output_sources "$with_sources" "$mirror" "$suite" "$components" for pocket in $pockets; do - output_sources "$with_sources" "$mirror" "$suite-$pocket" "$components" + add_output_sources "$with_sources" "$mirror" "$suite-$pocket" "$components" done - exit 0 fi command="$1" case $1 in apt-sources) + echo "$sources" ;; debootstrap-mirror) ;; |