changeset 34:6422228dfea7

better name.
author Robert McIntyre <rlm@mit.edu>
date Sun, 10 Feb 2013 05:52:35 -0500
parents 4c49f8e6d79d
children 4823f88ea3b6
files src/pkg-examine.pl src/pkg-files.pl
diffstat 2 files changed, 44 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/src/pkg-examine.pl	Sun Feb 10 05:51:54 2013 -0500
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,44 +0,0 @@
     1.4 -#!/usr/bin/perl
     1.5 -use File::stat;
     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 -$pkg_name = $ARGV[0];
    1.21 -
    1.22 -`id -g $pkg_name 2>/dev/null`;
    1.23 -if (($pkg_name eq "") || $?){
    1.24 -    print "No group named $pkg_name.\n";
    1.25 -    exit 0;
    1.26 -}
    1.27 -
    1.28 -@files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`);
    1.29 -
    1.30 -
    1.31 -print "All files owned by this package:\n";
    1.32 -foreach (@files){print "   $_\n";}
    1.33 -
    1.34 -print "SetUID/SetGID files:\n";
    1.35 -foreach $file(@files){
    1.36 -
    1.37 -    $sb = stat($file);
    1.38 -    $mode = $sb->mode & 07777;
    1.39 -    if ($mode & 07000){
    1.40 -	printf "%s, %04o\n", $file, $mode;
    1.41 -    }
    1.42 -}
    1.43 -
    1.44 -    
    1.45 -
    1.46 -
    1.47 -
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/src/pkg-files.pl	Sun Feb 10 05:52:35 2013 -0500
     2.3 @@ -0,0 +1,44 @@
     2.4 +#!/usr/bin/perl
     2.5 +use File::stat;
     2.6 +
     2.7 +if ($ARGV[0] eq "--help"){
     2.8 +  print <<"HERE";
     2.9 +
    2.10 +pkg-examine -- print package contents.
    2.11 +
    2.12 +Written by Robert McIntyre. This software is free
    2.13 +software and is released to the public domain.
    2.14 +  
    2.15 +HERE
    2.16 +exit 0;
    2.17 +}
    2.18 +
    2.19 +$" = " ";
    2.20 +$pkg_name = $ARGV[0];
    2.21 +
    2.22 +`id -g $pkg_name 2>/dev/null`;
    2.23 +if (($pkg_name eq "") || $?){
    2.24 +    print "No group named $pkg_name.\n";
    2.25 +    exit 0;
    2.26 +}
    2.27 +
    2.28 +@files = split(/\0/, `find /usr /opt /etc -group $pkg_name -print0`);
    2.29 +
    2.30 +
    2.31 +print "All files owned by this package:\n";
    2.32 +foreach (@files){print "   $_\n";}
    2.33 +
    2.34 +print "SetUID/SetGID files:\n";
    2.35 +foreach $file(@files){
    2.36 +
    2.37 +    $sb = stat($file);
    2.38 +    $mode = $sb->mode & 07777;
    2.39 +    if ($mode & 07000){
    2.40 +	printf "%s, %04o\n", $file, $mode;
    2.41 +    }
    2.42 +}
    2.43 +
    2.44 +    
    2.45 +
    2.46 +
    2.47 +