Date:2010-11-02 10:01:12 (13 years 4 months ago)
Author:Xiangfu Liu
Commit:ef4105fef756c6d71b0afb62bb78cfeba8d40e3d
Message: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 <xiangfu@sharism.cc>
Files: data/qi_lb60/scripts/build (4 diffs)

Change Details

data/qi_lb60/scripts/build
1010TIME=$(date "+%H-%M-%S")
1111DATE_TIME="${DATE}_${TIME}"
1212
13FEEDS_CONF="feeds.conf.default"
13FEEDS_CONF="data/qi_lb60/conf/feeds.conf"
1414test -f "feeds.conf" && FEEDS_CONF="feeds.conf"
1515
16if [ "${0}" != "./scripts/build" ]; then
17    echo "Please call me that way: ./scripts/build"
16if [ "${0}" != "data/qi_lb60/scripts/build" ]; then
17    echo "Please call me that way: data/qi_lb60/scripts/build"
1818    echo " - out of the main directory"
1919    exit 1
2020fi
...... 
6060
6161echo "updating git repo..."
6262git stash
63git checkout tracking_backfire
6463git pull > /dev/null
6564if [ "$?" != "0" ]; then
6665    echo "ERROR: updating openwrt-xburst failed"
...... 
8382echo "getting version numbers of used repositories..."
8483feeds="$(cat "${FEEDS_CONF}" | grep -v -E "^#")"
8584VERSIONS_FILE="xburst/VERSIONS"
86echo "# base :: 'openwrt' [scm-protocol] [revision] [source] [branch]" > ${VERSIONS_FILE}
87tmp=($(git show-ref | head -n 1))
88rev=${tmp[0]}
89echo "openwrt git ${rev} git://projects.qi-hardware.com/openwrt-xburst.git tracking_backfire" >> ${VERSIONS_FILE}
85echo "# base :: 'openwrt' [scm-protocol] [source] [branch] [revision]" > ${VERSIONS_FILE}
86rev=$(git log | head -n 1 | cut -b8-)
87branch=$(git branch | grep "*" | cut -b3-)
88echo "openwrt git git://projects.qi-hardware.com/openwrt-xburst.git ${branch} ${rev}" >> ${VERSIONS_FILE}
9089echo "# feeds :: [feedname] [scm-protocol] [revision]" >> ${VERSIONS_FILE}
9190IFS=$'\n'
9291for feed in $feeds; do
...... 
9998                rev=${tmp[1]}
10099        fi
101100        if [ "$proto" = "git" ]; then
102                cd feeds/${arr[1]} && tmp=($(git show-ref | head -n 1)) && cd ../../
103                rev=${tmp[0]}
101                cd feeds/${arr[1]} && tmp=($(git log | head -n 1)) && cd ../../
102                rev=${tmp[1]}
104103        fi
105104        echo "${dir} ${proto} ${rev}" >> ${VERSIONS_FILE}
106105done

Archive Download the corresponding diff file



interactive