OpenWrt packages
Sign in or create your account | Project List | Help
OpenWrt packages Git Source Tree
Root/
| 1 | #!/bin/bash |
| 2 | |
| 3 | cd $1 |
| 4 | |
| 5 | FEEDS_CONF="feeds.conf.default" |
| 6 | test -f "feeds.conf" && FEEDS_CONF="feeds.conf" |
| 7 | |
| 8 | feeds="$(cat "${FEEDS_CONF}" | grep -v -E "^#")" |
| 9 | |
| 10 | echo "# base :: openwrt [scm-protocol] [source] [branch] [revision]" |
| 11 | repo=$(git config -l | grep remote.origin.url | cut -d "=" -f 2) |
| 12 | rev=$(git log | head -n 1 | cut -b8-) |
| 13 | branch=$(git branch | grep "*" | cut -b3-) |
| 14 | echo "openwrt git ${repo} ${branch} ${rev}" |
| 15 | |
| 16 | echo "# feeds :: [feedname] [scm-protocol] [revision]" |
| 17 | IFS=$'\n' |
| 18 | for feed in $feeds; do |
| 19 | IFS=' ' arr=(${feed:4}) |
| 20 | proto=${arr[0]} |
| 21 | dir=${arr[1]} |
| 22 | |
| 23 | if [ "$proto" = "svn" ]; then |
| 24 | cd feeds/${dir} && rev=`svn info | grep -E "^Revision" | cut -d " " -f2` && cd ../../ |
| 25 | fi |
| 26 | if [ "$proto" = "git" ]; then |
| 27 | cd feeds/${dir} && rev=`git log | head -n 1 | cut -d " " -f2` && cd ../../ |
| 28 | fi |
| 29 | if [ "$proto" = "link" ]; then |
| 30 | rev=`date "+%Y-%m-%d"` |
| 31 | fi |
| 32 | |
| 33 | echo "${dir} ${proto} ${rev}" |
| 34 | done |
