#!/bin/sh
[ "$1" ] || { echo "Usage: $0 pkgname"; exit 1; }
[ -f pkginfo ] && { echo "pkginfo file exists"; exit 1; }
[ -f prototype ] && { echo "prototype file exists"; exit 1; }
pkginfo $1 1>/dev/null || exit $?
pkgchk $1 || exit $?
pkginfo -l $1 | sed -ne '
/^ *[A-Z]\{1,\}/ {
s/^ *//
s/: */="/
s/$/"/
s/^PKGINST=/PKG=/
/^STATUS=/d
/^FILES=/d
p
}' > pkginfo
echo 'i pkginfo' > prototype
pkgchk -l $1 | sed -ne '/^Pathname: / { s/[^ ]* //; p; }' | pkgproto >> prototype
pkgmk -o -r / -d . -f prototype
echo | pkgtrans -s . $1.pkg
or simply grabbing the package, without any catalog information
sed -ne '
/^[^ ]\{1,\} [^d] .* SUNWzip$/ {
s/[= ].*$//; p;
}' /var/sadm/install/contents | xargs tar cvf SUNWzip.tar
Drop me an email if I'm missing some obvious tool to do all this!
No comments:
Post a Comment