From 51d35051718e8ab45861f47273efc6dd92555a5a Mon Sep 17 00:00:00 2001 From: mateor Date: Wed, 24 Oct 2012 13:55:10 -0500 Subject: [PATCH] Attempt to fix BuildQuery for OSX OSX doesn't have 'date -d', turns out. That is why the BDID line was blank for OSX users this whole time. I think this works, my tester didn't respond... --- auto_patcher | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/auto_patcher b/auto_patcher index a419762..8ee7f66 100755 --- a/auto_patcher +++ b/auto_patcher @@ -202,7 +202,7 @@ abspath () { [[ ${1:0:1} == "/" ]] && echo "$1" || echo "$PWD/$1" ;; Linux) - echo $(readlink -f "$1") + echo $(readlink -f "$1") ;; *) if [[ ${1:0:1} == "/" ]]; then @@ -307,6 +307,15 @@ proberom () { # This should set the patch date automatically. buildquery() { +UTC=$(getbuildprop ro.build.date.utc) +case `uname -s` in + [D]darwin) + BDID=`date -r $UTC +%Y%m%d`; + ;; + *) + BDID=`date -d "1970-01-01 UTC $UTC seconds" +"%Y%m%d"`; + ;; +esac if [ $# -gt 3 ]; then BID=${4//,/ }; @@ -323,8 +332,6 @@ else [ -d patches/$P/$A/$R/$BID ] && B=$BID || B=latest PAR=patches/$P/$A/$R PARB=patches/$P/$A/$R/$B - UTC=$(getbuildprop ro.build.date.utc) - BDID=`date -d "1970-01-01 UTC $UTC seconds" +"%Y%m%d"` DATES=`ls patches/$P/$A/$R/ | grep '201*'` # attempt to set builds before extant patches to earliest for i in $DATES; do -- 2.11.4.GIT