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

Re: Patch for cross-install



On Wed, Sep 04, 2002 at 12:08:10PM +0200, Santiago Vila wrote:
[cross-install patch]

While reading this I remembered the new Packages.bz2 introduction,
and the following patch takes advantage of this. (also a minor
optimization ;)

regards,
guillem


--- cross-install	2002-09-04 21:20:21.000000000 +0200
+++ cross-install.patched	2002-09-04 21:20:21.000000000 +0200
@@ -269,10 +269,15 @@
     if ! [ -z "$download" ]; then
       echo "- ${pname} not found, downloading from ${download}."
       mkdir -p ${repository}/partial
-      if [ ! -f ${repository}/partial/Packages.gz ]; then
+      if [ ! -f ${repository}/partial/Packages ]; then
+        wget -cP ${repository}/partial ${download}/dists/${dist}/main/binary-${arch}/Packages.bz2
+        bunzip2 ${repository}/partial/Packages.bz2 
+      fi
+      if [ ! -f ${repository}/partial/Packages ]; then
         wget -cP ${repository}/partial ${download}/dists/${dist}/main/binary-${arch}/Packages.gz
+        gunzip ${repository}/partial/Packages.gz 
       fi
-      filename=`zcat ${repository}/partial/Packages.gz | awk -vp=$pname '
+      filename=`cat ${repository}/partial/Packages | awk -vp=$pname '
         $0 ~ "^Package:" { package = $2 }
         $0 ~ "^Filename:" && p == package { print $2 }'`
       wget --retr-symlinks -cP ${repository}/partial ${download}/$filename



Reply to: