only use dummy echos in do_file() when running in interactive mode
authorMike Frysinger <vapier@gentoo.org>
Fri, 10 Oct 2008 22:02:15 +0000 (22:02 -0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 10 Oct 2008 22:02:15 +0000 (22:02 -0000)
svn path=/main/trunk/; revision=11673

bin/etc-update

index ff1378f6307845a3da9729802735a9d1e8afb99a..cb58d13f1fdaa206b43df4f39730aaf47fe9adae 100755 (executable)
@@ -227,7 +227,8 @@ read_int() {
 }
 
 do_file() {
-       echo
+       interactive_echo() { [ "${OVERWRITE_ALL}" != "yes" ] && [ "${DELETE_ALL}" != "yes" ] && echo; }
+       interactive_echo
        local -i my_input
        local -i fcount=0
        until (( $(wc -l < ${TMP}/files/${input}) < 2 )); do
@@ -296,7 +297,7 @@ do_file() {
                        break
                fi
        done
-       echo
+       interactive_echo
        rm ${TMP}/files/${input}
        count=${count}-1
 }