- Timestamp:
- Feb 16, 2011, 12:17:55 PM (14 years ago)
- Location:
- devel/pb
- Files:
-
- 3 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 } -
devel/pb/lib/ProjectBuilder/Changelog.pm
r1156 r1192 61 61 62 62 my $pb = shift; 63 my $dtype = $pb->{'dtype'}; 63 64 my $dtype = $pb->{'pbos'}->{'type'}; 64 65 my $pbrealpkg = $pb->{'realpkg'}; 65 66 my $pbver = $pb->{'ver'}; 66 67 my $pbtag = $pb->{'tag'}; 67 my $pbsuf = $pb->{' suf'};68 my $pbsuf = $pb->{'pbos'}->{'suffix'}; 68 69 my $OUTPUT = shift; 69 70 my $doit = shift; … … 72 73 my $log = ""; 73 74 75 pb_log(2,"Entering pb_changelog - pb: ".Dumper($pb)."\n"); 76 pb_log(2,"Entering pb_changelog - doit: $doit\n") if (defined $doit); 77 pb_log(2,"Entering pb_changelog - OUTPUT: $OUTPUT\n") if (defined $OUTPUT); 74 78 # For date handling 75 79 $ENV{LANG}="C"; … … 82 86 (not (defined $OUTPUT)) || ($OUTPUT eq "") || 83 87 (not (defined $doit)) || ($doit eq "")) { 84 print $OUTPUT "\n"; 85 return; 86 } 87 88 if (((not defined $chglog) || (! -f $chglog)) && ($doit eq "yes")) { 89 #pb_log(2,"No ChangeLog file ($chglog) for $pbrealpkg\n"; 88 pb_log(2,"Not enough input params\n"); 90 89 print $OUTPUT "\n"; 91 90 return; … … 106 105 # If we don't need to do it, or don't have it fake something 107 106 if (((not defined $chglog) || (! -f $chglog)) && ($doit ne "yes")) { 107 pb_log(2,"No ChangeLog file for $pbrealpkg - faking one\n"); 108 108 $date = strftime("%Y-%m-%d", @date); 109 109 $ndate = &UnixDate($date,"%a", "%b", "%d", "%Y"); 110 110 $n2date = &UnixDate($date,"%a, %d %b %Y %H:%M:%S %z"); 111 if ( ($dtype eq "rpm") || ($dtype eq "fc")) {111 if ($dtype eq "rpm") { 112 112 $ver2 = "$pbver-$pbtag"; 113 113 print $OUTPUT "* $ndate $pbpackager->{$ENV{'PBPROJ'}} $ver2\n"; 114 114 print $OUTPUT "- Updated to $pbver\n"; 115 } 116 if ($dtype eq "deb") { 115 } elsif ($dtype eq "deb") { 117 116 if ($pbver !~ /^[0-9]/) { 118 117 # dpkg-deb doesn't accept non digit versions. … … 123 122 print $OUTPUT " * Updated to $pbver\n"; 124 123 print $OUTPUT " -- $pbpackager->{$ENV{'PBPROJ'}} $n2date\n\n\n"; 125 } 124 } else { 125 pb_log(0,"No ChangeLog file for $pbrealpkg and no way faking one for type $dtype\n"); 126 } 126 127 return; 127 128 } … … 208 209 } 209 210 close(INPUT); 211 pb_log(2,"Exiting pb_changelog\n"); 210 212 } 211 213 -
devel/pb/lib/ProjectBuilder/Filter.pm
r1186 r1192 62 62 63 63 my @ffiles; 64 my ($ffile00, $ffile0, $ffile1, $ffile2, $ffile3 );65 my ($mfile00, $mfile0, $mfile1, $mfile2, $mfile3 );64 my ($ffile00, $ffile0, $ffile1, $ffile2, $ffile3, $ffile4, $ffile5); 65 my ($mfile00, $mfile0, $mfile1, $mfile2, $mfile3, $mfile4, $mfile5); 66 66 my $pbpkg = shift || die "No package specified"; 67 67 my $pbos = shift; … … 69 69 my %h; 70 70 71 pb_log(2,"Entering pb_get_filters - pbpkg: $pbpkg - pbos: ".Dumper($pbos)."\n"); 71 72 # Global filter files first, then package specificities 72 73 if (-d "$ENV{'PBROOTDIR'}/pbfilter") { 73 74 $mfile00 = "$ENV{'PBROOTDIR'}/pbfilter/all.pbf" if (-f "$ENV{'PBROOTDIR'}/pbfilter/all.pbf"); 74 75 if (defined $pbos) { 75 $mfile0 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'type'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'type'}.pbf")); 76 $mfile1 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'family'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'family'}.pbf")); 77 $mfile2 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}.pbf")); 78 $mfile3 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf")); 76 $mfile0 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'os'}.pbf" if ((defined $pbos->{'os'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'os'}.pbf")); 77 $mfile1 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'type'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'type'}.pbf")); 78 $mfile2 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'family'}.pbf" if ((defined $pbos->{'family'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'family'}.pbf")); 79 $mfile3 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}.pbf" if ((defined $pbos->{'name'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}.pbf")); 80 $mfile4 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf" if ((defined $pbos->{'name'}) && (defined $pbos->{'version'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf")); 81 $mfile5 = "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.pbf" if ((defined $pbos->{'name'}) && (defined $pbos->{'version'}) && (defined $pbos->{'arch'}) && (-f "$ENV{'PBROOTDIR'}/pbfilter/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.pbf")); 79 82 } 80 83 … … 84 87 push @ffiles,$mfile2 if (defined $mfile2); 85 88 push @ffiles,$mfile3 if (defined $mfile3); 89 push @ffiles,$mfile4 if (defined $mfile4); 90 push @ffiles,$mfile5 if (defined $mfile5); 86 91 } 87 92 … … 89 94 $ffile00 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/all.pbf" if (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/all.pbf"); 90 95 if (defined $pbos) { 91 $ffile0 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'type'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'type'}.pbf")); 92 $ffile1 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'family'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'family'}.pbf")); 93 $ffile2 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}.pbf")); 94 $ffile3 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf")); 96 $ffile0 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'os'}.pbf" if ((defined $pbos->{'os'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'os'}.pbf")); 97 $ffile1 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'type'}.pbf" if ((defined $pbos->{'type'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'type'}.pbf")); 98 $ffile2 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'family'}.pbf" if ((defined $pbos->{'family'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'family'}.pbf")); 99 $ffile3 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}.pbf" if ((defined $pbos->{'name'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}.pbf")); 100 $ffile4 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf" if ((defined $pbos->{'name'}) && (defined $pbos->{'version'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}.pbf")); 101 $ffile5 = "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.pbf" if ((defined $pbos->{'name'}) && (defined $pbos->{'version'}) && (defined $pbos->{'arch'}) && (-f "$ENV{'PBROOTDIR'}/$pbpkg/pbfilter/$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'}.pbf")); 95 102 } 96 103 push @ffiles,$ffile00 if (defined $ffile00); … … 99 106 push @ffiles,$ffile2 if (defined $ffile2); 100 107 push @ffiles,$ffile3 if (defined $ffile3); 108 push @ffiles,$ffile4 if (defined $ffile4); 109 push @ffiles,$ffile5 if (defined $ffile5); 101 110 } 102 111 if (@ffiles) { … … 104 113 105 114 foreach my $f (@ffiles) { 115 pb_log(3,"DEBUG processing filter file $f\n"); 106 116 open(CONF,$f) || next; 107 117 while(<CONF>) { 108 118 if (/^\s*([A-z0-9-_]+)\s+([[A-z0-9-_]+)\s*=\s*(.+)$/) { 119 pb_log(3,"DEBUG creating entry $1, key $2, value $3\n"); 109 120 $h{$1}{$2}=$3; 110 121 } 111 122 } 112 123 close(CONF); 113 114 $ptr = $h{"filter"}; 115 pb_log(2,"DEBUG f:".Dumper($ptr)."\n"); 116 } 117 } 124 } 125 $ptr = $h{"filter"}; 126 } 127 pb_log(2,"DEBUG f:".Dumper($ptr)."\n") if (defined $ptr); 118 128 return($ptr); 119 129 }
Note:
See TracChangeset
for help on using the changeset viewer.