Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: tools/mirror-dev.sh

Issue 890613005: Land Ben's 32-bit symlink script. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/mirror-dev.sh
diff --git a/tools/mirror-dev.sh b/tools/mirror-dev.sh
new file mode 100755
index 0000000000000000000000000000000000000000..0512a78ea35b9b713447b1047436006bd3a64deb
--- /dev/null
+++ b/tools/mirror-dev.sh
@@ -0,0 +1,34 @@
+ # For each installed *-dev package DEV
+ for DEV in $(dpkg --list | grep '^ii [^ ]' | cut -d ' ' -f 3 | grep '\-dev$')
+ do
+ # For each multi-arch *.so SO installed by DEV
+ for DEV_64_SO in $(dpkg -L $DEV | grep '/lib/x86_64-linux-gnu/.*\.so$')
+ do
+ # Skip if DEV_64_SO is not a symlink
+ if ! test -L $DEV_64_SO
+ then
+ echo "$DEV installed $DEV_64_SO which is real."
+ continue
+ fi
+
+ DEV_64_TARGET=$(readlink $DEV_64_SO)
+ DEV_64_TARGET_FULL=$(readlink -f $DEV_64_SO)
+
+ DEV_32_SO=$(echo $DEV_64_SO | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@')
+ DEV_32_TARGET=$(echo $DEV_64_TARGET | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@')
+ DEV_32_TARGET_FULL=$(echo $DEV_64_TARGET_FULL | sed -e 's@/lib/x86_64-linux-gnu/@/lib/i386-linux-gnu/@')
+
+ # Error if DEV_32_TARGET does not exist.
+ if ! test -e $DEV_32_TARGET_FULL
+ then
+ DEV_64_TARGET_PKG=$(dpkg -S $DEV_64_TARGET_FULL | cut -d ':' -f 1)
+ echo "Could not find $DEV_32_TARGET_FULL, probably provided by $DEV_64_TARGET_PKG:i386."
+ #echo " $DEV_64_SO -> $DEV_64_TARGET ($DEV_64_TARGET_FULL)"
+ #echo " $DEV_32_SO -> $DEV_32_TARGET ($DEV_32_TARGET_FULL)"
+ continue
+ fi
+
+ # Create DEV_32_SO
+ sudo ln -s $DEV_32_TARGET $DEV_32_SO
+ done
+ done
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698