From 3354374972461eaa53e61e65c171399479ce7f2f Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Fri, 24 Dec 2010 11:08:55 +0200 Subject: [PATCH] Actually --no-fallback makes no sense for these scripts, although we probably want it for test-builders --- doc/pull-debian-debdiff.1 | 7 ------- doc/pull-debian-source.1 | 7 ------- pull-debian-debdiff | 12 ++---------- pull-debian-source | 14 +++----------- 4 files changed, 5 insertions(+), 35 deletions(-) diff --git a/doc/pull-debian-debdiff.1 b/doc/pull-debian-debdiff.1 index 499facf..8fc87aa 100644 --- a/doc/pull-debian-debdiff.1 +++ b/doc/pull-debian-debdiff.1 @@ -54,10 +54,6 @@ Should be in the form \fBhttp://security.debian.org\fR. If the package isn't found on this mirror, \fBpull\-debian\-source\fR will fall back to the default mirror. .TP -.BR \-n ", " \-\-no\-fallback -If specified, \fBpull\-debian\-source\fR won't fall back to the default -mirror, should it encounter an error. -.TP .B \-\-no\-conf Do not read any configuration files, or configuration from environment variables. @@ -80,9 +76,6 @@ The default value for \fB\-\-debian\-mirror\fR. .TP .BR PULL_DEBIAN_DEBDIFF_DEBSEC_MIRROR ", " UBUNTUTOOLS_DEBSEC_MIRROR The default value for \fB\-\-debsec\-mirror\fR. -.TP -.BR PULL_DEBIAN_DEBDIFF_MIRROR_FALLBACK ", " UBUNTUTOOLS_MIRROR_FALLBACK -The default value for \fB\-\-no\-fallback\fR. .SH SEE ALSO .BR pull\-debian\-source (1), diff --git a/doc/pull-debian-source.1 b/doc/pull-debian-source.1 index f920f1c..a6c735d 100644 --- a/doc/pull-debian-source.1 +++ b/doc/pull-debian-source.1 @@ -31,10 +31,6 @@ Should be in the form \fBhttp://ftp.debian.org/debian\fR. If the package isn't found on this mirror, \fBpull\-debian\-source\fR will fall back to the default mirror. .TP -.BR \-n ", " \-\-no\-fallback -If specified, \fBpull\-debian\-source\fR won't fall back to the default -mirror, should it encounter an error. -.TP .B \-\-no\-conf Do not read any configuration files, or configuration from environment variables. @@ -54,9 +50,6 @@ package\-wide variable. .TP .BR PULL_DEBIAN_SOURCE_DEBIAN_MIRROR ", " UBUNTUTOOLS_DEBIAN_MIRROR The default value for \fB\-\-mirror\fR. -.TP -.BR PULL_DEBIAN_SOURCE_MIRROR_FALLBACK ", " UBUNTUTOOLS_MIRROR_FALLBACK -The default value for \fB\-\-no\-fallback\fR. .SH SEE ALSO .BR ubuntu\-dev\-tools (5) diff --git a/pull-debian-debdiff b/pull-debian-debdiff index 921f162..b03098b 100755 --- a/pull-debian-debdiff +++ b/pull-debian-debdiff @@ -56,12 +56,10 @@ def pull(package, version, unpack=False): urls = [] if opts.debsec_mirror and opts.debsec_mirror != DEFAULT_DEBSEC_MIRROR: urls.append(build_url(opts.debsec_mirror, package, version)) - if opts.fallback: - urls.append(build_url(DEFAULT_DEBSEC_MIRROR, package, version)) + urls.append(build_url(DEFAULT_DEBSEC_MIRROR, package, version)) if opts.debian_mirror and opts.debian_mirror != DEFAULT_DEBIAN_MIRROR: urls.append(build_url(opts.debian_mirror, package, version)) - if opts.fallback: - urls.append(build_url(DEFAULT_DEBIAN_MIRROR, package, version)) + urls.append(build_url(DEFAULT_DEBIAN_MIRROR, package, version)) for url in urls: cmd = ('dget', '-u' + 'x' if unpack else 'd', url) @@ -154,10 +152,6 @@ def main(): dest='debsec_mirror', help='Preferred Debian Security mirror ' '(default: http://security.debian.org)') - p.add_option('-n', '--no-fallback', - dest='fallback', default=None, action='store_false', - help="If a custom mirror is provided and an error occurs " - "while downloading, don't fall back to the default") p.add_option('--no-conf', dest='no_conf', default=False, action='store_true', help="Don't read config files or environment variables") @@ -176,8 +170,6 @@ def main(): opts.debian_mirror = config.get_value('DEBIAN_MIRROR') if opts.debsec_mirror is None: opts.debsec_mirror = config.get_value('DEBSEC_MIRROR') - if opts.fallback is None: - opts.fallback = config.get_value('MIRROR_FALLBACK', boolean=True) Logger.normal('Downloading %s %s', package, version) if not pull(package, version, unpack=not opts.fetch_only): diff --git a/pull-debian-source b/pull-debian-source index d984731..78f4a05 100755 --- a/pull-debian-source +++ b/pull-debian-source @@ -28,10 +28,9 @@ use AptPkg::Version; die("Please install 'devscripts'\n") if(! grep -x "$_/dget", split(':',$ENV{'PATH'})); my($name) = basename($0); -my($help, $mirror, $no_fallback, $no_conf); +my($help, $mirror, $no_conf); GetOptions('h|help' => \$help, 'm|mirror=s' => \$mirror, - 'n|no-fallback' => \$no_fallback, 'no-conf' => \$no_conf, ); my($package) = $ARGV[0] || &usage(2); @@ -56,16 +55,11 @@ if (! $no_conf) { $mirror = $config_values{'PULL_DEBIAN_SOURCE_DEBIAN_MIRROR'} || $config_values{'UBUNTUTOOLS_DEBIAN_MIRROR'} if (! $mirror); - if (! $no_fallback) { - my($v) = $config_values{'PULL_DEBIAN_SOURCE_MIRROR_FALLBACK'} - || $config_values{'UBUNTUTOOLS_MIRROR_FALLBACK'}; - $no_fallback = 1 if $v eq "no"; - } } my($default_mirror) = 'http://ftp.debian.org/debian'; my(@mirrors); -push @mirrors, $mirror if $mirror; -push @mirrors, $default_mirror if $mirror ne $default_mirror and !$no_fallback; +push @mirrors, $mirror if $mirror && $mirror ne $default_mirror; +push @mirrors, $default_mirror; my($release)=$ARGV[1] || 'unstable'; $release=&convertCodeName($release); @@ -184,8 +178,6 @@ Options: -m DEBIAN_MIRROR, --mirror=DEBIAN_MIRROR Preferred Debian mirror (default: http://ftp.debian.org/debian) - -n, --no-fallback If a custom mirror is provided and an error occurs - while downloading, don't fall back to the default --no-conf Don't read config files or environment variables EOF exit($exit);