Hi,

Can you please submit this patch in 
reviewboard(https://reviews.apache.org/dashboard/)? Please generate the patch 
using git format-patch -M -C -o <dir> 
<prev_commit#>..<this_patch's_local_commit#>. You may need to run git diff 
--check before git format-patch to remove whitespace errors. Thanks!

Regards,
Vijay

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
Sent: Friday, August 03, 2012 11:30 AM
To: [email protected]
Subject: Patch: cloud-install-sys-tmplt

Not only does the original suffer from re-computing the same value over and 
over despite 'tmpfile' having been defined. This makes a maintenance headache.

Worse, downloading files into /usr/lib* is VERBOTEN!! Options like 
/var/{tmp,lib} are at least proper but it makes vastly more sense to put the 
downloads in the TLD of the path we're installing to.

Even better would be a command line argument to specify the tmpfile location.

--- cloud-install-sys-tmplt.orig        2012-08-03 13:26:44.568709050 -0400
+++ cloud-install-sys-tmplt     2012-08-03 14:07:11.333716996 -0400
@@ -161,20 +161,20 @@
   failed 5
 fi

-tmpfile=$(dirname $0)/$localfile
+tmpfile=$mntpoint/$localfile

 touch $tmpfile
 if [ $? -ne 0 ]
 then
-  printf "Failed to create temporary file in directory $(dirname $0) -- is it 
read-only or full?\n"
+  printf "Failed to create temporary file in directory $(dirname
$tmpfile) -- is it read-only or full?\n"
   failed 4
 fi

 destcap=$(df -P $destdir | awk '{print $4}' | tail -1 )  [ $destcap -lt 
$DISKSPACE ] && echo "Insufficient free disk space for target folder $destdir: 
avail=${destcap}k req=${DISKSPACE}k" && failed 4

-localcap=$(df -P $(dirname $0) | awk '{print $4}' | tail -1 ) -[ $localcap -lt 
$DISKSPACE ] && echo "Insufficient free disk space for local temporary folder 
$(dirname $0): avail=${localcap}k req=${DISKSPACE}k" && failed 4
+localcap=$(df -P $(dirname $tmpfile) | awk '{print $4}' | tail -1 ) [ 
+$localcap -lt $DISKSPACE ] && echo "Insufficient free disk space for
local temporary folder $(dirname $tmpfile): avail=${localcap}k 
req=${DISKSPACE}k" && failed 4

 if [ "$uflag" == "1" ]
 then
@@ -192,7 +192,7 @@
   cp $tmpltimg $tmpfile
   if [ $? -ne 0 ]
   then
-    printf "Failed to create temporary file in directory $(dirname $0) --
is it read-only or full?\n"
+    printf "Failed to create temporary file in directory $(dirname
$tmpfile) -- is it read-only or full?\n"
     failed 6
   fi
 fi


Reply via email to