#!/bin/sh
#
# pkgmake
# Create package by name or full installed tree
# Version: 1.0b
# Copyright (c) 2007 Eugene Pankratovpkg_path="/usr/ports/packages/All"
pkg_cmd="pkg_create -yb"
usage()
{
echo ""
echo "Usage: `basename $0` <pkg_name>|--all"
echo ""
echo "Example: `basename $0` kdebase_3.5.5_3"
echo " `basename $0` --all"
exit 1
}
do_package()
{
pkg_name=$1
pkg_file=${pkg_name}.tbz
if [ ! -f ${pkg_path}/${pkg_file} ]; then
echo -n "Creating package '${pkg_name}'... "
${pkg_cmd} ${pkg_name}
echo "Done."
else
echo "Package ${pkg_file} already exists. Skiping"
fi
}
do_all()
{
echo "Creating all installed packages"
for i in `pkg_info | awk '{ print $1 }'`
do
do_package ${i}
done
}
main()
{
if [ "$1" = "" ]; then usage
else
cd ${pkg_path}
if [ "$1" = "--all" ]; then
do_all
else
do_package $1
fi
fi
}
main $1
exit 0
URL:
Обсуждается: https://www.opennet.ru/tips/info/1356.shtml