aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Robert S. Gerus <arachnist@gmail.com> 2006-05-25 08:32:19 +0000
committerAvatar Robert S. Gerus <arachnist@gmail.com> 2006-05-25 08:32:19 +0000
commit5f1044701431a13f8c24f7394e2a61b5ac5d8eeb (patch)
tree06b853eca5c5bfeb47e31b369690677974d66b7b
parent7ee339a9dd77837960754bb9e058187783978fb7 (diff)
downloadpaludis-5f1044701431a13f8c24f7394e2a61b5ac5d8eeb.tar.gz
paludis-5f1044701431a13f8c24f7394e2a61b5ac5d8eeb.tar.xz
Add a wrapper that will call stat -f '%m' on FreeBSD and stat -c '%Y' everywhere else. Fix 2 typos in previous ChangeLog entry.
-rwxr-xr-xebuild/utils/getmtime5
-rwxr-xr-xebuild/utils/merge4
-rwxr-xr-xebuild/utils/unmerge6
-rwxr-xr-xhooks/gnu_info_index.bash4
4 files changed, 12 insertions, 7 deletions
diff --git a/ebuild/utils/getmtime b/ebuild/utils/getmtime
new file mode 100755
index 0000000..81a78e4
--- /dev/null
+++ b/ebuild/utils/getmtime
@@ -0,0 +1,5 @@
+#!/bin/bash
+case $(uname -s) in
+ FreeBSD) stat -f '%m' $@ ;;
+ *) stat -c '%Y' $@ ;;
+esac
diff --git a/ebuild/utils/merge b/ebuild/utils/merge
index 91052dc..794af15 100755
--- a/ebuild/utils/merge
+++ b/ebuild/utils/merge
@@ -99,7 +99,7 @@ merge_this()
else
echo -n "sym ${2#${top_dst}}/${ff} -> " >> ${contents}
echo -n "$(readlink -- ${2}/${ff} ) " >> ${contents}
- echo -n "$(stat -c '%Y' -- ${2}/${ff} )" >> ${contents}
+ echo -n "$(getmtime -- ${2}/${ff} )" >> ${contents}
echo >> ${contents}
fi
hash -r
@@ -150,7 +150,7 @@ merge_this()
if [[ -f "${fn}" ]] ; then
echo -n "obj ${2#${top_dst}}/${ff} " >> ${contents}
echo -n "$(md5sum -- ${2}/${ff} | cut -d' ' -f1 ) " >> ${contents}
- echo -n "$(stat -c '%Y' -- ${2}/${ff} )" >> ${contents}
+ echo -n "$(getmtime -- ${2}/${ff} )" >> ${contents}
echo >> ${contents}
else
echo "misc ${2#${top_dst}}/${ff}" >> ${contents}
diff --git a/ebuild/utils/unmerge b/ebuild/utils/unmerge
index 572adfc..f829834 100755
--- a/ebuild/utils/unmerge
+++ b/ebuild/utils/unmerge
@@ -54,7 +54,7 @@ while read entry ; do
echo "skip !type ${items[1]}"
elif [[ $(readlink -- "${ROOT}/${items[1]}" ) != "${items[3]}" ]] ; then
echo "skip !dest ${items[1]}"
- elif [[ $(stat -c '%Y' -- "${ROOT}/${items[1]}" ) != "${items[4]}" ]] ; then
+ elif [[ $(getmtime -- "${ROOT}/${items[1]}" ) != "${items[4]}" ]] ; then
echo "skip !time ${items[1]}"
else
echo "remove ${items[1]}"
@@ -67,7 +67,7 @@ while read entry ; do
echo "skip !type ${items[1]}"
elif [[ $(md5sum -- "${ROOT}/${items[1]}" | cut -d' ' -f1 ) != "${items[2]}" ]] ; then
echo "skip !md5 ${items[1]}"
- elif [[ $(stat -c '%Y' -- "${ROOT}/${items[1]}" ) != "${items[3]}" ]] ; then
+ elif [[ $(getmtime -- "${ROOT}/${items[1]}" ) != "${items[3]}" ]] ; then
echo "skip !time ${items[1]}"
else
cfgpro=
@@ -93,7 +93,7 @@ while read entry ; do
misc)
if [[ -f "${ROOT}/${items[1]}" ]] ; then
echo "skip !type ${items[1]}"
- elif [[ $(stat -c '%Y' -- "${ROOT}/${items[1]}" ) != "${items[2]}" ]] ; then
+ elif [[ $(getmtime -- "${ROOT}/${items[1]}" ) != "${items[2]}" ]] ; then
echo "skip !time ${items[1]}"
else
echo "remove ${items[1]}"
diff --git a/hooks/gnu_info_index.bash b/hooks/gnu_info_index.bash
index fa1f87a..e391a55 100755
--- a/hooks/gnu_info_index.bash
+++ b/hooks/gnu_info_index.bash
@@ -26,10 +26,10 @@ regen_info_dirs=
for info_path in ${INFOPATH/:/ } ; do
info_path="${ROOT%/}/${info_path}"
[[ -d "${info_path}" ]] || continue
- info_time=$(stat -c '%Y' "${info_path}" )
+ info_time=$(getmtime "${info_path}" )
if [[ -f "${ROOT}/var/db/pkg/.cache/info_time_cache" ]] ; then
- info_time_cache=$(stat -c '%Y' "${ROOT}"/var/db/pkg/.cache/info_time_cache )
+ info_time_cache=$(getmtime "${ROOT}"/var/db/pkg/.cache/info_time_cache )
[[ "${info_time}" -le "${info_time_cache}" ]] && continue
fi