prepstrip: skip redundant build ID ln -s calls
authorAlphat-PC <AlphatPC@gmail.com>
Thu, 14 Mar 2013 03:29:23 +0000 (20:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 14 Mar 2013 03:29:23 +0000 (20:29 -0700)
bin/ebuild-helpers/prepstrip

index 38faaef3eccd02de95cbfd85f0c406d4e7f5a421..eda2212667243f1f14c4f400f6a0626c5fd2b923 100755 (executable)
@@ -165,8 +165,8 @@ save_elf_debug() {
                local buildid_dir="${ED}usr/lib/debug/.build-id/${buildid:0:2}"
                local buildid_file="${buildid_dir}/${buildid:2}"
                mkdir -p "${buildid_dir}"
-               ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
-               ln -s "/${x:${#D}}" "${buildid_file}"
+               [ -L "${buildid_file}".debug ] || ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
+               [ -L "${buildid_file}" ] || ln -s "/${x:${#D}}" "${buildid_file}"
        fi
 }