etc-update: tweak style in do_distconf()
authorAnthony Basile <blueness@gentoo.org>
Tue, 14 Dec 2010 01:35:57 +0000 (20:35 -0500)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Dec 2010 03:32:49 +0000 (19:32 -0800)
bin/etc-update

index 3e7bd4f724073f3fc550eb25f85b3ac77a8d7399..d3b988ab6608e9cfc7612307a8a62d971dd726a6 100755 (executable)
@@ -454,29 +454,21 @@ do_distconf() {
        local file="${1}"
        local ofile="${2}"
        local -i count
-       local -i size
        local -i fill
-       local -i f
        local suffix
        local efile
 
-       count=0
-       while true ; do
-               size=${#count}
-               fill=$((4-$size))
+       for ((count = 0; count <= 9999; count++)); do
                suffix=".dist_"
-               while [ $fill -gt 0 ] ; do
-                       ((fill--))
+               for ((fill = 4 - ${#count}; fill > 0; fill--)); do
                        suffix+="0"
                done
                suffix+="${count}"
                efile="${ofile}${suffix}"
                if [[ ! -f ${efile} ]]; then
-                       echo ${efile}
                        mv ${mv_opts} ${file} ${efile}
                        break
                fi
-               ((count++))
        done
 }