Hi Marc Thanks for the patch. However I think it will only work with bash, and cron-apt uses /bin/sh as shell. Or do other shells handle $(()) ?
Do you also need as much as 10MB in /tmp? Best regards, // Ola On Sat, Jul 28, 2007 at 09:26:57AM +0200, Marc Haber wrote: > On Mon, Jun 12, 2006 at 10:52:20PM +0200, Ola Lundqvist wrote: > > On Mon, Jun 12, 2006 at 09:22:15PM +0200, Marc Haber wrote: > > > cron-apt could check for free space on /tmp in the beginning and print > > > a more meaningful error message if, say, less than 10 MB is free. This > > > will still break if /tmp fills up while cron-apt is running though. > > > > I Agree. Let's see what I can do about it. > > See attached, untested patch. > > Greetings > Marc > > -- > ----------------------------------------------------------------------------- > Marc Haber | "I don't trust Computers. They | Mailadresse im Header > Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 > Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835 > --- cron-apt.orig 2007-07-28 09:08:16.000000000 +0200 > +++ cron-apt 2007-07-28 09:26:10.000000000 +0200 > @@ -142,7 +142,11 @@ > CONFIGDIRNAME="$(echo $CONFIG | sed 's|/|_-_|g')" > TMPDIR=$(mktemp -d -t cron-apt.XXXXXX) > if [ $? -ne 0 ]; then > - echo "Error: Can not create a safe temporary directory." > + echo >&2 "Error: Can not create a safe temporary directory." > + exit 1 > +fi > +if [ "$(( $(stat --file-system --format=%S $TMPDIR) * $(stat --file-system > --format=%a $TMPDIR) / 1024 ))" -lt "10000" ]; then > + echo >&2 "Error: Not enough free space in $TMPDIR." > exit 1 > fi > -- --- Ola Lundqvist systemkonsult --- M Sc in IT Engineering ---- / [EMAIL PROTECTED] Annebergsslingan 37 \ | [EMAIL PROTECTED] 654 65 KARLSTAD | | http://opalsys.net/ Mobile: +46 (0)70-332 1551 | \ gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9 / --------------------------------------------------------------- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

