etc-update: eliminate duplicate example configs
authorZac Medico <zmedico@gentoo.org>
Tue, 14 Dec 2010 04:29:10 +0000 (20:29 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Dec 2010 14:28:31 +0000 (06:28 -0800)
bin/etc-update

index d3b988ab6608e9cfc7612307a8a62d971dd726a6..e64ef493bfc8be0356684c0202919a86b41b2930 100755 (executable)
@@ -466,7 +466,11 @@ do_distconf() {
                suffix+="${count}"
                efile="${ofile}${suffix}"
                if [[ ! -f ${efile} ]]; then
-                       mv ${mv_opts} ${file} ${efile}
+                       mv ${mv_opts} "${file}" "${efile}"
+                       break
+               elif diff_command "${file}" "${efile}" &> /dev/null; then
+                       # replace identical copy
+                       mv "${file}" "${efile}"
                        break
                fi
        done