From 46c4def0733a78ce08702d188e3e1a141fb07316 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 29 Aug 2011 10:53:50 +0200 Subject: Support non-standard install locations This build system overhaul allows for adding (define-style) macros to our scripts. All source files are now suffixed with ".in" to clarify that they might contain unprocessed defines. The Makefile provides a new rule to preprocess source files and generate proper output scripts. Also, add a "@pkgdatadir@" define (as used in GNU Autotools) and use it instead of hardcoded paths to "/usr/share/devtools" everywhere. We missed this when adding PREFIX support to the build system in commit 35fc83ce7d8dc26cd424321f2e8638d05da0a6d4. Signed-off-by: Lukas Fleischer --- lddd.in | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 lddd.in (limited to 'lddd.in') diff --git a/lddd.in b/lddd.in new file mode 100644 index 0000000..9695c9b --- /dev/null +++ b/lddd.in @@ -0,0 +1,46 @@ +#!/bin/sh +# +# lddd - find broken library links on your machine +# + +ifs=$IFS +IFS="${IFS}:" + +libdirs="/lib /usr/lib /usr/local/lib $(cat /etc/ld.so.conf.d/*)" +extras= + +TEMPDIR=$(mktemp -d /tmp/lddd-script.XXXX) + +echo 'Go out and 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" -- cgit v1.2.3-54-g00ecf From a0c6bf4556e211037b9d9d6de3fd17f798a3c1fb Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 13 Oct 2011 11:03:35 +0200 Subject: Honor TMPDIR environment variable Replace all mktemp(1) invocations that hardcode "/tmp" with `mktemp --tmpdir` and change templates accordingly. Note that "--tmpdir" is GNU-ish which is okay given that we currently support Arch Linux only anyway. Signed-off-by: Lukas Fleischer --- checkpkg.in | 2 +- lddd.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lddd.in') diff --git a/checkpkg.in b/checkpkg.in index 94a7529..cde3dc2 100644 --- a/checkpkg.in +++ b/checkpkg.in @@ -24,7 +24,7 @@ if [[ $arch == 'any' ]]; then fi STARTDIR=$(pwd) -TEMPDIR=$(mktemp -d /tmp/checkpkg-script.XXXX) +TEMPDIR=$(mktemp -d --tmpdir checkpkg-script.XXXX) cd "$TEMPDIR" for _pkgname in "${pkgname[@]}"; do diff --git a/lddd.in b/lddd.in index 9695c9b..c011674 100644 --- a/lddd.in +++ b/lddd.in @@ -9,7 +9,7 @@ IFS="${IFS}:" libdirs="/lib /usr/lib /usr/local/lib $(cat /etc/ld.so.conf.d/*)" extras= -TEMPDIR=$(mktemp -d /tmp/lddd-script.XXXX) +TEMPDIR=$(mktemp -d --tmpdir lddd-script.XXXX) echo 'Go out and drink some tea, this will take a while :) ...' # Check ELF binaries in the PATH and specified dir trees. -- cgit v1.2.3-54-g00ecf