diff options
| author | jp30 <jp30@nslu2-linux.org> | 2005-07-27 07:10:02 +0000 |
|---|---|---|
| committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-07-27 07:10:02 +0000 |
| commit | 87d14d029ffcf90065c56747854b475d9beba187 (patch) | |
| tree | 9b6e017250760d7541986e61e5fc88de2a3c21e2 /scripts | |
| parent | 5a0ba6ded2a8493174fc4446c6c48f58eb2d4340 (diff) | |
upload-unslung-modules target
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/.mtn2git_empty | 0 | ||||
| -rwxr-xr-x | scripts/package-strip.pl | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/scripts/.mtn2git_empty b/scripts/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/scripts/.mtn2git_empty diff --git a/scripts/package-strip.pl b/scripts/package-strip.pl new file mode 100755 index 0000000000..45c64134f8 --- /dev/null +++ b/scripts/package-strip.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl + +my $pat = shift(@ARGV) || usage(1); +my $infile = shift(@ARGV) || usage(1); +my $outfile = shift(@ARGV) || "-"; +print STDERR "Package-strip processing input file $infile\n"; +print STDERR "Output to " . ($outfile ne "-" ? $outfile : "stdout") . "\n"; + +# massage the regexp to accept semi-shell-style * +$pat =~ s/\*/.*/g; + +open (I,"<$infile") || die $@; +open (O,">>$outfile") || die $@; +undef $/; +my $srctext = <I>; +close(I); + +my @srclist = split(/\012\012\012/,$srctext); +my @outlist = grep(/Package: $pat/,@srclist); +print O join("\012\012\012",@outlist); +print O "\012\012\012"; + +sub usage { + my $cack = shift(@_); + print STDERR "usage: Package-strip <regexp> <filename> [output filename]\nRemember to escape wildcard characters for the shell."; + die if $cack; +} + |
