[sending again now that I am subscribed to the autotest list]

On Tue, Feb 14, 2012 at 11:21:43AM -0200, Lucas Meneghel Rodrigues wrote:
> The nice folks from the libvirt (http://libvirt.org/) team
> started writing a script to install the autotest server
> in Fedora 16. I've re-worked the script to fix some mistakes,
> and added some other functionality to it, and the end
> result is a fine script to get the autotest server
> installed on a Fedora 16 host.
> 
> We can refactor the code to make it work with more
> distros, but we feel it's wasteful to keep it to ourselves,
> when we can share it with the greater public, even
> if it's not suited for other distros.
> 
> Signed-off-by: Daniel Veillard <[email protected]>
> Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
> ---
>  contrib/install-autotest-server-f16.sh |  309 
> ++++++++++++++++++++++++++++++++

  Hi Lucas,

may I just suggest to remove the -f16 on the file name, and to
squash in the following patch to avoid problem on long partition names
(like lvm ones) and also avoid a basename problem :-)

 thanks !

Daniel

Signed-off-by: Daniel Veillard <[email protected]>

diff --git a/install-autotest-server b/install-autotest-server
index 19c1507..35accd8 100644
--- a/install-autotest-server
+++ b/install-autotest-server
@@ -2,7 +2,7 @@
 
 ATHOME=/usr/local/autotest
 DATETIMESTAMP=$(date "+%m-%d-%Y-%H-%M-%S")
-BASENAME=$(echo $0 | cut -f1 -d '.')
+BASENAME=$(echo `basename $0` | cut -f1 -d '.')
 LOG="/tmp/$BASENAME-$DATETIMESTAMP.log"
 
 print_log() {
@@ -54,11 +54,11 @@ print_log "INFO" "Installing the Autotest server"
 print_log "INFO" "A log of operation is kept in $LOG"
 print_log "INFO" "Install started at: $(date)"
 
-LOCALFREE=$(df -k /usr/local | awk '{ print $4 }' | grep -v Avai)
-VARFREE=$(df -k /var | awk '{ print $4 }' | grep -v Avai)
+LOCALFREE=$(df -kP /usr/local | awk '{ print $4 }' | grep -v Avai)
+VARFREE=$(df -kP /var | awk '{ print $4 }' | grep -v Avai)
 
-LOCALFREE_HUMAN=$(df -H /usr/local | awk '{ print $4 }' | grep -v Avai)
-VARFREE_HUMAN=$(df -H /var | awk '{ print $4 }' | grep -v Avai)
+LOCALFREE_HUMAN=$(df -HP /usr/local | awk '{ print $4 }' | grep -v Avai)
+VARFREE_HUMAN=$(df -HP /var | awk '{ print $4 }' | grep -v Avai)
 
 print_log "INFO" "/usr/local free $LOCALFREE_HUMAN"
 print_log "INFO" "/var free $VARFREE_HUMAN"


-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
[email protected]  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to