Bug#493426: Please output status messages to STDOUT, not STDERR

2008-08-06 Thread Franklin PIAT
Hello,

Chris Lamb wrote :
 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.

This won't be fixed in Lenny. As a workaround, one can filter the
output, with something like :

di-netboot-assistant install daily 21 1/dev/null | grep -E ^E:

Franklin




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#493426: Please output status messages to STDOUT, not STDERR

2008-08-02 Thread Chris Lamb
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.0 +0100
+++ di-netboot-assistant-0.36/usr/bin/di-netboot-assistant  2008-08-02 
18:36:19.0 +0100
@@ -183,7 +183,7 @@
 
if [ ! -d $TFTP_ROOT ]; then
echo E: TFTP root directory doesn't exists ($TFTP_ROOT) 12
-   echo I: Make sure you installed a tftp server like tftpd-hpa 
or atftpd. 12
+   echo I: Make sure you installed a tftp server like tftpd-hpa 
or atftpd.
echo  12
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. 12
-   echo I: (current repository are: $current_repos) 12
+   echo I: (current repository are: $current_repos)
echo  12
exit 1
fi
@@ -297,7 +297,7 @@
[ $WGET_VERBOSITY != --quiet ]  echo E: 
Can't download '$release' for '$arch' ($url). 12
[ -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). 12
+   echo I: You have a previous version in 
your cache (see --offline option).
fi
fi
else
@@ -308,7 +308,7 @@
echo  12
exit 1
else
-   echo I: Reusing previously downloaded file... 
 12
+   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. 12
else
-   [ ! $OFFLINE ]  echo I: No checksum fount. 12
+   [ ! $OFFLINE ]  echo I: No checksum fount.
fi  
 
 
if [ ! $OFFLINE ]; then
-   echo I: Moving/Removing temporary files. 12 
+   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) 12
-   echo I: Declared repositories are: $releases 12
+   echo I: Declared repositories are: $releases
echo  12
exit 1
fi
@@ -438,7 +438,7 @@
echo repo=$repo  $metadatafile
echo dl_file=$dl_file  $metadatafile

-   echo I: Extracting...  12
+   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'. 12
-   [ ! $OFFLINE -a $ACTION = install ]  echo I: Declared 
repositories are: $releases 12
-   [ $ACTION = purge ]  echo I: Installed repositories are: 
$( cd /var/lib/di-netboot-assistant/ ; ls | sed -e 's/--.*//' | sort -u | tr 
\n   ) 12
+   [ ! $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  12
exit 1
 fi


signature.asc
Description: PGP signature


Bug#493426: Please output status messages to STDOUT, not STDERR

2008-08-02 Thread Chris Lamb
Hi,

Oops, I did not catch them all in my first patch. Please consider the
attached diff in addition to the first.


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 
19:36:42.0 +0100
+++ di-netboot-assistant-0.36/usr/bin/di-netboot-assistant  2008-08-02 
19:37:34.0 +0100
@@ -90,7 +90,7 @@
 }
 
 list_declared_arch_for_repo() {
-   echo -n I: Declared architecures for $1 are:  12
+   echo -n I: Declared architecures for $1 are: 
grep -E ^$1[[:blank:]] $DISOURCELIST | cut -f 2 | sort -u | tr '\n' 
' ' 12
echo  12
 }
@@ -316,7 +316,7 @@
 
csum=${DL_CACHE}/$(echo ${repo_loc}/MD5SUMS.tmp | sed -e 's#/#_#g')
if [ -f $csum -a $SUCCEED = true ] ; then
-   echo -n I: Computing checksums...  12
+   echo -n I: Computing checksums... 
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')
@@ -324,9 +324,9 @@
if [ $givenfile == MD5SUMS ]; then
continue;
fi
-   echo -n $givenfile  12
+   echo -n $givenfile 
if ! grep -qiE 
[[:blank:]]+(\./|)$givenfile[[:blank:]]*$ $csum ; then
-   echo -n  (No checksum) 12
+   echo -n  (No checksum)
continue;
fi
if ! grep -qiE 
^$md5[[:blank:]]+(\./|)$givenfile[[:blank:]]*$ $csum ; then


signature.asc
Description: PGP signature


Bug#493426: Please output status messages to STDOUT, not STDERR

2008-08-02 Thread Chris Lamb
Hi,

Argh, missed another:

 --- di-netboot-assistant-0.36.orig/usr/bin/di-netboot-assistant
 +++ di-netboot-assistant-0.36/usr/bin/di-netboot-assistant
 @@ -336,7 +336,7 @@
 break;
 fi
 done
 -   [ $SUCCEED = true ]  echo ... done. 12
 +   [ $SUCCEED = true ]  echo ... done.
 else
 [ ! $OFFLINE ]  echo I: No checksum fount. 12
 fi


Regards,

-- 
Chris Lamb, UK   [EMAIL PROTECTED]
GPG: 0x634F9A20


signature.asc
Description: PGP signature