Changeset 1812 in ProjectBuilder for devel/rpmbootstrap
- Timestamp:
- Jan 2, 2014, 12:15:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/rpmbootstrap/bin/rpmbootstrap
r1802 r1812 303 303 # Get the list of packages and their URL in this hash 304 304 my %url; 305 my %done; 305 306 foreach my $l (@list_pkg) { 306 307 my ($url,$desc) = rbs_find_pkg($l,$parch,"pkg"); … … 309 310 } else { 310 311 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 } 312 ($url,$desc) = rbs_find_pkg($l,$parch,"dir"); 313 if ((defined $desc) and (not defined $done{$desc})) { 314 my $response1 = $ua->get("$mirror/$desc"); 315 # Check if we have a fedora 17/18 type of repo 316 if ($response1->is_success) { 317 $done{$desc} = "true"; 318 foreach my $d (split(/\n/,$response1->as_string())) { 319 my ($url2,$desc2) = rbs_find_pkg($d,$parch,"pkg"); 320 if (defined $url2) { 321 # Here we have the dir in which are packages 322 $url{$url2} = "$mirror/$desc/$desc2"; 323 } else { 324 pb_log(3,"not a package, and not a dir containing packages\n"); 326 325 } 327 } else {328 326 } 327 } else { 329 328 } 330 } else {331 329 } 332 330 } … … 477 475 pb_system("mknod -m 666 $vepath/dev/null c 1 3","Creating $vepath/dev/null") if (! -c "$vepath/dev/null"); 478 476 477 # Where is bash 478 my $bash = "/usr/bin/bash"; 479 if (! -x "$vepath/$bash" ) { 480 $bash = "/bin/bash"; 481 if (! -x "$vepath/$bash" ) { 482 die "No bash found in usual places. Please report to dev team"; 483 } 484 } 485 486 479 487 my $minipkglist; 480 488 … … 503 511 # Setup the repo 504 512 if ($pbos->{'version'} eq "10.2") { 505 pb_system("chroot $vepath /bin/bash -c \"yes | /usr/bin/zypper sa $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");513 pb_system("chroot $vepath $bash -c \"yes | /usr/bin/zypper sa $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper"); 506 514 } else { 507 515 # don't care if remove fails if add succeeds. 508 pb_system("chroot $vepath /bin/bash -c \"/usr/bin/zypper rr $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper","mayfail");509 pb_system("chroot $vepath /bin/bash -c \"/usr/bin/zypper ar $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper");516 pb_system("chroot $vepath $bash -c \"/usr/bin/zypper rr $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper","mayfail"); 517 pb_system("chroot $vepath $bash -c \"/usr/bin/zypper ar $baseurl $pbos->{'name'}-$pbos->{'version'}\"","Bootstrapping Zypper"); 510 518 } 511 519 #print REPO << "EOF"; … … 523 531 # Setup the repo 524 532 my $baseurl = dirname(dirname(dirname($mirror))); 525 pb_system("chroot $vepath /bin/bash -c \"urpmi.addmedia --distrib $baseurl\"","Bootstrapping URPMI");533 pb_system("chroot $vepath $bash -c \"urpmi.addmedia --distrib $baseurl\"","Bootstrapping URPMI"); 526 534 # TODO here too ? 527 535 $minipkglist = "ldconfig urpmi passwd vim-minimal dhcp-client"; … … 560 568 561 569 # Keep redhat variants from destroying nis domain on install 562 #pb_system("chroot $vepath /bin/bash -e -c \"ln -snf /bin/true /bin/domainname\"");570 #pb_system("chroot $vepath $bash -e -c \"ln -snf /bin/true /bin/domainname\""); 563 571 564 572 #if ($pbos->{'name'} =~ /fedora/i) { # hack to prevent fedora from destroying NIS settings on host … … 567 575 # close(AUTH); 568 576 #} 569 pb_system("chroot $vepath /bin/bash -c \"$pbos->{'install'} $minipkglist \"","Bootstrapping OS by running $pbos->{'install'} $minipkglist");577 pb_system("chroot $vepath $bash -c \"$pbos->{'install'} $minipkglist \"","Bootstrapping OS by running $pbos->{'install'} $minipkglist"); 570 578 571 579 # CentOS6 will replace the yum.repos.d files; oddly it will leave the yum.conf file alone and make the new one ".rpmnew" … … 585 593 # TODO: Not generic enough to be done like that IMHO 586 594 # In case it was changed during the install 587 #pb_system("chroot $vepath /bin/bash -e -c \"ln -snf /bin/true /bin/domainname\"");588 pb_system("chroot $vepath /bin/bash -c \"if [ -x /usr/bin/authconfig ]; then /usr/bin/authconfig --enableshadow --update --nostart; fi\"","Calling authconfig");595 #pb_system("chroot $vepath $bash -e -c \"ln -snf /bin/true /bin/domainname\""); 596 pb_system("chroot $vepath $bash -c \"if [ -x /usr/bin/authconfig ]; then /usr/bin/authconfig --enableshadow --update --nostart; fi\"","Calling authconfig"); 589 597 590 598 # Installed additional packages we were asked to 591 599 if (defined $opts{'a'}) { 592 600 $opts{'a'} =~ s/,/ /g; 593 pb_system("chroot $vepath /bin/bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}");601 pb_system("chroot $vepath $bash -c \"$pbos->{'install'} $opts{'a'} \"","Adding packages to OS by running $pbos->{'install'} $opts{'a'}"); 594 602 } 595 603
Note:
See TracChangeset
for help on using the changeset viewer.