Package: di-netboot-assistant
Version: 0.36
Severity: wishlist
Tags: patch

Please output "I: Foo" messages to STDOUT, not STDERR.

This change (combined with #493418 - "Please display failed URL without
requiring --verbose") would mean that di-netboot-assistant is much more
usable via cronjob: redirecting STDOUT to /dev/null means the system
administrator is alerted only when a problem occurs.

Patch attached. 


Regards,

-- 
Chris Lamb, UK                                       [EMAIL PROTECTED]
                                                            GPG: 0x634F9A20
diff -urNad di-netboot-assistant-0.36.orig/usr/bin/di-netboot-assistant 
di-netboot-assistant-0.36/usr/bin/di-netboot-assistant
--- di-netboot-assistant-0.36.orig/usr/bin/di-netboot-assistant 2008-08-02 
18:35:24.000000000 +0100
+++ di-netboot-assistant-0.36/usr/bin/di-netboot-assistant      2008-08-02 
18:36:19.000000000 +0100
@@ -183,7 +183,7 @@
 
        if [ ! -d "$TFTP_ROOT" ]; then
                echo "E: TFTP root directory doesn't exists ($TFTP_ROOT)" 1>&2
-               echo "I: Make sure you installed a tftp server like tftpd-hpa 
or atftpd." 1>&2
+               echo "I: Make sure you installed a tftp server like tftpd-hpa 
or atftpd."
                echo "" 1>&2
                exit 1;
        fi
@@ -250,7 +250,7 @@
                        purge_repo 
"/var/lib/di-netboot-assistant/$del_repo--$a.conf"
                else
                        echo "E: Repository '$del_repo' for architecture '$a' 
doesn't exists." 1>&2
-                       echo "I: (current repository are: $current_repos)" 1>&2
+                       echo "I: (current repository are: $current_repos)"
                        echo "" 1>&2
                        exit 1
                fi
@@ -297,7 +297,7 @@
                                [ "$WGET_VERBOSITY" != "--quiet" ] && echo "E: 
Can't download '$release' for '$arch' ($url)." 1>&2
                                [ -f "$file.tmp" ] && rm $RM_VERBOSITY 
"$file.tmp"
                                if [ -f "$file" ]; then
-                                       echo "I: You have a previous version in 
your cache (see --offline option)." 1>&2
+                                       echo "I: You have a previous version in 
your cache (see --offline option)."
                                fi
                        fi
                else
@@ -308,7 +308,7 @@
                                echo "" 1>&2
                                exit 1
                        else
-                               echo "I: Reusing previously downloaded file... 
" 1>&2
+                               echo "I: Reusing previously downloaded file... "
                                fetch_date="$( grep "fetch_date" $metadatafile 
| cut -d "=" -f 2- )"
                        fi
                fi
@@ -338,12 +338,12 @@
                done
                [ "$SUCCEED" = "true" ] && echo "... done." 1>&2
        else
-               [ ! "$OFFLINE" ] && echo "I: No checksum fount." 1>&2
+               [ ! "$OFFLINE" ] && echo "I: No checksum fount."
        fi      
 
 
        if [ ! "$OFFLINE" ]; then
-               echo "I: Moving/Removing temporary files." 1>&2         
+               echo "I: Moving/Removing temporary files."
                for givenfile in $EXTRA_DL_FILES $files ; do
                        f=$(echo $givenfile | sed -e 's#^\./##' -e 's#^/##' -e 
's#//#/#g')
                        file="${DL_CACHE}/$(echo ${repo_loc}/$f | sed -e 
's#/#_#g')"
@@ -375,7 +375,7 @@
 
        if ! grep -Eq "^$release\>" "$DISOURCELIST" ; then
                echo "E: Invalid repository name specified ($release)" 1>&2
-               echo "I: Declared repositories are: $releases" 1>&2
+               echo "I: Declared repositories are: $releases"
                echo "" 1>&2
                exit 1
        fi
@@ -438,7 +438,7 @@
                echo "repo=$repo" >> $metadatafile
                echo "dl_file=$dl_file" >> $metadatafile
        
-               echo "I: Extracting... " 1>&2
+               echo "I: Extracting... "
                        
                if [ -d "$expand_dir" ]; then
                        rm -Rf "$expand_dir/*"
@@ -654,8 +654,8 @@
     *)
         if [ $COUNT -eq 0 ]; then
                echo "E: No repository name was passed for '$ACTION'." 1>&2
-               [ ! "$OFFLINE" -a "$ACTION" = "install" ] && echo "I: Declared 
repositories are: $releases" 1>&2
-               [ "$ACTION" = "purge" ] && echo "I: Installed repositories are: 
$( cd /var/lib/di-netboot-assistant/ ; ls | sed -e 's/--.*//' | sort -u | tr 
"\n" " " )" 1>&2
+               [ ! "$OFFLINE" -a "$ACTION" = "install" ] && echo "I: Declared 
repositories are: $releases"
+               [ "$ACTION" = "purge" ] && echo "I: Installed repositories are: 
$( cd /var/lib/di-netboot-assistant/ ; ls | sed -e 's/--.*//' | sort -u | tr 
"\n" " " )"
                echo "" 1>&2
                exit 1
         fi

Attachment: signature.asc
Description: PGP signature

Reply via email to