[openstack-nova] maint: handle non distributed files in updates-patches.sh
Pádraig Brady
pbrady at fedoraproject.org
Thu Apr 19 16:55:47 UTC 2012
commit 837b979bf920a769a2f4e8831b45179baebcf256
Author: Pádraig Brady <P at draigBrady.com>
Date: Wed Apr 18 18:33:36 2012 +0100
maint: handle non distributed files in updates-patches.sh
* update-patches.sh: Use filterdiff to strip out the non
distributed files, which would give patch issues when applying
update-patches.sh | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/update-patches.sh b/update-patches.sh
index 617221f..f5272ba 100755
--- a/update-patches.sh
+++ b/update-patches.sh
@@ -23,6 +23,11 @@ git status -uno --porcelain | grep . && {
exit 1
}
+filterdiff /dev/null || {
+ echo "Please install patchutils" >&2
+ exit 1
+}
+
spec=$(fedpkg gimmespec)
branch=$(git branch | awk '/^\* / {print $2}')
patches_branch="${branch}-patches"
@@ -42,6 +47,15 @@ git checkout "${patches_branch}"
new_patches=$(git format-patch --no-signature -N "${patches_base}")
#
+# Filter non dist files from the patches as otherwise
+# `patch` will prompt/fail for the non existent files
+#
+for patch in $new_patches; do
+ filterdiff -x '*/.*' $patch > $patch.$$
+ mv $patch.$$ $patch
+done
+
+#
# Switch back to the original branch and add the patches
#
git checkout "${branch}"
More information about the scm-commits
mailing list