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 | ||
---|---|---|
10 | 10 | TIME=$(date "+%H-%M-%S") |
11 | 11 | DATE_TIME="${DATE}_${TIME}" |
12 | 12 | |
13 | FEEDS_CONF="feeds.conf.default" | |
13 | FEEDS_CONF="data/qi_lb60/conf/feeds.conf" | |
14 | 14 | test -f "feeds.conf" && FEEDS_CONF="feeds.conf" |
15 | 15 | |
16 | if [ "${0}" != "./scripts/build" ]; then | |
17 | echo "Please call me that way: ./scripts/build" | |
16 | if [ "${0}" != "data/qi_lb60/scripts/build" ]; then | |
17 | echo "Please call me that way: data/qi_lb60/scripts/build" | |
18 | 18 | echo " - out of the main directory" |
19 | 19 | exit 1 |
20 | 20 | fi |
... | ... | |
60 | 60 | |
61 | 61 | echo "updating git repo..." |
62 | 62 | git stash |
63 | git checkout tracking_backfire | |
64 | 63 | git pull > /dev/null |
65 | 64 | if [ "$?" != "0" ]; then |
66 | 65 | echo "ERROR: updating openwrt-xburst failed" |
... | ... | |
83 | 82 | echo "getting version numbers of used repositories..." |
84 | 83 | feeds="$(cat "${FEEDS_CONF}" | grep -v -E "^#")" |
85 | 84 | VERSIONS_FILE="xburst/VERSIONS" |
86 | echo "# base :: 'openwrt' [scm-protocol] [revision] [source] [branch]" > ${VERSIONS_FILE} | |
87 | tmp=($(git show-ref | head -n 1)) | |
88 | rev=${tmp[0]} | |
89 | echo "openwrt git ${rev} git://projects.qi-hardware.com/openwrt-xburst.git tracking_backfire" >> ${VERSIONS_FILE} | |
85 | echo "# base :: 'openwrt' [scm-protocol] [source] [branch] [revision]" > ${VERSIONS_FILE} | |
86 | rev=$(git log | head -n 1 | cut -b8-) | |
87 | branch=$(git branch | grep "*" | cut -b3-) | |
88 | echo "openwrt git git://projects.qi-hardware.com/openwrt-xburst.git ${branch} ${rev}" >> ${VERSIONS_FILE} | |
90 | 89 | echo "# feeds :: [feedname] [scm-protocol] [revision]" >> ${VERSIONS_FILE} |
91 | 90 | IFS=$'\n' |
92 | 91 | for feed in $feeds; do |
... | ... | |
99 | 98 | rev=${tmp[1]} |
100 | 99 | fi |
101 | 100 | 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]} | |
104 | 103 | fi |
105 | 104 | echo "${dir} ${proto} ${rev}" >> ${VERSIONS_FILE} |
106 | 105 | done |