aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-26 17:11:42 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-12-26 17:11:42 +0000
commit20c01151ac11bf6a8a95a42da4756446e486b9df (patch)
tree85efd311634fa8dc84ba7def1b4dfc8650368d92
parente46008c7d3aef667ccfb299f00ffa45163cc602a (diff)
downloadpaludis-20c01151ac11bf6a8a95a42da4756446e486b9df.tar.gz
paludis-20c01151ac11bf6a8a95a42da4756446e486b9df.tar.xz
BSD's stat does file sizes differently. From Timothy Redaelli
-rw-r--r--ebuild/builtin_fetch.bash2
-rw-r--r--ebuild/builtin_fetch_bin.bash2
-rw-r--r--ebuild/utils/Makefile.am1
-rwxr-xr-xebuild/utils/getfsize5
4 files changed, 8 insertions, 2 deletions
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index cf840c1..58454ea 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -26,7 +26,7 @@ builtin_fetch()
local aa=${a##*/}
hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
- if [[ -f "${DISTDIR}/${aa}" ]] && [[ "0" != $(stat -c '%s' "${DISTDIR}/${aa}" ) ]] ; then
+ if [[ -f "${DISTDIR}/${aa}" ]] && [[ "0" != $(getfsize "${DISTDIR}/${aa}") ]] ; then
if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Already have ${aa}"
old_aa="${aa}"
diff --git a/ebuild/builtin_fetch_bin.bash b/ebuild/builtin_fetch_bin.bash
index ccfe687..f6e777e 100644
--- a/ebuild/builtin_fetch_bin.bash
+++ b/ebuild/builtin_fetch_bin.bash
@@ -26,7 +26,7 @@ builtin_fetch_bin()
local aa=${a##*/}
hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
- if [[ -f "${PKGDIR}/${aa}" ]] && [[ "0" != $(stat -c '%s' "${PKGDIR}/${aa}" ) ]] ; then
+ if [[ -f "${PKGDIR}/${aa}" ]] && [[ "0" != $(getfsize "${PKGDIR}/${aa}") ]] ; then
if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Already have ${aa}"
old_aa="${aa}"
diff --git a/ebuild/utils/Makefile.am b/ebuild/utils/Makefile.am
index db9dc7a..c098a09 100644
--- a/ebuild/utils/Makefile.am
+++ b/ebuild/utils/Makefile.am
@@ -33,6 +33,7 @@ libexecprog_SCRIPTS = \
fowners \
fperms \
getmtime \
+ getfsize \
newbin \
newconfd \
newdoc \
diff --git a/ebuild/utils/getfsize b/ebuild/utils/getfsize
new file mode 100755
index 0000000..80edaad
--- /dev/null
+++ b/ebuild/utils/getfsize
@@ -0,0 +1,5 @@
+#!/bin/bash
+case $(uname -s) in
+ FreeBSD) stat -f '%z' $@ ;;
+ *) stat -c '%s' $@ ;;
+esac