# HG changeset patch # User Robert McIntyre # Date 1360493555 18000 # Node ID 6422228dfea75f2aa4b0df573535393bc6a6893c # Parent 4c49f8e6d79da5e60b521f9d97231bddbc97a315 better name. diff -r 4c49f8e6d79d -r 6422228dfea7 src/pkg-examine.pl --- a/src/pkg-examine.pl Sun Feb 10 05:51:54 2013 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -#!/usr/bin/perl -use File::stat; - -if ($ARGV[0] eq "--help"){ - print <<"HERE"; - -pkg-examine -- print package contents. - -Written by Robert McIntyre. This software is free -software and is released to the public domain. - -HERE -exit 0; -} - -$" = " "; -$pkg_name = $ARGV[0]; - -`id -g $pkg_name 2>/dev/null`; -if (($pkg_name eq "") || $?){ - print "No group named $pkg_name.\n"; - exit 0; -} - -@files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`); - - -print "All files owned by this package:\n"; -foreach (@files){print " $_\n";} - -print "SetUID/SetGID files:\n"; -foreach $file(@files){ - - $sb = stat($file); - $mode = $sb->mode & 07777; - if ($mode & 07000){ - printf "%s, %04o\n", $file, $mode; - } -} - - - - - diff -r 4c49f8e6d79d -r 6422228dfea7 src/pkg-files.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pkg-files.pl Sun Feb 10 05:52:35 2013 -0500 @@ -0,0 +1,44 @@ +#!/usr/bin/perl +use File::stat; + +if ($ARGV[0] eq "--help"){ + print <<"HERE"; + +pkg-examine -- print package contents. + +Written by Robert McIntyre. This software is free +software and is released to the public domain. + +HERE +exit 0; +} + +$" = " "; +$pkg_name = $ARGV[0]; + +`id -g $pkg_name 2>/dev/null`; +if (($pkg_name eq "") || $?){ + print "No group named $pkg_name.\n"; + exit 0; +} + +@files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`); + + +print "All files owned by this package:\n"; +foreach (@files){print " $_\n";} + +print "SetUID/SetGID files:\n"; +foreach $file(@files){ + + $sb = stat($file); + $mode = $sb->mode & 07777; + if ($mode & 07000){ + printf "%s, %04o\n", $file, $mode; + } +} + + + + +