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

Re: Bug#37963: apt: unneccessary prompts



> ===
> CACHEDIR=/var/apt/cache/archives
> RES=`apt-config shell A Dir::Cache B Dir::Cache::archives`
> eval $RES
> CACHEDIR=${A}${B}
> 
> if [ `ls $CACHEDIR|grep -v "^lock$"|grep -v "^partial$"|wc -l` \
> 	-eq 0 -a `ls ${CACHEDIR}partial|wc -l` -eq 0 ]; then
> 	.....
> fi
> ===
> 
> in /usr/lib/dpkg/methods/apt/install; that would trigger cleanup only if
> any files exist in the cache.

Decent idea, I've applied something like this..

   if [ `ls $ARCHIVES $ARCHIVES/partial | egrep -v "^lock$|^partial$" | wc -l` \
        -eq 0 ]; then
      exit 0
   fi

Jason


Reply to: