diff options
author | green <green@FreeBSD.org> | 2002-03-11 03:11:03 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2002-03-11 03:11:03 +0000 |
commit | fa2d01928ed9c7471670cbdc1e72c22dc9f0bf02 (patch) | |
tree | 4c6df12479fe668f84a0d5136074759d7b2ca1fe /Tools | |
parent | 811c5e228a1a8b5cf7a5613e757e4a1053a0bd56 (diff) | |
download | FreeBSD-ports-fa2d01928ed9c7471670cbdc1e72c22dc9f0bf02.zip FreeBSD-ports-fa2d01928ed9c7471670cbdc1e72c22dc9f0bf02.tar.gz |
Reenable use of the -M option and add a -d option to put @dirrm commands
at the end of the plist.
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/plist | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Tools/scripts/plist b/Tools/scripts/plist index 04feddf..9b7a62e 100755 --- a/Tools/scripts/plist +++ b/Tools/scripts/plist @@ -83,17 +83,30 @@ end if __FILE__ == $0 require 'getopts' - if !getopts('M', 'm:') || ARGV.size != 1 + if !getopts('Md', 'm:') || ARGV.size != 1 $stderr.print <<-USAGE_EOF -usage: #{$0} [-M] [-m mtree] somepath +usage: #{$0} [-Md] [-m mtree] somepath Generate a pkg-plist to stdout given a previously empty somepath which a port has been installed into (PREFIX=somepath). The mtree file is consulted to prevent base directories from being added to the plist. The -M argument allows manpages to be added to the plist. + The -d argument puts all @dirrm commands at the end of the plist. USAGE_EOF exit 1 end - man = $OPT_M || true mtree = $OPT_m || '/etc/mtree/BSD.local.dist' - puts Plist.new(man, Mtree.read(mtree).paths).make(ARGV[0]).join("\n") + pl = Plist.new(!$OPT_M, Mtree.read(mtree).paths).make(ARGV[0]) + if $OPT_d + plnotdirrm = [] + pldirrm = [] + pl.each {|ent| + if ent =~ /^@dirrm / + pldirrm.push(ent) + else + plnotdirrm.push(ent) + end + pl = plnotdirrm + pldirrm + } + end + puts(pl.join("\n")) end |