summaryrefslogtreecommitdiff
path: root/trunk
diff options
context:
space:
mode:
authorfuzzyray <fuzzyray@gentoo.org>2005-08-13 04:48:51 +0000
committerfuzzyray <fuzzyray@gentoo.org>2005-08-13 04:48:51 +0000
commit5b08fb0a0f9834d4bab3dbd2340394220acd956f (patch)
tree100aa36de67550d55be1335f7dc422750860f685 /trunk
parent8663f9fa971ef0d78b8f908654730580a1e3b8c4 (diff)
downloadgentoolkit-5b08fb0a0f9834d4bab3dbd2340394220acd956f.tar.gz
Added g/fbsd support patch from Bug #102255
svn path=/; revision=227
Diffstat (limited to 'trunk')
-rwxr-xr-xtrunk/src/revdep-rebuild/revdep-rebuild11
1 files changed, 9 insertions, 2 deletions
diff --git a/trunk/src/revdep-rebuild/revdep-rebuild b/trunk/src/revdep-rebuild/revdep-rebuild
index b41fffb..c67fb87 100755
--- a/trunk/src/revdep-rebuild/revdep-rebuild
+++ b/trunk/src/revdep-rebuild/revdep-rebuild
@@ -256,13 +256,20 @@ else
WORKING_TEXT=""
fi
+# check if it's GNU's stat or BSD's stat...
+if stat 2>&1 | grep coreutils; then
+ STAT="stat -c %Y "
+else
+ STAT="stat -f %m "
+fi
+
# If our temporary files are older than 1 day, don't use them
TOO_OLD=$((`date +%s` - 86400))
for file in ${LIST}*
do
if [ -f $file ]
then
- FILE_AGE="$(stat -c %Y $file)"
+ FILE_AGE="$(${STAT} $file)"
if [ $FILE_AGE -lt $TOO_OLD ]
then
rm -f ${LIST}*
@@ -369,7 +376,7 @@ else
if LD_LIBRARY_PATH="$COMPLETE_LD_LIBRARY_PATH" ldd "$FILE" 2>/dev/null | grep -v "$LD_MASK" | $SONAME_GREP -q "$SONAME_SEARCH" ; then
# FIX: I hate duplicating code
# Only build missing direct dependencies
- ALL_MISSING_LIBS=$(ldd "$FILE" 2>/dev/null | sort -u | sed -n 's/ \(.*\) => not found$/\1/p' | tr '\n' ' ' | sed 's/ $//' )
+ ALL_MISSING_LIBS=$(ldd "$FILE" 2>/dev/null | sort -u | sed -n 's/ \(.*\) => not found/\1/p' | tr '\n' ' ' | sed 's/ $//' )
REQUIRED_LIBS=$(objdump -x $FILE | grep NEEDED | awk '{print $2}' | tr '\n' ' ' | sed 's/ $//')
MISSING_LIBS=""
for lib in $ALL_MISSING_LIBS