From cae868f689b57d927b1e830cd2cfa6176c18e538 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 11 Apr 2014 16:06:11 +0200 Subject: [PATCH] contrib/makerepo: check that reapplying patch succeeded in `makerepo.sh` Signed-off-by: Thomas Haller --- contrib/fedora/utils/makerepo.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/fedora/utils/makerepo.sh b/contrib/fedora/utils/makerepo.sh index 1d577506e6..68e31cbf97 100755 --- a/contrib/fedora/utils/makerepo.sh +++ b/contrib/fedora/utils/makerepo.sh @@ -136,6 +136,7 @@ pushd "$DIRNAME" git commit --allow-empty -m '*** empty initial commit' # useful, to rebase the following commit git add -f -A . git commit -m '*** add all' + ORIG_HEAD="`git rev-parse HEAD`" cat ../makerepo.gitignore > .gitignore git rm --cached -r . git add --all . @@ -206,8 +207,13 @@ pushd "$DIRNAME" git commit --allow-empty -m "$COMMIT_MSG" fi git reset --hard HEAD + git clean -fdx + [[ x = "x$(git diff "${BASECOMMIT[$((i+1))]}" HEAD)" ]] || die "error reverting patch" done fi + git checkout "$ORIG_HEAD" -- . + git checkout HEAD~ -- .gitignore + git reset popd if [[ $LOCAL != 0 ]]; then @@ -220,3 +226,4 @@ if [[ $LOCAL != 0 ]]; then popd fi +echo SUCCESS;