[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-cvs
Subject:    [IPCop-cvs] ipcop/updates/1.4.17 setup,1.1.2.17,1.1.2.18
From:       Gilles Espinasse <gespinasse () users ! sourceforge ! net>
Date:       2007-10-20 14:25:25
Message-ID: E1IjFGa-0008Dr-LH () mail ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/ipcop/ipcop/updates/1.4.17
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26709/updates/1.4.17

Modified Files:
      Tag: IPCOP_v1_4_0
	setup 
Log Message:
Instead of blindly testing untar the update on a partition, read available
size on that partition. This part is simple.
The complicated part is to know what to do with that information size.

The size required to extract patch-<number>.tar.gpg from the .gpg file is simple.
That's the same as the .gpg file (less the signature).

Extracting the content of patch-<number>.tar.gpg (patch.tar.gz, information,
setup) has no problem too as size is the same (once the hack patch.tar.gz
containing patch.tar.gz has been removed)

But when extracting the files from patch.tar.gz, many problems may happen.
That's very hard to know wich size is needed on disk only to untar the files.
If it fail, that may be very bad, like resizing a file to 0.
I try different ways, but even with 2 supplemental MB, untar may fail on a
5.2 MB update (10 MB uncompressed).
To complicate the issue, free size on disk could vary when you manipulate files
during test as it make disk buffers growing.
There is no way to reset buffer size on 2.4 kernel.
So if there is not enought place to install an update, rebooting could help as
buffer size will be smaller.

For those reasons, I try to be carefull.
- if the disk has twice the update free on disk, we could hope to run the final
  untar without troubles,
- between once the patch size (plus a 500kB margin) to twice the size available
  on disk, setup extract files one by one. This work with 'setup lowspace'.
  This is very slow but it never fail to me.



Index: setup
===================================================================
RCS file: /cvsroot/ipcop/ipcop/updates/1.4.17/Attic/setup,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -d -r1.1.2.17 -r1.1.2.18
*** setup	20 Oct 2007 10:59:34 -0000	1.1.2.17
--- setup	20 Oct 2007 14:25:23 -0000	1.1.2.18
***************
*** 27,33 ****
  rm -f /lib/libncurses.so.5.4 /usr/lib/libpanel.so.5.4
  
! /bin/tar -zxpf patch.tar.gz -C /
! if [ $? -ne 0 ]; then
! 	/usr/bin/logger -t installpackage "Error extracting patch.tar.gz, need more free space on disk"
  	exit 4 # ERRORTAR
  fi
--- 27,47 ----
  rm -f /lib/libncurses.so.5.4 /usr/lib/libpanel.so.5.4
  
! FAILURE=0
! if [ "$1" != 'lowspace' ]; then
! 	/bin/tar -zxpf patch.tar.gz -C /
! 	FAILURE=$?
! else
! 	# Extract files one by one, very slow but work with limited free space
! 	/bin/tar -ztf patch.tar.gz >./file_list
! 	for i in `/bin/cat ./file_list`; do
! 		/bin/tar -zxpf patch.tar.gz -C / $i # add -v to debug
! 		if [ $? -ne 0 ]; then
! 			FAILURE=1
! 			break
! 		fi
! 	done
! fi
! if [ $FAILURE -ne 0 ]; then
! 	/usr/bin/logger -t installpackage "Error extracting patch.tar.gz $1, need more free space on disk"
  	exit 4 # ERRORTAR
  fi


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
IPCop-cvs mailing list
IPCop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic