summaryrefslogtreecommitdiff
path: root/polux/application/openssh/contrib/aix/inventory.sh
diff options
context:
space:
mode:
authorJean-Philippe SAVE2012-02-20 16:38:56 +0100
committerJean-Philippe SAVE2012-02-20 16:38:56 +0100
commit55a15cc820e926219ebce47218ce1e2f35bb0c48 (patch)
treedba3ff39a766e47859ab7fd837d8da5d30b56b1f /polux/application/openssh/contrib/aix/inventory.sh
parent1353d3215782b997fdec3f9182cbda547d92d7e9 (diff)
parentcfc4d43d4d19c398d994b75cb1eeda3c499bd234 (diff)
Add polux base by subtree merge
Diffstat (limited to 'polux/application/openssh/contrib/aix/inventory.sh')
-rwxr-xr-xpolux/application/openssh/contrib/aix/inventory.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/polux/application/openssh/contrib/aix/inventory.sh b/polux/application/openssh/contrib/aix/inventory.sh
new file mode 100755
index 0000000000..e2641e79c4
--- /dev/null
+++ b/polux/application/openssh/contrib/aix/inventory.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+#
+# inventory.sh
+# $Id: inventory.sh,v 1.6 2003/11/21 12:48:56 djm Exp $
+#
+# Originally written by Ben Lindstrom, modified by Darren Tucker to use perl
+# This file is placed into the public domain.
+#
+# This will produce an AIX package inventory file, which looks like:
+#
+# /usr/local/bin:
+# class=apply,inventory,openssh
+# owner=root
+# group=system
+# mode=755
+# type=DIRECTORY
+# /usr/local/bin/slogin:
+# class=apply,inventory,openssh
+# owner=root
+# group=system
+# mode=777
+# type=SYMLINK
+# target=ssh
+# /usr/local/share/Ssh.bin:
+# class=apply,inventory,openssh
+# owner=root
+# group=system
+# mode=644
+# type=FILE
+# size=VOLATILE
+# checksum=VOLATILE
+
+find . ! -name . -print | perl -ne '{
+ chomp;
+ if ( -l $_ ) {
+ ($dev,$ino,$mod,$nl,$uid,$gid,$rdev,$sz,$at,$mt,$ct,$bsz,$blk)=lstat;
+ } else {
+ ($dev,$ino,$mod,$nl,$uid,$gid,$rdev,$sz,$at,$mt,$ct,$bsz,$blk)=stat;
+ }
+
+ # Start to display inventory information
+ $name = $_;
+ $name =~ s|^.||; # Strip leading dot from path
+ print "$name:\n";
+ print "\tclass=apply,inventory,openssh\n";
+ print "\towner=root\n";
+ print "\tgroup=system\n";
+ printf "\tmode=%lo\n", $mod & 07777; # Mask perm bits
+
+ if ( -l $_ ) {
+ # Entry is SymLink
+ print "\ttype=SYMLINK\n";
+ printf "\ttarget=%s\n", readlink($_);
+ } elsif ( -f $_ ) {
+ # Entry is File
+ print "\ttype=FILE\n";
+ print "\tsize=$sz\n";
+ print "\tchecksum=VOLATILE\n";
+ } elsif ( -d $_ ) {
+ # Entry is Directory
+ print "\ttype=DIRECTORY\n";
+ }
+}'