pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/scripts use find ${DIR}/ -name \*${SUFX} instead of...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6a718c8bca4d
branches:  trunk
changeset: 494255:6a718c8bca4d
user:      dmcmahill <dmcmahill%pkgsrc.org@localhost>
date:      Sun May 22 01:36:49 2005 +0000

description:
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:

 mk/scripts/binpkg-cache |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (48 lines):

diff -r e8bb2fb3ae0f -r 6a718c8bca4d mk/scripts/binpkg-cache
--- a/mk/scripts/binpkg-cache   Sun May 22 01:33:31 2005 +0000
+++ b/mk/scripts/binpkg-cache   Sun May 22 01:36:49 2005 +0000
@@ -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 @@
 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 @@
 
        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 @@
                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 @@
 
 # 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



Home | Main Index | Thread Index | Old Index