diff options
author | dmcmahill <dmcmahill@pkgsrc.org> | 2005-05-22 01:36:49 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill@pkgsrc.org> | 2005-05-22 01:36:49 +0000 |
commit | 6806d580c923107cacfe452804b09449d8a23e80 (patch) | |
tree | 50c10f62506bb166926a3fa3d7e30a39de9b1d6f /mk | |
parent | 0cb6a797abd794e7d41ec02d47451879a7a61edc (diff) | |
download | pkgsrc-6806d580c923107cacfe452804b09449d8a23e80.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}.
Diffstat (limited to 'mk')
-rwxr-xr-x | mk/scripts/binpkg-cache | 11 |
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 |