summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-05-03 04:13:39 +0000
committerZac Medico <zmedico@gentoo.org>2008-05-03 04:13:39 +0000
commit832715c7ba9b2f379915d551b5cf1d43163352bc (patch)
tree0408a41946fc07466a3128a2667c9ccfea54af16
parent72b729a3672de9b6c9a57055188b0f98c48ce5bf (diff)
downloadportage-832715c7ba9b2f379915d551b5cf1d43163352bc.tar.gz
portage-832715c7ba9b2f379915d551b5cf1d43163352bc.tar.bz2
portage-832715c7ba9b2f379915d551b5cf1d43163352bc.zip
Buf #219294 - Fix 'date' and 'cut' arguments for BSD userland. Thanks to
RB <aoz.syn@gmail.com> for this patch. svn path=/main/trunk/; revision=10126
-rwxr-xr-xbin/emerge-webrsync8
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync
index 24733840b..b97735909 100755
--- a/bin/emerge-webrsync
+++ b/bin/emerge-webrsync
@@ -91,7 +91,11 @@ get_date_part() {
get_utc_second_from_string() {
local s="$1"
- date -d "${s:0:4}-${s:4:2}-${s:6:2}" -u +"%s"
+ if [[ ${USERLAND} == BSD ]] ; then
+ date -juf "%Y%m%d" "$s" +"%s"
+ else
+ date -d "${s:0:4}-${s:4:2}-${s:6:2}" -u +"%s"
+ fi
}
get_portage_timestamp() {
@@ -133,7 +137,7 @@ check_file_digest() {
if type -P md5sum > /dev/null; then
md5sum -c $digest && r=0
elif type -P md5 > /dev/null; then
- [ "$(md5 -q $file)" == "$(cut -d \ -f 1 \"$digest\")" ] && r=0
+ [ "$(md5 -q "${file}")" == "$(cut -d ' ' -f 1 "${digest}")" ] && r=0
else
eecho "cannot check digest: no suitable md5/md5sum binaries found"
fi