Changeset 721 in ProjectBuilder
- Timestamp:
- Mar 6, 2009, 6:09:05 PM (16 years ago)
- Location:
- devel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb-modules/lib/ProjectBuilder/Distribution.pm
r717 r721 514 514 if ($dtype eq "rpm") { 515 515 if ($bn =~ /\.rpm$/) { 516 pb_system("sudo rpm -Uvh $ENV{'PBTMP'}/$bn","Adding package to setup repostory"); 517 } elsif ($bn =~ /\.repo$/) { 516 my $pn = $bn; 517 $pn =~ s/\.rpm//; 518 if (pb_system("rpm -q --quiet $pn","","quiet") != 0) { 519 pb_system("sudo rpm -Uvh $ENV{'PBTMP'}/$bn","Adding package to setup repository"); 520 } 521 } elsif ($bn =~ /\.repo$/) { 518 522 # Yum repo 519 pb_system("sudo mv $ENV{'PBTMP'}/$bn /etc/yum.repo .d","Adding yum repository");523 pb_system("sudo mv $ENV{'PBTMP'}/$bn /etc/yum.repos.d","Adding yum repository") if (not -f "/etc/yum.repos.d/$bn"); 520 524 } elsif ($bn =~ /\.addmedia/) { 521 525 # URPMI repo 526 # We should test that it's not already a urpmi repo 522 527 pb_system("chmod 755 $ENV{'PBTMP'}/$bn ; sudo $ENV{'PBTMP'}/$bn 2>&1 > /dev/null","Adding urpmi repository"); 523 528 } else { … … 525 530 } 526 531 } elsif ($dtype eq "deb") { 527 if ( $bn =~ /\.sources.list$/) {532 if (($bn =~ /\.sources.list$/) && (not -f "/etc/apt/sources.list.d/$bn")) { 528 533 pb_system("sudo mv $ENV{'PBTMP'}/$bn /etc/apt/sources.list.d","Adding apt repository"); 529 534 pb_system("sudo apt-get update","Updating apt repository"); -
devel/pb/bin/pb
r714 r721 745 745 } 746 746 747 # Do we have additional script to run to prepare the environement for the project ? 748 # Then include it in the pbconf delivery 749 foreach my $pbvf ("pbvebuild.pre","pbvmbuild.pre","pbvebuild.post","pbvmbuild.post") { 750 if (-x "$ENV{'PBROOTDIR'}/$pbvf") { 751 pb_filter_file("$ENV{'PBROOTDIR'}/$pbvf",$ptr,"$ENV{'PBDESTDIR'}/$pbvf",\%pb); 752 chmod 0755,"$ENV{'PBDESTDIR'}/$pbvf"; 753 } 754 } 755 747 756 # Archive dest dir 748 757 chdir "$ENV{'PBDESTDIR'}" || die "Unable to change dir to $ENV{'PBDESTDIR'}"; … … 872 881 chmod 0755,"debian/rules"; 873 882 883 my $darch = pb_get_arch(); 884 pb_distro_setuprepo($ddir,$dver,$darch,$dtype); 874 885 pb_distro_installdeps("debian/control",$dtype,$pbupd); 875 886 pb_system("dpkg-buildpackage -us -uc -rfakeroot","Building package","verbose"); … … 1515 1526 # Architecture consistency 1516 1527 if ($arch ne $darch) { 1517 die "Unable to launch a VE of architecture $darch on a $arch platform" if ( not (($darch eq "x86_64") && ($arch =~ /i?86/)));1528 die "Unable to launch a VE of architecture $darch on a $arch platform" if (($darch eq "x86_64") && ($arch =~ /i?86/)); 1518 1529 } 1519 1530 … … 1621 1632 open(SCRIPT,"> $ENV{'PBDESTDIR'}/pbscript") || die "Unable to create $ENV{'PBDESTDIR'}/pbscript"; 1622 1633 print SCRIPT "#!/bin/bash\n"; 1634 1635 # Transmit the verbosity level to the virtual env/mach. 1636 my $verbose = ""; 1637 my $i = 0; # minimal debug level 1638 while ($i lt $pbdebug) { 1639 $verbose .= "-v "; 1640 $i++; 1641 } 1642 # Activate script verbosity if at least 2 for pbdebug 1643 print SCRIPT "set -x\n" if ($i gt 1); 1644 # Quiet if asked to be so on the original system 1645 $verbose = "-q" if ($pbdebug eq -1); 1646 1623 1647 print SCRIPT "echo ... Execution needed\n"; 1624 1648 print SCRIPT "# This is in directory delivery\n"; … … 1649 1673 print SCRIPT "$dateline\n"; 1650 1674 } 1651 1652 # Transmit the verbosity level to the virtual env/mach. 1653 my $verbose = ""; 1654 my $i = 0; # minimal debug level 1655 while ($i lt $pbdebug) { 1656 $verbose .= "-v "; 1657 $i++; 1658 } 1659 # Quiet if asked to be so on the original system 1660 $verbose = "-q" if ($pbdebug eq -1); 1675 # Use potential local proxy declaration in case we need it to download repo, pkgs, ... 1676 if (defined $ENV{'http_proxy'}) { 1677 print SCRIPT "export http_proxy=\"$ENV{'http_proxy'}\"\n"; 1678 } 1679 1680 if (defined $ENV{'ftp_proxy'}) { 1681 print SCRIPT "export ftp_proxy=\"$ENV{'ftp_proxy'}\"\n"; 1682 } 1683 1684 1685 # We may need to do some other tasks before building. Read a script here to finish setup 1686 if (-x "$ENV{'PBDESTDIR'}/pb$vtype"."build.pre") { 1687 print SCRIPT "# Special pre-build instructions to be launched\n"; 1688 print SCRIPT pb_get_content("$ENV{'PBDESTDIR'}/pb$vtype"."build.pre"); 1689 } 1661 1690 1662 1691 print SCRIPT "# Build\n"; … … 1666 1695 print SCRIPT "sudo umount /proc\n"; 1667 1696 } 1697 1698 # We may need to do some other tasks after building. Read a script here to exit properly 1699 if (-x "$ENV{'PBDESTDIR'}/pb$vtype"."build.post") { 1700 print SCRIPT "# Special post-build instructions to be launched\n"; 1701 print SCRIPT pb_get_content("$ENV{'PBDESTDIR'}/pb$vtype"."build.post"); 1702 } 1703 1668 1704 close(SCRIPT); 1669 1705 chmod 0755,"$ENV{'PBDESTDIR'}/pbscript"; … … 2122 2158 print "distro tuple: ".join(',',($ddir, $dver, $dfam, $dtype, $pbsuf))."\n"; 2123 2159 2160 # We may need a proxy configuration. Get it from the local env 2161 EOF 2162 2163 if (defined $ENV{'http_proxy'}) { 2164 print SCRIPT "\$ENV\{'http_proxy'\}=\"$ENV{'http_proxy'}\";\n"; 2165 } 2166 2167 if (defined $ENV{'ftp_proxy'}) { 2168 print SCRIPT "\$ENV\{'ftp_proxy'\}=\"$ENV{'ftp_proxy'}\";\n"; 2169 } 2170 2171 print {$SCRIPT} << 'EOF'; 2124 2172 # Get and install pb 2125 2173 my $insdm = "rm -rf Date-Manip* ; wget http://search.cpan.org/CPAN/authors/id/S/SB/SBECK/Date-Manip-5.54.tar.gz ; tar xvfz Date-Manip-5.54.tar.gz ; cd Date-Manip* ; perl Makefile.PL ; make ; make install ; cd .. ; rm -rf Date-Manip*";
Note:
See TracChangeset
for help on using the changeset viewer.