FIX: rfc.sh git mv/add logic

This commit is contained in:
Christian Thaeter 2011-04-14 03:21:14 +02:00
parent 88d59a9e1b
commit 4972ca2af8

View file

@ -227,41 +227,29 @@ function process_file()
{ {
local file="$1" local file="$1"
local path="${1%/*}" local path="${1%/*}"
local basename="${1##*/}"
local destpath="$path"
local state=$(grep '^\*State\* *' "$file") local state=$(grep '^\*State\* *' "$file")
case "$state" in case "$state" in
*Final*) *Final*)
if [[ "$path" != "./doc/devel/rfc" ]]; then destpath="./doc/devel/rfc"
git mv "$file" "./doc/devel/rfc"
else
git add "$file"
fi
;; ;;
*Idea*|*Draft*) *Idea*|*Draft*)
if [[ "$path" != "./doc/devel/rfc_pending" ]]; then destpath="./doc/devel/rfc_pending"
git mv "$file" "./doc/devel/rfc_pending"
else
git add "$file"
fi
;; ;;
*Parked*) *Parked*)
if [[ "$path" != "./doc/devel/rfc_parked" ]]; then destpath="./doc/devel/rfc_parked"
git mv "$file" "./doc/devel/rfc_parked"
else
git add "$file"
fi
;; ;;
*Dropped*) *Dropped*)
if [[ "$path" != "./doc/devel/rfc_dropped" ]]; then destpath="./doc/devel/rfc_dropped"
git mv "$file" "./doc/devel/rfc_dropped"
else
git add "$file"
fi
;;
*)
git add "$file"
;; ;;
esac esac
if [[ "$path" != "$destpath" ]]; then
git mv "$file" "$destpath"
fi
git add "$destpath/$basename"
} }