diff options
author | grant <grant@pkgsrc.org> | 2004-01-20 12:37:08 +0000 |
---|---|---|
committer | grant <grant@pkgsrc.org> | 2004-01-20 12:37:08 +0000 |
commit | 002e1324e0b2bbd96fa2bcc8ce03429e8a0df9ba (patch) | |
tree | 89928772404343b6e614760b551b565a43f8950a /mk/bulk | |
parent | 24a46ed346b4e0c41e9944cb1c53f4acf5faa3b7 (diff) | |
download | pkgsrc-002e1324e0b2bbd96fa2bcc8ce03429e8a0df9ba.tar.gz |
make this work on Solaris by using perl's internal grep(). it is
faster, and (f)grep can't handle very long word lists.
Diffstat (limited to 'mk/bulk')
-rw-r--r-- | mk/bulk/post-build | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/mk/bulk/post-build b/mk/bulk/post-build index f52394bb8b4..f46de66cf3f 100644 --- a/mk/bulk/post-build +++ b/mk/bulk/post-build @@ -1,5 +1,5 @@ #!/usr/pkg/bin/perl -# $NetBSD: post-build,v 1.26 2003/09/02 07:00:05 jlam Exp $ +# $NetBSD: post-build,v 1.27 2004/01/20 12:37:08 grant Exp $ # # Collect stuff after a pkg bulk build # @@ -251,30 +251,44 @@ close(HTML); system("mkdir -p leftovers-${arch}"); # Find files since last build: - system("find ${LOCALBASE} -newer ${USR_PKGSRC}/${startfile} -type f >>leftovers-${arch}.txt"); - system("find ${X11BASE} -newer ${USR_PKGSRC}/${startfile} -type f >>leftovers-${arch}.txt"); + $leftovers_txt = "leftovers-${arch}.txt"; + $leftovers_html = "leftovers-${arch}.html"; + system("find ${LOCALBASE} -newer ${USR_PKGSRC}/${startfile} -type f >>$leftovers_txt"); + system("find ${X11BASE} -newer ${USR_PKGSRC}/${startfile} -type f >>$leftovers_txt"); # Strip perl-files: - system("pkg_info -qL perl > .p.${arch}"); - system("fgrep -v -x -f .p.${arch} leftovers-${arch}.txt >leftovers-${arch}.txt.new"); - rename("leftovers-${arch}.txt.new", "leftovers-${arch}.txt"); - unlink(".p.${arch}"); + { + local $/; + undef $/; + $perlfiles = `pkg_info -qL perl`; + } + ($perlfiles_pattern = $perlfiles) =~ s/\n/|/g; + $perlfiles_pattern =~ s/|$//; + + open (LEFT, $leftovers_txt) or die "can't read $leftovers_txt: $!"; + @left = <LEFT>; + close (LEFT); + @leftovers = grep(!/^(${perlfiles_pattern})$/, @left); - # Store leftovers, for easier identification: - system("tar plcf - `cat leftovers-${arch}.txt` | ( cd leftovers-${arch} ; tar plxf - )"); + open (LEFT, ">$leftovers_txt") or die "can't write $leftovers_txt: $!"; + print LEFT @leftovers; + close (LEFT); + + if (scalar(@leftovers)) { + # Store leftovers, for easier identification: + system("tar plcf - `cat $leftovers_txt` | ( cd leftovers-${arch} ; tar plxf - )"); + } # Add links to leftover list: - open (IN, "< leftovers-${arch}.txt") - or die "can't read leftovers-${arch}.txt"; - open (OUT, "> leftovers-${arch}.html") - or die "can't write leftovers-${arch}.html"; + open (OUT, "> $leftovers_html") + or die "can't write $leftovers_html"; print OUT <<EOOUT <HTML> <BODY> <PRE> EOOUT ; - while (<IN>) { + foreach (@leftovers) { print OUT "<A HREF=\"${FTPHOST}/${FTPURL}/leftovers-${arch}$_\">$_</A>\n"; } print OUT <<EOOUT2 @@ -283,7 +297,6 @@ EOOUT </HTML> EOOUT2 ; - close(IN); close(OUT); } |