Mercurial > pkg
diff src/pkg-examine.pl @ 25:d956ace7380e
creating pkg-examine.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Thu, 10 Jan 2013 15:12:34 +0000 |
parents | |
children | dd480255bd82 |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/pkg-examine.pl Thu Jan 10 15:12:34 2013 +0000 1.3 @@ -0,0 +1,28 @@ 1.4 +#!/usr/bin/perl 1.5 + 1.6 + 1.7 +if ($ARGV[0] eq "--help"){ 1.8 + print <<"HERE"; 1.9 + 1.10 +pkg-examine -- print package contents. 1.11 + 1.12 +Written by Robert McIntyre. This software is free 1.13 +software and is released to the public domain. 1.14 + 1.15 +HERE 1.16 +exit 0; 1.17 +} 1.18 + 1.19 + 1.20 + 1.21 +$" = " "; 1.22 +$pkg_name = $ARGV[0]; 1.23 + 1.24 +`id -g $pkg_name 2>/dev/null`; 1.25 +if ($?){ 1.26 + print "No group named $pkg_name."; 1.27 + exit 0;} 1.28 + 1.29 +@files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`); 1.30 + 1.31 +print "@files\n";