| 1 |
#!/bin/env perl -lw |
| 2 |
# |
| 3 |
# $Id: proto2manifest 958 2007-01-28 01:51:25Z comand $ |
| 4 |
# |
| 5 |
# Copyright 2006 Cory Omand <comand@blastwave.org> |
| 6 |
# All rights reserved. Use is subject to license terms. |
| 7 |
# |
| 8 |
# Redistribution and/or use, with or without modification, is |
| 9 |
# permitted. This software is without warranty of any kind. The |
| 10 |
# author(s) shall not be liable in the event that use of the |
| 11 |
# software causes damage. |
| 12 |
# |
| 13 |
# proto2manifest - Turn a package prototype into a manifest file. |
| 14 |
# |
| 15 |
|
| 16 |
use strict; |
| 17 |
|
| 18 |
my $root = $ARGV[0] || ""; |
| 19 |
|
| 20 |
my %files; |
| 21 |
while (<>) { |
| 22 |
next if /^i/; |
| 23 |
my @F = split; |
| 24 |
$F[2] =~ s/^.+=(.+)/$1/; |
| 25 |
$F[2] = "$root/$F[2]" unless $F[2] =~ m#\$basedir#; |
| 26 |
$F[2] =~ s#\$basedir#$root#; |
| 27 |
$F[2] =~ s#//#/#g; |
| 28 |
$files{$F[2]}++; |
| 29 |
} |
| 30 |
|
| 31 |
print foreach (sort keys %files); |
| 32 |
|