- Timestamp:
- Dec 23, 2013, 9:22:01 PM (11 years ago)
- Location:
- devel
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/etc/pb.conf
r1781 r1802 395 395 rbsmindep mageia-2-i386 = basesystem,bash,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,curl,dbus,dhcp-client,dirmngr,e2fsprogs,ethtool,expat,file,filesystem,findutils,gamin,gawk,glibc,gnupg2,grep,info,initscripts,iputils,libacl1,libattr1,libblkid1,libbzip2_1,libcap2,libcurl4,libdb4.8,libelfutils1,libext2fs2,libgcc1,libgcrypt11,libgpg-error0,libidn11,libkrb53,libksba8,libldap2.4_2,liblua5.1,liblzma5,libmagic1,libncurses5,libncursesw5,libnspr4,libnss3,libopenssl1.0.0,libpopt0,libreadline6,librpm2,librpmbuild2,libsasl2,libsqlite3_0,libssh2_1,libstdc++6,libtermcap2,libusb1.0_0,libuuid1,libxml2_2,libzlib1,logrotate,lua,mageia-release-common,meta-task,mingetty,ncurses,net-tools,nss,openldap,openssl,pam,passwd,pcre,perl,perl-base,perl-Config-IniFiles,perl-Locale-gettext,perl-MDV-Distribconf,perl-URPM,procps,psmisc,python,rpm,sed,setup,shadow-utils,systemd,udev,urpmi,util-linux,vim-minimal 396 396 rbsmindep mageia-2-x86_64 = basesystem,bash,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,curl,dbus,dhcp-client,dirmngr,e2fsprogs,ethtool,expat,file,filesystem,findutils,gamin,gawk,glibc,gnupg2,grep,info,initscripts,iputils,lib64acl1,lib64attr1,lib64blkid1,lib64bzip2_1,lib64cap2,lib64curl4,lib64db4.8,lib64elfutils1,lib64ext2fs2,lib64gcrypt11,lib64gpg-error0,lib64idn11,lib64krb53,lib64ksba8,lib64ldap2.4_2,lib64lua5.1,lib64lzma5,lib64magic1,lib64ncurses5,lib64ncursesw5,lib64nspr4,lib64nss3,lib64openssl1.0.0,lib64popt0,lib64readline6,lib64rpm2,lib64rpmbuild2,lib64sasl2,lib64sqlite3_0,lib64ssh2_1,lib64termcap2,lib64usb1.0_0,lib64uuid1,lib64xml2_2,lib64zlib1,libgcc1,logrotate,lua,mageia-release-common,meta-task,mingetty,ncurses,net-tools,nss,openldap,openssl,pam,passwd,pcre,perl,perl-base,perl-Config-IniFiles,perl-Locale-gettext,perl-MDV-Distribconf,perl-URPM,procps,psmisc,python,rpm,sed,setup,shadow-utils,systemd,udev,urpmi,util-linux,vim-minimal 397 # 398 rbsmindep mageia-3-i386 = basesystem,bash,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,curl,dbus,dhcp-client,dirmngr,e2fsprogs,ethtool,expat,file,filesystem,findutils,gamin,gawk,glibc,gnupg2,grep,info,initscripts,iputils,libacl1,libattr1,libblkid1,libbzip2_1,libcap2,libcurl4,libdb5.3,libelfutils1,libext2fs2,libgcc1,libgcrypt11,libgpg-error0,libidn11,libkrb53,libksba8,libldap2.4_2,liblua5.2,liblzma5,libmagic1,libmount1,libncurses5,libncursesw5,libnspr4,libnss3,libopenssl1.0.0,libpopt0,libreadline6,librpm3,librpmbuild3,libsasl2,libsqlite3_0,libssh2_1,libstdc++6,libtermcap2,libudev1,libusb1.0_0,libuuid1,libxml2_2,libzlib1,logrotate,lua,mageia-release-common,meta-task,mingetty,ncurses,net-tools,nss,openldap,openssl,pam,passwd,pcre,perl,perl-base,perl-Config-IniFiles,perl-List-MoreUtils,perl-Locale-gettext,perl-MDV-Distribconf,perl-URPM,procps,psmisc,python,rpm,sed,setup,shadow-utils,systemd,urpmi,util-linux,vim-minimal 399 rbsmindep mageia-3-x86_64 = basesystem,bash,chkconfig,coreutils,cpio,cracklib,cracklib-dicts,crontabs,curl,dbus,dhcp-client,dirmngr,e2fsprogs,ethtool,expat,file,filesystem,findutils,gamin,gawk,glibc,gnupg2,grep,info,initscripts,iputils,lib64acl1,lib64attr1,lib64blkid1,lib64bzip2_1,lib64cap2,lib64curl4,lib64db5.3,lib64elfutils1,lib64ext2fs2,lib64gcrypt11,lib64gpg-error0,lib64idn11,lib64krb53,lib64ksba8,lib64ldap2.4_2,lib64lua5.2,lib64lzma5,lib64magic1,lib64mount1,lib64ncurses5,lib64ncursesw5,lib64nspr4,lib64nss3,lib64openssl1.0.0,lib64popt0,lib64readline6,lib64rpm3,lib64rpmbuild3,lib64sasl2,lib64sqlite3_0,lib64ssh2_1,lib64termcap2,lib64udev1,lib64usb1.0_0,lib64uuid1,lib64xml2_2,lib64zlib1,libgcc1,logrotate,lua,mageia-release-common,meta-task,mingetty,ncurses,net-tools,nss,openldap,openssl,pam,passwd,pcre,perl,perl-base,perl-Config-IniFiles,perl-List-MoreUtils,perl-Locale-gettext,perl-MDV-Distribconf,perl-URPM,procps,psmisc,python,rpm,sed,setup,shadow-utils,systemd,urpmi,util-linux,vim-minimal 397 400 398 401 # Where to store packages downloaded temporarily by rpmbootstrap … … 426 429 # pbos->{'arch'} == i586 for i386 repo 427 430 rbsmirrorsrv mandriva = http://mirrors.kernel.org/mandriva/Mandrakelinux/official/$pbos->{'version'}/$pbos->{'arch'}/media/main/release/ 431 rbsmirrorupd mandriva = ../updates/ 428 432 rbsmirrorsrv mageia = http://mirrors.kernel.org/mageia/distrib/$pbos->{'version'}/$pbos->{'arch'}/media/core/release/ 433 rbsmirrorupd mageia = ../updates/ 429 434 #rbsmirrorsrv mageia = http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/$pbos->{'version'}/$pbos->{'arch'}/media/core/release/ 430 435 #rbsmirrorsrv debian = http://ftp.us.debian.org/debian/ … … 704 709 oschkopt deb = 705 710 ospatchcmd default = /usr/bin/patch 706 ospatchopt default = -s -p1 707 ospatchopt opensuse-12.3 = -p1 711 ospatchopt default = -p1 712 #ospatchopt default = -s -p1 713 #ospatchopt opensuse-12.3 = -p1 708 714 709 715 # sha method for yum repo -
devel/pb-modules/etc/pb.conf.pod
r1716 r1802 681 681 Example: rbsmirrorsrv debian = http://mirrors1.kernel.org/ 682 682 683 =item B<rbsmirrorupd> 684 685 Nature: Optional 686 Key: OS (could be from the most generic up to the most specific from ostype, osfamily, os, os-ver, os-ver-arch). The family name is generaly used here. 687 Value: Relative path wrt B<rbsmirrorsrv> where updates are located 688 Conffile: ve 689 Example: rbsmirrorupd mageia = ../updates 690 683 691 =item B<rbsopt> 684 692 -
devel/rpmbootstrap/bin/rpmbootstrap
r1661 r1802 266 266 my ($rbscachedir) = pb_conf_get_if("cachedir"); 267 267 my ($pkgs,$mirror) = pb_distro_get_param($pbos,pb_conf_get("rbsmindep","rbsmirrorsrv")); 268 my ($updater) = pb_distro_get_param($pbos,pb_conf_get_if("rbsmirrorupd")); 268 269 die "No packages defined for $pbos->{name}-$pbos->{version}-$pbos->{arch}" unless $pkgs =~ /\w/; 269 270 … … 283 284 284 285 die "No mirror defined for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}" if ((not defined $mirror) || ($mirror =~ /^\t*$/)); 285 pb_log(0,"Downloading package list from $mirror ...\n"); 286 my $response = $ua->get($mirror); 287 if (! $response->is_success) { 288 if ($mirror =~ /i386/) { 289 # Some distro have an i586 or i686 mirror dir instead for i386 290 warn "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.".$response->status_line; 291 $mirror =~ s|/i386/|/i586/|; 292 $response = $ua->get($mirror); 293 if (! $response->is_success) { 294 die "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}".$response->status_line; 295 } 296 } 297 } 298 pb_log(3,"Mirror $mirror gave answer: ".Dumper($response->dump(maxlength => 0))."\n"); 299 300 # Try to find where the repodata structure is for later usage 301 my $repo = $mirror; 302 my $found = 0; 303 if ($pbos->{'install'} =~ /yum/) { 304 my $response1; 305 while ($found == 0) { 306 $response1 = $ua->get("$repo/repodata"); 307 pb_log(2,"REPO analyzed: $repo\n"); 308 if (! $response1->is_success) { 309 $repo = dirname($repo); 310 311 # There is a limit to the loop, when / is reached and nothing found 312 my ($scheme, $account, $host, $port, $path) = pb_get_uri($repo); 313 die "Unable to find the repodata structure of the mirror $mirror\nPlease check the URL or warn the dev team.\n" if (($path =~ /^[\/]+$/) || ($path =~ /^$/)); 314 315 # / not reached, so looping 316 next; 317 } else { 318 # repodata found $repo is correct 319 $found = 1; 320 pb_log(2,"REPO found: $repo\n"); 321 last; 322 } 323 } 286 my $resp; 287 my @list_pkg; 288 289 $resp = rbs_mirror_response($mirror); 290 @list_pkg = split(/\n/,$resp->as_string()); 291 292 # If an update source is availble add it after so that these pkgs update the main ones 293 if (defined $updater) { 294 $resp = rbs_mirror_response($mirror.$updater); 295 push(@list_pkg,split(/\n/,$resp->as_string())); 324 296 } 325 297 … … 327 299 my $parch = $pbos->{'arch'}; 328 300 $parch = "i[3456]86" if ($pbos->{'arch'} eq "i386"); 301 my $repowithletter = 0; 329 302 330 303 # Get the list of packages and their URL in this hash 331 304 my %url; 332 foreach my $l (split(/\n/,$response->as_string())) { 333 # Find a href ref in first pos 334 if ($l =~ /<a href="([^<>]*)">([^<>]*)<\/a>/i) { 335 my $url = $1; 336 my $pkg = $1; 337 my $desc = $2; 338 pb_log(3,"Found desc URL $desc: "); 339 # find an rpm package ref name-ver-tag.arch.rpm 340 if ($pkg =~ /(.+)-([^-]+)-([^-]+)\.(noarch|$parch)\.rpm$/) { 341 pb_log(3,"package ($1 + $2 + $3 + $4)\n"); 342 $url{$1} = "$mirror/$url"; 305 foreach my $l (@list_pkg) { 306 my ($url,$desc) = rbs_find_pkg($l,$parch,"pkg"); 307 if (defined $url) { 308 $url{$url} = "$mirror/$desc"; 309 } else { 310 pb_log(3,"not a package, maybe a dir containing packages\n"); 311 my $response1 = $ua->get("$mirror/Packages"); 312 # Check if we have a fedora 17/18 type of repo 313 if ($response1->is_success) { 314 foreach my $d (split(/\n/,$response1->as_string())) { 315 ($url,$desc) = rbs_find_pkg($d,$parch,"dir"); 316 if (defined $url) { 317 # Here we have the dir in which are packages 318 my $response2 = $ua->get("$mirror/Packages/$desc"); 319 foreach my $p (split(/\n/,$response2->as_string())) { 320 ($url,$desc) = rbs_find_pkg($d,$parch,"dir"); 321 if (defined $url) { 322 $url{$p} = "$mirror/$desc"; 323 } else { 324 pb_log(3,"not a package, and not a dir containing packages\n"); 325 } 326 } 327 } else { 328 } 329 } 343 330 } else { 344 pb_log(3,"not a package\n");345 331 } 346 332 } … … 508 494 pb_system("sed -i -e 's/^mirrorlist/#mirrorlist/' $i","","quiet"); 509 495 # rather use neutral separators here 510 pb_system("sed -i -e 's|^#baseurl.*\$|baseurl=$ repo|' $i","","quiet");496 pb_system("sed -i -e 's|^#baseurl.*\$|baseurl=$mirror|' $i","","quiet"); 511 497 } 512 498 $minipkglist = "ldconfig yum passwd vim-minimal dhclient authconfig"; … … 637 623 unlink($_) if ($_ =~ /\.rpmnew$/); 638 624 } 625 626 # Function to store packages found on Web pages 627 628 sub rbs_find_pkg { 629 630 my $l = shift; 631 my $parch = shift; 632 my $type = shift; 633 634 pb_log(2,"Entering rbs_find_pkg with l=$l and parch=$parch\n"); 635 # Find a href ref in first pos 636 if ($l =~ /<a href="([^<>]*)">([^<>]*)<\/a>/i) { 637 my $pkg = $1; 638 my $desc = $2; 639 pb_log(3,"Found desc URL $desc: "); 640 # find an rpm package ref name-ver-tag.arch.rpm 641 if (($type eq "pkg") && ($pkg =~ /(.+)-([^-]+)-([^-]+)\.(noarch|$parch)\.rpm$/)) { 642 pb_log(3,"package ($1 + $2 + $3 + $4)\n"); 643 my $url = $1; 644 pb_log(2,"Exiting rbs_find_pkg with url=$url and desc=$desc\n"); 645 return($url,$desc); 646 } elsif (($type eq "dir") && ($pkg =~ /([0-z])\//)) { 647 my $url = $1; 648 pb_log(3,"dir ($1)\n"); 649 return($url,$1); 650 } else { 651 pb_log(3,"not a package\n"); 652 } 653 } 654 pb_log(2,"Exiting rbs_find_pkg with undef\n"); 655 return(undef,undef); 656 } 657 658 sub rbs_mirror_response { 659 660 my $mirror = shift; 661 662 pb_log(0,"Downloading package list from $mirror ...\n"); 663 my $response = $ua->get($mirror); 664 if (! $response->is_success) { 665 if ($mirror =~ /i386/) { 666 # Some distro have an i586 or i686 mirror dir instead for i386 667 warn "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.".$response->status_line; 668 $mirror =~ s|/i386/|/i586/|; 669 pb_log(0,"Downloading now package list from $mirror ...\n"); 670 $response = $ua->get($mirror); 671 if (! $response->is_success) { 672 die "Unable to download package from $mirror for $pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}".$response->status_line; 673 } 674 } 675 } 676 pb_log(3,"Mirror $mirror gave answer: ".Dumper($response->dump(maxlength => 0))."\n"); 677 678 # Try to find where the repodata structure is for later usage 679 my $repo = $mirror; 680 my $found = 0; 681 if ($pbos->{'install'} =~ /yum/) { 682 my $response1; 683 while ($found == 0) { 684 $response1 = $ua->get("$repo/repodata"); 685 pb_log(2,"REPO analyzed: $repo\n"); 686 if (! $response1->is_success) { 687 $repo = dirname($repo); 688 689 # There is a limit to the loop, when / is reached and nothing found 690 my ($scheme, $account, $host, $port, $path) = pb_get_uri($repo); 691 die "Unable to find the repodata structure of the mirror $mirror\nPlease check the URL or warn the dev team.\n" if (($path =~ /^[\/]+$/) || ($path =~ /^$/)); 692 693 # / not reached, so looping 694 next; 695 } else { 696 # repodata found $repo is correct 697 $found = 1; 698 pb_log(2,"REPO found: $repo\n"); 699 last; 700 } 701 } 702 } 703 return($response); 704 } 705
Note:
See TracChangeset
for help on using the changeset viewer.