summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Basile <blueness@gentoo.org>2010-12-13 20:35:57 -0500
committerZac Medico <zmedico@gentoo.org>2010-12-13 19:32:49 -0800
commit7081c7240a2cd234eac545279b294efa48ef4878 (patch)
tree31e7f62a18254798edc94f0dabcf40c80a22813d
parent46cf3e08bc2312414fa482b8674df5ede52cbe91 (diff)
downloadportage-7081c7240a2cd234eac545279b294efa48ef4878.tar.gz
portage-7081c7240a2cd234eac545279b294efa48ef4878.tar.bz2
portage-7081c7240a2cd234eac545279b294efa48ef4878.zip
etc-update: tweak style in do_distconf()
-rwxr-xr-xbin/etc-update12
1 files changed, 2 insertions, 10 deletions
diff --git a/bin/etc-update b/bin/etc-update
index 3e7bd4f72..d3b988ab6 100755
--- a/bin/etc-update
+++ b/bin/etc-update
@@ -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
}