summaryrefslogtreecommitdiffstats
path: root/contrib/aix/inventory.sh
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-03-05 03:38:35 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-03-05 03:38:35 +0000
commit01e7fa13b4b447d1fdf674ad5fbdde1f1cdb9eaa (patch)
tree5b35a174b217283bb88c02d94acde10b89293dc2 /contrib/aix/inventory.sh
parent795488785e1e1273c628e25fb91a45e048984bb3 (diff)
- (bal) Added contrib/aix/ to support BFF package generation provided
by Darren Tucker <dtucker@zip.com.au>
Diffstat (limited to 'contrib/aix/inventory.sh')
-rwxr-xr-xcontrib/aix/inventory.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/contrib/aix/inventory.sh b/contrib/aix/inventory.sh
new file mode 100755
index 00000000..aa44ab9d
--- /dev/null
+++ b/contrib/aix/inventory.sh
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# inventory.sh
+#
+# Originall written by Ben Lindstrom, modified by Darren Tucker to use perl
+#
+# This will produced and 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=VOLATILE\n";
+ print "\tchecksum=VOLATILE\n";
+ } elsif ( -d $_ ) {
+ # Entry is Directory
+ print "\ttype=DIRECTORY\n";
+ }
+}'