OpenSDE/package-nopast — Issue #1: Broken symlink created by legacy code in gcc.conf
Author: karasz
Created: 2012-01-07 16:03:43+00:00
State: open

See the code in question here:
https://github.com/OpenSDE/package-nopast/blob/master/base/gcc/gcc.conf#L274
the code results in a symlink like `./*.so.* -> gcc/x86_64-unknown-linux-gnu/4.6.2/*.so.*`
[Mnemoc] (https://github.com/amery) proposed the following fix:

```diff
diff --git a/base/gcc/gcc.conf b/base/gcc/gcc.conf
index a8e1bd4..e6705df 100644
--- a/base/gcc/gcc.conf
+++ b/base/gcc/gcc.conf
@@ -271,13 +271,19 @@ gcc_postmake()
# the dynamic loader and force rebuilding of the wrapper links
#
if atstage native; then
-	( cd $root/$libdir ; ln -sfv ${gcc_lib_dir}/*.so.* . )
+	for x in $root/$libdir/${gcc_lib_dir}/*.so.*; do
+	[ -f "$x" ] || continue
+	x=${x##*/}
+	ln -sfv ${gcc_lib_dir}/$x $root/$libdir/
+	done

-	# multilib w/ 32bit - we do just check for the output dir ...
-	[ -e $root/$libdir/${gcc_lib_dir}/32 ] && (
-	cd $root/$libdir/../lib/
-	ln -sfv ../lib64/${gcc_lib_dir}/32/*.so.* .
-	)
+	# multilib w/ 32bit
+	# mnemoc: this smells obsolete (2012-01-07)
+	for x in $root/$libdir/${gcc_lib_dir}/32/*.so.*; do
+	[ -f "$x" ] || continue
+	x=${x##*/}
+	ln -sfv ../lib64/${gcc_lib_dir}/32/$x $root/$libdir/../lib/
+	done
fi
true
}

```