[rkward-cvs] [rkward] macports: get better commit info for the bundle script. admittedly, it's quite a hack

m.eik michalke meik.michalke at uni-duesseldorf.de
Tue Feb 10 15:30:27 UTC 2015


Git commit 8cbaeb4db529310bcf58d0ab9c8ccb660d947c3d by m.eik michalke.
Committed on 10/02/2015 at 15:30.
Pushed by meikm into branch 'master'.

get better commit info for the bundle script. admittedly, it's quite a hack

M  +27   -1    macports/update_bundle.sh

http://commits.kde.org/rkward/8cbaeb4db529310bcf58d0ab9c8ccb660d947c3d

diff --git a/macports/update_bundle.sh b/macports/update_bundle.sh
index 9e934d5..86ea51a 100755
--- a/macports/update_bundle.sh
+++ b/macports/update_bundle.sh
@@ -235,7 +235,33 @@ if [[ $COPYMDMD ]] ; then
   if [[ $DEVEL ]] ; then
     # we moved to git
     # TARGETVERS=${PORTVERS}$(svn info "$SVNREPO" | grep "^Revision:" | sed "s/[^[:digit:]]*//")
-    TARGETVERS=${PORTVERS}$(git ls-remote http://anongit.kde.org/rkward | grep HEAD$ | cut -c 1-7)
+    # 
+    # this one-liner would give us the latest commit hash, but no date -- bad for humans and sorting:
+    # TARGETVERS=${PORTVERS}$(git ls-remote http://anongit.kde.org/rkward master | cut -c 1-7)
+    # 
+    # so here's something a little more elaborate...
+    if [[ $(hostname) == "RKWard-iMac.local" ]] ; then
+      TEMPFILE=$(mktemp /tmp/git_rev.XXXXXX || exit 1)
+    else
+      TEMPFILE=$(mktemp || exit 1)
+    fi
+    if ! [[ $(which wget) == "" ]] ; then
+      wget -q -O "${TEMPFILE}" "http://quickgit.kde.org/?p=rkward.git" || exit 1
+      GOTQUICKGIT=true
+    elif ! [[ $(which curl) == "" ]] ; then
+      curl -s -o "${TEMPFILE}" "http://quickgit.kde.org/?p=rkward.git" || exit 1
+      GOTQUICKGIT=true
+    else
+      echo "neither wget nor curl can be found, only commit has can be used!"
+      TARGETVERS=${PORTVERS}-git$(git ls-remote http://anongit.kde.org/rkward master | cut -c 1-7)
+      GOTQUICKGIT=false
+    fi
+    if [[ ${GOTQUICKGIT} ]] ; then
+      CHANGEDATE=$(grep "last change.*<time datetime=" "${TEMPFILE}" | sed "s/.*datetime=\"\(.*\)+00:00.*/\1/g" | sed "s/[^[:digit:]]//g")
+      LASTCOMMIT=$(grep -m1 "<td class=\"monospace\">[[:alnum:]]\{7\}" "${TEMPFILE}" | sed "s#.*<td class=\"monospace\">\(.*\)</td>.*#\1#")
+      TARGETVERS="${PORTVERS}-git${CHANGEDATE}~${LASTCOMMIT}"
+    fi
+    rm "${TEMPFILE}"
   else
     TARGETVERS=$PORTVERS
   fi


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
rkward-cvs mailing list
rkward-cvs at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rkward-cvs


More information about the rkward-tracker mailing list