Changeset 1532


Ignore:
Timestamp:
May 13, 2012, 4:30:35 AM (7 years ago)
Author:
bruno
Message:
  • rpmbootstrap: Improve error message, include why the download failed (turned out web server was being slow). Strip off spaces in package names appearing because of multi-line conf file support. Download files to a temporary name so that ctrl-c won't leave around bad .rpm files. (Eric Anderson)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1531 r1532  
    287287    if ($mirror =~ /i386/) {
    288288        # Some distro have an i586 or i686 mirror dir instead for i386
    289         warn "Unable to download packages from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.";
     289        warn "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.".$response->status_line;
    290290        $mirror =~ s|/i386/|/i586/|;
    291291        $response = $ua->get($mirror);
    292292        if (! $response->is_success) {
    293             die "Unable to download packages from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}";
     293            die "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}".$response->status_line;
    294294        }
    295295    }
     
    383383
    384384foreach my $p (split(/,/,$pkgs)) {
     385    $p =~ s/\s+//go;
    385386    pb_log(1,"Processing package $p ...\n");
    386387    # Just print packages names if asked so.
     
    393394            my $p1 = basename($url{$p});
    394395            if (! -f "$cachedir/$p1") {
    395                 pb_system("wget --quiet -O $cachedir/$p1 $url{$p}","Downloading package $p1 ...");
     396                pb_system("wget --quiet -O $cachedir/$p1-new $url{$p}","Downloading package $p1 ...");
     397                rename("$cachedir/$p1-new", "$cachedir/$p1") || die "mv $cachedir/$p1-new $cachedir/$p1 failed: $!";
    396398            } else {
    397399                pb_log(1,"Package $p1 already in cache\n");
Note: See TracChangeset for help on using the changeset viewer.