summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Griffin <aaronmgriffin@gmail.com>2007-11-28 15:09:56 -0600
committerAaron Griffin <aaronmgriffin@gmail.com>2007-11-28 21:00:07 -0600
commite77986fc084255a5fae45bc0542b4d0b9bd01fb5 (patch)
tree11fbc0f06dbf9cd13200611a7578c3506df9bf41
parentf7ab112f9a8acfd8482c9aab4b0c1790df5d395a (diff)
downloaddevtools-e77986fc084255a5fae45bc0542b4d0b9bd01fb5.tar.xz
Add lddd script from cvs-arch
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
-rw-r--r--Makefile3
-rwxr-xr-xlddd45
2 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index fa4b64f..cda6bff 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,8 @@ install:
mkdir -p $(DESTDIR)/usr/sbin
install -m 755 mkarchroot $(DESTDIR)/usr/sbin
install -m 755 makechrootpkg $(DESTDIR)/usr/sbin
+ #Additional packaging helper scripts
+ install -m 755 lddd $(DESTDIR)/usr/bin
uninstall:
# remove all files we installed
@@ -22,3 +24,4 @@ uninstall:
rm $(DESTDIR)/usr/bin/unstablepkg
rm $(DESTDIR)/usr/sbin/mkarchroot
rm $(DESTDIR)/usr/sbin/makechrootpkg
+ rm $(DESTDIR)/usr/bin/lddd
diff --git a/lddd b/lddd
new file mode 100755
index 0000000..f436921
--- /dev/null
+++ b/lddd
@@ -0,0 +1,45 @@
+#!/bin/sh
+# 2004/08/22 K. Piche Find missing library references.
+# modified by Tobias Powalowski <tpowa@archlinux.org>
+ifs=$IFS
+IFS=':'
+
+libdirs="/lib:/usr/lib:/opt/qt/lib:/opt/kde/lib:/usr/lib/libfakeroot:/opt/NX/lib"
+extras=
+
+TEMPDIR=$(mktemp /tmp/lddd-script.XXXX)
+rm $TEMPDIR
+mkdir -p $TEMPDIR
+
+echo " Go out drink some tea, this will take a while :) ..."
+# Check ELF binaries in the PATH and specified dir trees.
+for tree in $PATH $libdirs $extras
+do
+ echo DIR $tree
+
+ # Get list of files in tree.
+ files=$(find $tree -type f ! -name '*.a' ! -name '*.la' ! -name '*.py*' ! -name '*.txt' ! -name '*.h' ! -name '*.ttf' ! -name '*.rb' ! -name '*.ko' ! -name '*.pc' ! -name '*.enc' ! -name '*.cf' ! -name '*.def' ! -name '*.rules' ! -name '*.cmi' ! -name '*.mli' ! -name '*.ml' ! -name '*.cma' ! -name '*.cmx' ! -name '*.cmxa' ! -name '*.pod' ! -name '*.pm' ! -name '*.pl' ! -name '*.al' ! -name '*.tcl' ! -name '*.bs' ! -name '*.o' ! -name '*.png' ! -name '*.gif' ! -name '*.cmo' ! -name '*.cgi' ! -name '*.defs' ! -name '*.conf' ! -name '*_LOCALE' ! -name 'Compose' ! -name '*_OBJS' ! -name '*.msg' ! -name '*.mcopclass' ! -name '*.mcoptype')
+ IFS=$ifs
+ for i in $files
+ do
+ if [ `file $i | grep -c 'ELF'` -ne 0 ]; then
+ # Is an ELF binary.
+ if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 0 ]; then
+ # Missing lib.
+ echo "$i:" >> $TEMPDIR/raw.txt
+ ldd $i 2>/dev/null | grep 'not found' >> $TEMPDIR/raw.txt
+ fi
+ fi
+ done
+done
+grep '^/' $TEMPDIR/raw.txt | sed -e 's/://g' >> $TEMPDIR/affected-files.txt
+# invoke pacman
+for i in $(cat $TEMPDIR/affected-files.txt); do
+ pacman -Qo $i | awk '{print $4,$5}' >> $TEMPDIR/pacman.txt
+done
+# clean list
+sort -u $TEMPDIR/pacman.txt >> $TEMPDIR/possible-rebuilds.txt
+
+echo "Files saved to $TEMPDIR"
+
+exit