#!/bin/sh # pkgsummary # This script gives a summary of what is contained in a package # according to its "bom" (bill of materials). # The pkg file to be looked at is specified as a command-line argument. # # Cameron Hayne (macdev@hayne.net) August 2006 if [ $# -lt 1 ]; then scriptname=`basename $0` echo "Usage: $scriptname pkg_file" exit fi pkg_path=$1 # We use 'find' to get the .bom files under the .pkg folder # and then run 'lsbom' on them # and then use 'sed' to remove the extraneous dot from the start of each line # and run the results through 'sort | uniq' # (this is useful since there are often two duplicate bom's in a .pkg) # and then use 'grep -v' to remove the sub-files under application bundles etc find "$pkg_path" -name '*.bom' -print0 | xargs -0 lsbom -pf \ | sed 's/^\.//' \ | sort | uniq \ | grep -v ".app/" \ | grep -v ".wdgt/" \ | grep -v ".bundle/" \ | grep -v ".plugin/" \ | grep -v ".prefPane/" \ | grep -v ".loginPlugin/" \ | grep -v ".monitorPanel/" \ | grep -v ".framework/" \ | grep -v ".fs/" \ | grep -v ".kext/" \ | grep -v ".menu/" \ | grep -v ".action/" \ | grep -v ".workflow/" \ | grep -v ".dict/" \ | grep -v ".colorPicker/" \ | grep -v ".spreporter/" \ | grep -v ".syncschema/" \ | grep -v ".mdimporter/" \ | grep -v ".service/" \ | grep -v ".osax/" \ | grep -v ".component/" \ | grep -v ".tokend/" \ | grep -v "/Contents"