Changeset 1031 in ProjectBuilder for devel/rpmbootstrap


Ignore:
Timestamp:
May 22, 2010, 8:40:29 PM (14 years ago)
Author:
Bruno Cornec
Message:
  • the repodata dir is now search in the parents dir of the mirror given as it depends on yum version. CentOS 4 & 5, Fedora 12 OK.
  • Update perl modules versions (Date-Manip is now in 6.x, still using 5.x at the moment)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/rpmbootstrap/bin/rpmbootstrap

    r1029 r1031  
    261261}
    262262pb_log(3,"Mirror $mirror gave answer: ".Dumper($response->dump(maxlength => 0))."\n");
     263
     264# Try to find where the repodata structure is for later usage
     265my $repo = $mirror;
     266my $found = 0;
     267if ($pbupd =~ /yum/) {
     268    my $response1;
     269    while ($found == 0) {
     270        $response1 = $ua->get("$repo/repodata");
     271        if (! $response1->is_success) {
     272            $repo = dirname($repo);
     273
     274            pb_log(2,"REPO analyzed: $repo\n");
     275            # There is a limit to the loop, when / is reached and nothing found
     276            my ($scheme, $account, $host, $port, $path) = pb_get_uri($repo);
     277            die "Unable to find the repodata structure of the mirror $mirror\nPlease check the URL or warn the dev team.\n" if ($path =~ /^[\/]+$/);
     278           
     279            # / not reached, so looping
     280            next;
     281        } else {
     282            # repodata found $repo is correct
     283            $found = 1;
     284            last;
     285        }
     286    }
     287}
    263288
    264289# Manages architectures specificities
     
    433458        pb_system("sed -i -e 's/^mirrorlist/#mirrorlist/' $i","","quiet");
    434459        # rather use neutral separators here
    435         pb_system("sed -i -e 's|^#baseurl.*\$|baseurl=$mirror|' $i","","quiet");
     460        pb_system("sed -i -e 's|^#baseurl.*\$|baseurl=$repo|' $i","","quiet");
    436461    }
    437462    $minipkglist = "ldconfig yum passwd vim-minimal dhclient authconfig";
Note: See TracChangeset for help on using the changeset viewer.