Changeset 1192 in ProjectBuilder for devel/pb/bin
- Timestamp:
- Feb 16, 2011, 12:17:55 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/pb/bin/pb
r1190 r1192 872 872 $pb->{'ver'} = $pbver; 873 873 $pb->{'pkg'} = $pbpkg; 874 $pb->{'suf'} = $pbos->{'suffix'}; 874 875 $pb->{'realpkg'} = $pbpkg; 875 $pb->{'suf'} = $pbos->{'suffix'};876 876 $pb->{'date'} = $pbdate; 877 877 $pb->{'defpkgdir'} = $defpkgdir; … … 923 923 924 924 # Get all filters to apply 925 my$ptr = pb_get_filters($pbpkg,$pbos);925 $ptr = pb_get_filters($pbpkg,$pbos); 926 926 927 927 pb_log(2,"DEBUG Filtering PBDATE => $pbdate, PBTAG => $pbtag, PBVER => $pbver\n"); … … 1650 1650 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}"; 1651 1651 } elsif ($cmt eq "Packages") { 1652 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}"; 1652 if (($pbos->{'type'} eq "rpm") || ($pbos->{'type'} eq "pkg") || ($pbos->{'type'} eq "hpux") || ($pbos->{'type'} eq "tgz")) { 1653 # put packages under an arch subdir 1654 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}/$pbos->{'arch'}"; 1655 } elsif (($pbos->{'type'} eq "deb") || ($pbos->{'type'} eq "ebuild")) { 1656 # No need for an arch subdir 1657 $tdir = "$sshdir->{$ENV{'PBPROJ'}}/$delivery->{$ENV{'PBPROJ'}}/$pbos->{'name'}/$pbos->{'version'}"; 1658 } else { 1659 die "Please teach the dev team where to deliver ($pbos->{'type'} type of packages\n"; 1660 } 1653 1661 1654 1662 my $repodir = $tdir; … … 1777 1785 1778 1786 # Up two levels to deal with the dist dir cross versions 1779 cd .. /..1787 cd .. 1780 1788 mkdir -p dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'} dists/$pbos->{'version'}/contrib/source 1781 1789 1782 1790 # Prepare a script to create apt info file 1791 # Reuse twice after 1783 1792 TMPD=`mktemp -d /tmp/pb.XXXXXXXXXX` || exit 1 1784 1793 mkdir -p \$TMPD … … 1791 1800 1792 1801 echo "Creating Packages metadata ($pbos->{'arch'})" 1793 dpkg-scanpackages -a$pbos->{'arch'} $pbos->{'version'} /$pbos->{'arch'}/dev/null | gzip -c9 > dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Packages.gz1794 dpkg-scanpackages -a$pbos->{'arch'} $pbos->{'version'} /$pbos->{'arch'}/dev/null | bzip2 -c9 > dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Packages.bz21795 echo "Creating Contents metadata ($pbos->{'arch'})"1796 apt-ftparchive contents $pbos->{'version'} | gzip -c9 > dists/$pbos->{'version'}/Contents -$pbos->{'arch'}.gz1802 dpkg-scanpackages -a$pbos->{'arch'} $pbos->{'version'} /dev/null | gzip -c9 > dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Packages.gz 1803 dpkg-scanpackages -a$pbos->{'arch'} $pbos->{'version'} /dev/null | bzip2 -c9 > dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Packages.bz2 1804 echo "Creating Contents metadata" 1805 apt-ftparchive contents $pbos->{'version'} | gzip -c9 > dists/$pbos->{'version'}/Contents.gz 1797 1806 echo "Creating Release metadata ($pbos->{'arch'})" 1798 1807 cat \$TMPD/Release > dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Release 1799 1808 echo "Architecture: $pbos->{'arch'}" >> dists/$pbos->{'version'}/contrib/binary-$pbos->{'arch'}/Release 1800 1809 echo "Creating Source metadata" 1801 dpkg-scansources $pbos->{'version'} /$pbos->{'arch'}/dev/null | gzip -c9 > dists/$pbos->{'version'}/contrib/source/Sources.gz1810 dpkg-scansources $pbos->{'version'} /dev/null | gzip -c9 > dists/$pbos->{'version'}/contrib/source/Sources.gz 1802 1811 cat \$TMPD/Release > dists/$pbos->{'version'}/contrib/source/Release 1803 1812 echo "Architecture: Source" >> dists/$pbos->{'version'}/contrib/source/Release … … 1984 1993 } 1985 1994 my $hoption = "-p"; 1986 my $hpath = "/sbin";1987 # Solaris doesn't support - hand has halt elsewhere1995 my $hpath = pb_distro_get_param($pbos,pb_conf_get("oscmdpath-halt")); 1996 # Solaris doesn't support -p and has halt elsewhere 1988 1997 if ($pbos->{'type'} eq "pkg") { 1989 1998 $hoption = "" ; 1990 $hpath = "/usr/sbin";1991 1999 } 1992 2000 pb_system("$shcmd \"sudo $hpath/halt $hoption \"; sleep $tm ; echo \'if [ -d /proc/$vmpid ]; then kill -9 $vmpid; fi \' | bash ; sleep 10","VM $v halt (pid $vmpid)"); … … 2957 2965 # Try to restrict security to what is really needed 2958 2966 if ($vtype =~ /^vm/) { 2959 my $hpath = "/sbin"; 2960 # TODO: make that an external variable ! 2961 # Solaris has halt elsewhere 2962 if ($pbos->{'type'} eq "pkg") { 2963 $hpath = "/usr/sbin"; 2964 } 2967 my $hpath = pb_distro_get_param($pbos,pb_conf_get("oscmdpath-halt")); 2965 2968 my @sudocmds = pb_get_sudocmds($pbos,$ntpline,"$hpath/halt"); 2966 2969 print SCRIPT << "EOF"; … … 2970 2973 EOF 2971 2974 foreach my $c (@sudocmds) { 2972 print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}} localhost= NOPASSWD: $c\n\";";2975 print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}} ALL = NOPASSWD: $c\n\";"; 2973 2976 } 2974 2977 } elsif ($vtype =~ /^rm/) { … … 2978 2981 EOF 2979 2982 foreach my $c (@sudocmds) { 2980 print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}} localhost= NOPASSWD: $c\n\";";2983 print SCRIPT "print PBOUT \"$pbac->{$ENV{'PBPROJ'}} ALL = NOPASSWD: $c\n\";"; 2981 2984 } 2982 2985 } else { … … 3768 3771 foreach my $c (split(/;/,$pbos->{'update'}),split(/;/,$pbos->{'install'}),@lines) { 3769 3772 next if ($c !~ /^sudo/); 3773 # remove sudo 3770 3774 $c =~ s/^sudo\s+//; 3775 # remove leading spaces 3771 3776 $c =~ s/^\s+//; 3777 # remove ending spaces 3772 3778 $c =~ s/\s+$//; 3779 # keep only the command, not the params 3780 $c =~ s/([^\s]+)\s.*$/$1/; 3773 3781 $sudocmds{$c} = ""; 3774 3782 }
Note:
See TracChangeset
for help on using the changeset viewer.