2 # $NetBSD: sort-packages,v 1.15 2010/04/10 21:44:44 wiz Exp $
4 # This program scans all binary packages in the current directory and
5 # creates two lists of files in OUTDIR:
8 # contains all packages that must not be published on the FTP
9 # server, for whatever reason
12 # contains all the other ("good") packages.
19 : ${PKG_ADMIN="pkg_admin"}
20 : ${PKG_INFO="pkg_info"}
22 regular_packages
="${OUTDIR}/regular_packages"
23 restricted_packages
="${OUTDIR}/restricted_packages"
27 : > "${regular_packages}"
28 : > "${restricted_packages}"
30 for pkg
in *${PKG_SUFX}; do
31 build_info
=`${PKG_INFO} -B "${pkg}"`
33 # Note: this code needs to be that complicated because licensing
34 # issues are critical to pkgsrc, and we really don't want
35 # anything unexpected to happen here. The worst case would be
36 # that some file is sorted wrongly because some change in the
37 # output of pkg_info which had not been foreseen. Therefore it
38 # is better to check as strictly as possible to make those
39 # changes immediately visible.
41 no_bin_on_ftp
="unknown"
42 case "${newline}${build_info}${newline}" in
43 *"${newline}NO_BIN_ON_FTP=${newline}"*)
46 *"${newline}NO_BIN_ON_FTP="*)
52 case "${newline}${build_info}${newline}" in
53 *"${newline}RESTRICTED=${newline}"*)
56 *"${newline}RESTRICTED="*)
62 if [ "${restricted}" = "no" ] && [ "${no_bin_on_ftp}" = "no" ]; then
65 if [ "${restricted}" = "yes" ] ||
[ "${no_bin_on_ftp}" = "yes" ]; then
70 : echo "upload> ${pkg} is ${category}."
74 echo "${pkg}" >> "${regular_packages}"
77 echo "${pkg}" >> "${restricted_packages}"
80 echo "sort-packages> WARNING: Could not sort ${pkg} into a category." 1>&2