[csw-devel] SF.net SVN: gar:[12101] csw/mgar/gar/v2/lib/sh/libcheckpkg.sh

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Dec 27 14:48:20 CET 2010


Revision: 12101
          http://gar.svn.sourceforge.net/gar/?rev=12101&view=rev
Author:   wahwah
Date:     2010-12-27 13:48:20 +0000 (Mon, 27 Dec 2010)

Log Message:
-----------
custom-pkgtrans: counting retries rather than hdr

The initial value can be higher than 100, uncoupling the retries number from
the initial number of header blocks.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/sh/libcheckpkg.sh

Modified: csw/mgar/gar/v2/lib/sh/libcheckpkg.sh
===================================================================
--- csw/mgar/gar/v2/lib/sh/libcheckpkg.sh	2010-12-27 13:47:48 UTC (rev 12100)
+++ csw/mgar/gar/v2/lib/sh/libcheckpkg.sh	2010-12-27 13:48:20 UTC (rev 12101)
@@ -25,7 +25,9 @@
   hdrblks=$(( $hdrblks + 1 ))
   mkdir $2/$3
 
+  local counter=0
   while :; do
+    echo "Attempting ${hdrblks} offset"
     # cpio sometimes returns 1, and we don't want to bail out when it happens.
     dd if="$1" skip="$hdrblks" | (cd $2/$3 ; cpio -ivdm) || true
     if [[ -d "$2/$3/install" ]]; then
@@ -33,8 +35,9 @@
       break
     fi
     hdrblks=$(( $hdrblks + 1 ))
+    counter=$(( $counter + 1 ))
     # To prevent us from going on forever.
-    if [[ "${hdrblks}" -gt 100 ]]; then
+    if [[ "${counter}" -gt 100 ]]; then
       echo "Unpack keeps on being unsuccessful. Bailing out."
       return 1
     fi


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list