- echo $name: $type
- if [ "$type" = "git" ]; then
- git fetch "$name"
- continue
- fi
- if [ "$type" = "quilt" ]; then
- case "$url" in
- http://kernel.org/*|http://www.kernel.org/*)
- use_rsync=true
- rurl=$(echo "$url" | sed -r 's,^http://(www\.)?kernel\.org,master.kernel.org:,')
- ;;
- *)
- use_rsync=false
- ;;
- esac
+ shift
+}
+
+get_field()
+{
+ awk -F '\t' '/^[^#]/ && $3 == "'$1'" { print $'$2'; }' $CTRL_FILE
+}
+
+fetch_git()
+{
+ git fetch "$1"
+}
+
+fetch_mmotm()
+{
+ (
+ cd ../mmotm || {
+ echo "Cannot chdir to ../mmotm" 1>&2
+ return
+ }
+ rsync -az --partial --exclude .git\* --exclude broken-out.tar.gz --delete ozlabs.org::akpm/mmotm/. . || {
+ git reset --hard
+ echo "Fetcing mmotm failed" 1>&2
+ return
+ }
+ git add -A .
+ [ "$(git status --porcelain)" ] &&
+ git commit -m "$(head -n 1 .DATE)"
+ )
+}
+
+fetch_quilt()
+{
+ (
+ url=$(get_field "$1" 4)
+ url=${url%/} # strip trailing / if necessary
+