From 271ec5cd735371d624c4560660933ddc21c3653d Mon Sep 17 00:00:00 2001 From: Xiangfu Liu Date: Tue, 2 Nov 2010 17:01:12 +0800 Subject: [PATCH] cleanup the build file - get branch name from shell - use git log instead of git show-ref for get the commit - fix the file path - remove checkout to tracking_backfire branch Signed-off-by: Xiangfu Liu --- data/qi_lb60/scripts/build | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/data/qi_lb60/scripts/build b/data/qi_lb60/scripts/build index b6c16f773..d80302825 100755 --- a/data/qi_lb60/scripts/build +++ b/data/qi_lb60/scripts/build @@ -10,11 +10,11 @@ DATE=$(date "+%Y-%m-%d") TIME=$(date "+%H-%M-%S") DATE_TIME="${DATE}_${TIME}" -FEEDS_CONF="feeds.conf.default" +FEEDS_CONF="data/qi_lb60/conf/feeds.conf" test -f "feeds.conf" && FEEDS_CONF="feeds.conf" -if [ "${0}" != "./scripts/build" ]; then - echo "Please call me that way: ./scripts/build" +if [ "${0}" != "data/qi_lb60/scripts/build" ]; then + echo "Please call me that way: data/qi_lb60/scripts/build" echo " - out of the main directory" exit 1 fi @@ -60,7 +60,6 @@ mkdir xburst echo "updating git repo..." git stash -git checkout tracking_backfire git pull > /dev/null if [ "$?" != "0" ]; then echo "ERROR: updating openwrt-xburst failed" @@ -83,10 +82,10 @@ fi echo "getting version numbers of used repositories..." feeds="$(cat "${FEEDS_CONF}" | grep -v -E "^#")" VERSIONS_FILE="xburst/VERSIONS" -echo "# base :: 'openwrt' [scm-protocol] [revision] [source] [branch]" > ${VERSIONS_FILE} -tmp=($(git show-ref | head -n 1)) -rev=${tmp[0]} -echo "openwrt git ${rev} git://projects.qi-hardware.com/openwrt-xburst.git tracking_backfire" >> ${VERSIONS_FILE} +echo "# base :: 'openwrt' [scm-protocol] [source] [branch] [revision]" > ${VERSIONS_FILE} +rev=$(git log | head -n 1 | cut -b8-) +branch=$(git branch | grep "*" | cut -b3-) +echo "openwrt git git://projects.qi-hardware.com/openwrt-xburst.git ${branch} ${rev}" >> ${VERSIONS_FILE} echo "# feeds :: [feedname] [scm-protocol] [revision]" >> ${VERSIONS_FILE} IFS=$'\n' for feed in $feeds; do @@ -99,8 +98,8 @@ for feed in $feeds; do rev=${tmp[1]} fi if [ "$proto" = "git" ]; then - cd feeds/${arr[1]} && tmp=($(git show-ref | head -n 1)) && cd ../../ - rev=${tmp[0]} + cd feeds/${arr[1]} && tmp=($(git log | head -n 1)) && cd ../../ + rev=${tmp[1]} fi echo "${dir} ${proto} ${rev}" >> ${VERSIONS_FILE} done