summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2005-05-22 01:36:49 +0000
committerdmcmahill <dmcmahill>2005-05-22 01:36:49 +0000
commitff650f7c6b80091097db025ad8454e31426c9972 (patch)
tree50c10f62506bb166926a3fa3d7e30a39de9b1d6f
parentd7b832f39ff0feebcb4dd97eaf51df3423483b16 (diff)
downloadpkgsrc-ff650f7c6b80091097db025ad8454e31426c9972.tar.gz
use find ${DIR}/ -name \*${SUFX} instead of ls ${DIR}/*${SUFX} when
generating a list of possibles packages. Avoids proglems with too long of a command line for ls. While here change find to ${FIND}.
-rwxr-xr-xmk/scripts/binpkg-cache11
1 files changed, 7 insertions, 4 deletions
diff --git a/mk/scripts/binpkg-cache b/mk/scripts/binpkg-cache
index a8a4587f82d..77a7e0d142c 100755
--- a/mk/scripts/binpkg-cache
+++ b/mk/scripts/binpkg-cache
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $NetBSD: binpkg-cache,v 1.2 2005/05/19 03:58:40 dmcmahill Exp $
+# $NetBSD: binpkg-cache,v 1.3 2005/05/22 01:36:49 dmcmahill Exp $
#
# Script for generating a cache file with information about
# all binary packages contained in a directory.
@@ -45,6 +45,7 @@ TMPDIR=${TMPDIR:-/tmp}
PACKAGES=${PACKAGES:-/usr/pkgsrc/packages/}
AWK=${AWK:-awk}
CMP=${CMP:-cmp}
+FIND=${FIND:-find}
GREP=${GREP:-grep}
PKG_INFO=${PKG_INFO:-pkg_info}
PKG_SUFX=${PKG_SUFX:-.tgz}
@@ -115,7 +116,7 @@ process_binpkg_dir(){
need_update=no
if test -f ${d}/${cachefile} ; then
- stale_entries=`find ${d} -type f -name \*${PKG_SUFX} -newer ${d}/${cachefile} -print`
+ stale_entries=`${FIND} ${d} -type f -name \*${PKG_SUFX} -newer ${d}/${cachefile} -print`
# FIX_ME
#
@@ -129,7 +130,9 @@ process_binpkg_dir(){
fi
# get the list of what pkgs belong in the cache
rm -f ${tmpd}/pkg_list ${tmpd}/cache_pkg_list
- ls ${d}/*${PKG_SUFX} | ${SED} "s;^${PACKAGES}/*;;g" | ${SORT} > ${tmpd}/pkg_list
+ ${FIND} ${d}/ -name \*${PKG_SUFX} -print | \
+ ${SED} -e "s;^${PACKAGES}/*;;g" -e 's;//;/;g' | \
+ ${SORT} > ${tmpd}/pkg_list
# and get the list of what is in the cache
${AWK} '/pkgcache_begin/ {gsub(/pkgcache_begin[ \t]*/, ""); print}' \
@@ -295,7 +298,7 @@ done
# put a trailing / after ${PACKAGES} in case ${PACKAGES} is
# a link.
-for d in `find ${PACKAGES}/ -type d -print` ; do
+for d in `${FIND} ${PACKAGES}/ -type d -print` ; do
if test "X${DEBUG}" = "Xyes" ; then
echo "${prompt}Processing directory ${d}"
fi