From: Huaxu Wan Date: Mon, 5 Dec 2011 10:21:34 +0000 (+0800) Subject: git rm/add when remove/add new patches X-Git-Tag: v0.1~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=15b01a01b65785b2362226908326e90f03aa958f;p=tools%2Fgbs.git git rm/add when remove/add new patches --- diff --git a/data/packaging.sh b/data/packaging.sh index f3ed08b..82b8475 100644 --- a/data/packaging.sh +++ b/data/packaging.sh @@ -88,7 +88,7 @@ update_patches() # Find the patches to be kept for patch in $patch_list do - line=$(grep "Patch[0-9]*:.*$(basename $patch|sed 's/[0-9]*-//')" $spec) + line=$(grep "Patch[0-9]*:.*$(basename ${patch%.patch}|sed 's/[0-9]*-//')" $spec) if [ -n "$line" ]; then sed -i "s/$line/#PATCHKEPT#$line/" $spec else @@ -98,7 +98,7 @@ update_patches() # Remove old patches toberemove_patch=$(grep "^Patch[0-9]*:" $spec |awk '{print $2}') - + if [ -n "$toberemove_patch" ]; then echo "----------------------------------------" info_msg "The following patch(es) removed:" @@ -118,7 +118,7 @@ update_patches() ;; * ) sed -i "/^Patch[0-9]*:.*$patch/ d" $spec - rm $patch + git rm $patch info_msg "Patch $patch removed." ;; esac @@ -190,6 +190,7 @@ update_patches() do echo " " $(basename $patch) mv $patch . + git add $patch done echo "----------------------------------------" fi # end of insert new add patch section @@ -299,7 +300,6 @@ do shift done - if [ -z "$git_obj" ]; then git_obj=$(git log --format="%h" -n 1)