[openstack-nova] Update patches from git

Mark McLoughlin markmc at fedoraproject.org
Tue Jan 24 16:16:49 UTC 2012


commit a3cf99202e1ad9c28a7cb2e73274c62fcf7382c8
Author: Mark McLoughlin <markmc at redhat.com>
Date:   Tue Jan 24 15:27:27 2012 +0000

    Update patches from git
    
    Should be no actual code changes, just syncing from git.
    
    Also, add an update-patches.sh script which will generate the patches
    from the ${branch}-patches branch and include them in the spec file.

 ...fix-X-Server-Management-Url-for-v1.0-noau.patch |    4 +-
 ...hain-rule-for-EC2-metadata-requests-lp-85.patch |    2 +-
 ...pi-add-the-INPUT-rule-for-EC2-metadata-lp.patch |    2 +-
 ...ser-to-choose-either-ietadm-or-tgtadm-lp-.patch |    2 +-
 ...e-VolumeDriver.sync_exec-method-lp-819997.patch |    2 +-
 ...tadm-tgtadm-calls-out-into-helper-classes.patch |    2 +-
 ...tgtadm-off-by-one-error.-Fixes-bug-871278.patch |    2 +-
 ...57-abstract-out-disk-image-access-methods.patch |    2 +-
 ...7-support-handling-images-with-libguestfs.patch |    2 +-
 ...estfs-operation-with-specified-partitions.patch |    2 +-
 ...e-don-t-access-the-net-when-building-docs.patch |    2 +-
 openstack-nova.spec                                |   57 ++++++---------
 update-patches.sh                                  |   74 ++++++++++++++++++++
 13 files changed, 109 insertions(+), 46 deletions(-)
---
diff --git a/0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch b/0001-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noau.patch
similarity index 96%
rename from 0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
rename to 0001-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noau.patch
index 7c71ccd..40d2759 100644
--- a/0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
+++ b/0001-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noau.patch
@@ -1,4 +1,4 @@
-From e48106a2a5086c933d98043952d63c50c25df10b Mon Sep 17 00:00:00 2001
+From e00e78a187882a3af2cb2729d4658a66cb9b8dc6 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Mon, 23 Jan 2012 15:49:08 +0000
 Subject: [PATCH] Bug #920497 fix X-Server-Management-Url for v1.0 noauth API
@@ -43,5 +43,5 @@ index d435f83..d8dbb68 100644
              # NOTE(vish): This is expecting and returning Auth(1.1), whereas
              #             keystone uses 2.0 auth.  We should probably allow
 -- 
-1.7.6.4
+1.7.6.5
 
diff --git a/0001-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch b/0002-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
similarity index 95%
rename from 0001-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
rename to 0002-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
index 10cd866..f17e08c 100644
--- a/0001-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
+++ b/0002-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
@@ -1,4 +1,4 @@
-From 8574faa359ca09cd99c54483e413eebaf7479277 Mon Sep 17 00:00:00 2001
+From 464b843bcd4c014b7a8940184727ad764a397443 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Mon, 5 Sep 2011 07:10:52 +0100
 Subject: [PATCH] Add INPUT chain rule for EC2 metadata requests (lp:856385)
diff --git a/0002-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch b/0003-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
similarity index 99%
rename from 0002-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
rename to 0003-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
index a8248a4..830aeeb 100644
--- a/0002-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
+++ b/0003-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
@@ -1,4 +1,4 @@
-From 87ebe9d79c40cefbec595a4684289af058bb1c48 Mon Sep 17 00:00:00 2001
+From 1276248a43361b46f8ca2568c029e075b7e5406d Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Thu, 8 Sep 2011 14:29:49 +0100
 Subject: [PATCH] Have nova-api add the INPUT rule for EC2 metadata
diff --git a/0003-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch b/0004-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
similarity index 99%
rename from 0003-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
rename to 0004-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
index 703c37e..bbad1a4 100644
--- a/0003-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
+++ b/0004-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
@@ -1,4 +1,4 @@
-From b72b3577c6974b2fe52c2076260a332f7233f752 Mon Sep 17 00:00:00 2001
+From 7674cb87528fc40f330bc501fd246e945e14d276 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Thu, 11 Aug 2011 07:44:38 -0400
 Subject: [PATCH] Allow the user to choose either ietadm or tgtadm (lp:819997)
diff --git a/0004-Remove-VolumeDriver.sync_exec-method-lp-819997.patch b/0005-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
similarity index 99%
rename from 0004-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
rename to 0005-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
index 46eaea2..ac4e93d 100644
--- a/0004-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
+++ b/0005-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
@@ -1,4 +1,4 @@
-From 0116537957ea1bae7a7c2092c2974250ed8ea10f Mon Sep 17 00:00:00 2001
+From 9f018314935374e05a50923d32c7b3933e86cea9 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Sun, 18 Sep 2011 12:04:46 +0100
 Subject: [PATCH] Remove VolumeDriver.sync_exec method (lp:819997)
diff --git a/0005-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch b/0006-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
similarity index 99%
rename from 0005-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
rename to 0006-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
index 789ef0b..f09ee71 100644
--- a/0005-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
+++ b/0006-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
@@ -1,4 +1,4 @@
-From d972b5aab96b0648a78e9c123fdbaded037604d4 Mon Sep 17 00:00:00 2001
+From 4dd34f3f5ce0482788077bcb9457d5ff8bf8f792 Mon Sep 17 00:00:00 2001
 From: Mark McLoughlin <markmc at redhat.com>
 Date: Sun, 18 Sep 2011 16:02:43 +0100
 Subject: [PATCH] Refactor ietadm/tgtadm calls out into helper classes
diff --git a/0006-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch b/0007-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
similarity index 95%
rename from 0006-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
rename to 0007-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
index a26016f..3df75b0 100644
--- a/0006-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
+++ b/0007-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
@@ -1,4 +1,4 @@
-From 0c93e4c4873fde83ec0e572615d9307404e391b2 Mon Sep 17 00:00:00 2001
+From 7bd0b6b004e686fa97ebc0a2e5e9bb75d95aaeea Mon Sep 17 00:00:00 2001
 From: Chuck Short <chuck.short at canonical.com>
 Date: Tue, 13 Dec 2011 13:45:43 -0500
 Subject: [PATCH] Fix tgtadm off by one error. Fixes bug #871278
diff --git a/0007-Bug-898257-abstract-out-disk-image-access-methods.patch b/0008-Bug-898257-abstract-out-disk-image-access-methods.patch
similarity index 99%
rename from 0007-Bug-898257-abstract-out-disk-image-access-methods.patch
rename to 0008-Bug-898257-abstract-out-disk-image-access-methods.patch
index a78928f..a737297 100644
--- a/0007-Bug-898257-abstract-out-disk-image-access-methods.patch
+++ b/0008-Bug-898257-abstract-out-disk-image-access-methods.patch
@@ -1,4 +1,4 @@
-From 7646652683d45bc34e01a2b1e19157b924fee8a9 Mon Sep 17 00:00:00 2001
+From b89cb44fd42849f8f94d22efa651f935b6ae376f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Wed, 30 Nov 2011 17:00:17 +0000
 Subject: [PATCH] Bug#898257 abstract out disk image access methods
diff --git a/0008-Bug-898257-support-handling-images-with-libguestfs.patch b/0009-Bug-898257-support-handling-images-with-libguestfs.patch
similarity index 98%
rename from 0008-Bug-898257-support-handling-images-with-libguestfs.patch
rename to 0009-Bug-898257-support-handling-images-with-libguestfs.patch
index 75dfc3d..2865b46 100644
--- a/0008-Bug-898257-support-handling-images-with-libguestfs.patch
+++ b/0009-Bug-898257-support-handling-images-with-libguestfs.patch
@@ -1,4 +1,4 @@
-From e240840e3cbc4cdbed11b5a3e257328e775edcf5 Mon Sep 17 00:00:00 2001
+From 2b3f7c99df94960ee76590394e209a827fe5c240 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Wed, 30 Nov 2011 17:00:17 +0000
 Subject: [PATCH] Bug#898257 support handling images with libguestfs
diff --git a/0009-Fix-libguestfs-operation-with-specified-partitions.patch b/0010-Fix-libguestfs-operation-with-specified-partitions.patch
similarity index 95%
rename from 0009-Fix-libguestfs-operation-with-specified-partitions.patch
rename to 0010-Fix-libguestfs-operation-with-specified-partitions.patch
index da8ea92..6515680 100644
--- a/0009-Fix-libguestfs-operation-with-specified-partitions.patch
+++ b/0010-Fix-libguestfs-operation-with-specified-partitions.patch
@@ -1,4 +1,4 @@
-From 0f8980bcd3e6932c9ba57d3470b8a177e49e7554 Mon Sep 17 00:00:00 2001
+From 69fcb2df30ae3e1e406ca58080cf88aba5b8ab7b Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Tue, 10 Jan 2012 10:54:21 +0000
 Subject: [PATCH] Fix libguestfs operation with specified partitions
diff --git a/0010-Ensure-we-don-t-access-the-net-when-building-docs.patch b/0011-Ensure-we-don-t-access-the-net-when-building-docs.patch
similarity index 94%
rename from 0010-Ensure-we-don-t-access-the-net-when-building-docs.patch
rename to 0011-Ensure-we-don-t-access-the-net-when-building-docs.patch
index cf4662f..48318af 100644
--- a/0010-Ensure-we-don-t-access-the-net-when-building-docs.patch
+++ b/0011-Ensure-we-don-t-access-the-net-when-building-docs.patch
@@ -1,4 +1,4 @@
-From 72682e2e4eb50f827119162b257b05b5846f2f1b Mon Sep 17 00:00:00 2001
+From 3588ad017f290892ddbf56a124926076edee4e79 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
 Date: Fri, 6 Jan 2012 12:16:34 +0000
 Subject: [PATCH] Ensure we don't access the net when building docs
diff --git a/openstack-nova.spec b/openstack-nova.spec
index 537d996..4958876 100644
--- a/openstack-nova.spec
+++ b/openstack-nova.spec
@@ -28,30 +28,19 @@ Source22:         nova-ifc-template
 Source23:         openstack-nova-db-setup
 
 #
-# Patches managed here: https://github.com/markmc/nova/tree/fedora-patches
+# patches_base=2011.3.1
 #
-#   $> git format-patch -N 2011.3.1
-#   $> for p in 00*.patch; do filterdiff -x '*/.gitignore' -x '*/.mailmap' $p | sponge $p; done
-#   $> for p in 00*.patch; do echo "Patch${p:2:2}:          $p"; done
-#   $> for p in 00*.patch; do echo "%patch${p:2:2} -p1"; done
-#
-
-# These are from stable/diablo
-Patch11:          0011-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noauth.patch
-
-# These are Fedora specific backports from master
-Patch01:          0001-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
-Patch02:          0002-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
-Patch03:          0003-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
-Patch04:          0004-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
-Patch05:          0005-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
-Patch06:          0006-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
-Patch07:          0007-Bug-898257-abstract-out-disk-image-access-methods.patch
-Patch08:          0008-Bug-898257-support-handling-images-with-libguestfs.patch
-Patch09:          0009-Fix-libguestfs-operation-with-specified-partitions.patch
-
-# This is Fedora specific and not upstream
-Patch10:          0010-Ensure-we-don-t-access-the-net-when-building-docs.patch
+Patch0001: 0001-Bug-920497-fix-X-Server-Management-Url-for-v1.0-noau.patch
+Patch0002: 0002-Add-INPUT-chain-rule-for-EC2-metadata-requests-lp-85.patch
+Patch0003: 0003-Have-nova-api-add-the-INPUT-rule-for-EC2-metadata-lp.patch
+Patch0004: 0004-Allow-the-user-to-choose-either-ietadm-or-tgtadm-lp-.patch
+Patch0005: 0005-Remove-VolumeDriver.sync_exec-method-lp-819997.patch
+Patch0006: 0006-Refactor-ietadm-tgtadm-calls-out-into-helper-classes.patch
+Patch0007: 0007-Fix-tgtadm-off-by-one-error.-Fixes-bug-871278.patch
+Patch0008: 0008-Bug-898257-abstract-out-disk-image-access-methods.patch
+Patch0009: 0009-Bug-898257-support-handling-images-with-libguestfs.patch
+Patch0010: 0010-Fix-libguestfs-operation-with-specified-partitions.patch
+Patch0011: 0011-Ensure-we-don-t-access-the-net-when-building-docs.patch
 
 BuildArch:        noarch
 BuildRequires:    intltool
@@ -182,17 +171,17 @@ This package contains documentation files for nova.
 %prep
 %setup -q -n nova-%{version}
 
-%patch01 -p1
-%patch02 -p1
-%patch03 -p1
-%patch04 -p1
-%patch05 -p1
-%patch06 -p1
-%patch07 -p1
-%patch08 -p1
-%patch09 -p1
-%patch10 -p1
-%patch11 -p1
+%patch0001 -p1
+%patch0002 -p1
+%patch0003 -p1
+%patch0004 -p1
+%patch0005 -p1
+%patch0006 -p1
+%patch0007 -p1
+%patch0008 -p1
+%patch0009 -p1
+%patch0010 -p1
+%patch0011 -p1
 
 find . \( -name .gitignore -o -name .placeholder \) -delete
 
diff --git a/update-patches.sh b/update-patches.sh
new file mode 100755
index 0000000..a8c3c93
--- /dev/null
+++ b/update-patches.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# This script formats the patches from a git branch, adds them
+# to the current branch and updates the spec file
+
+# To use it, do e.g.
+#
+#   $> git checkout master
+#   $> git remote add -f fedora-openstack git at github.com:fedora-openstack/nova.git
+#   $> git branch master-patches fedora-openstack/master
+#   $> ./update-patches.sh
+#
+# Now your left with a commit which updates the patches
+#
+# When you've pushed and built the package, don't forget to also
+# push the patches with e.g.
+#
+#   $> git push fedora-openstack +master-patches:master
+#
+
+spec=$(fedpkg gimmespec)
+branch=$(git branch | awk '/^\* / {print $2}')
+patches_branch="${branch}-patches"
+patches_base=$(awk -F '=' '/# patches_base/ { print $2 }' "${spec}")
+orig_patches=$(awk '/^Patch[0-9][0-9]*:/ { print $2 }' "${spec}")
+
+#
+# Create a commit which removes all the patches
+#
+git rm ${orig_patches}
+git commit -m "Updated patches from ${patches_branch}" ${orig_patches}
+
+#
+# Check out the ${branch}-patches branch and format the patches
+#
+git checkout "${patches_branch}"
+new_patches=$(git format-patch -N "${patches_base}")
+
+#
+# Switch back to the original branch and add the patches
+#
+git checkout "${branch}"
+git add ${new_patches}
+
+#
+# Remove the Patch/%patch lines from the spec file
+#
+sed -i '/^\(Patch\|%patch\)[0-9][0-9]*/d' "${spec}"
+
+#
+# Add a new set of Patch/%patch lines
+#
+patches_list=$(mktemp)
+patches_apply=$(mktemp)
+
+i=1;
+for p in ${new_patches}; do
+    printf "Patch%.4d: %s\n" "${i}" "${p}" >> "${patches_list}"
+    printf "%%patch%.4d -p1\n" "${i}" >> "${patches_apply}"
+    i=$((i+1))
+done
+
+cp "${patches_list}" list.patch
+cp "${patches_apply}" apply.patch
+
+sed -i -e "/# patches_base/ { N; r ${patches_list}" -e "}" "${spec}"
+sed -i -e "/%setup -q / { N; r ${patches_apply}" -e "}" "${spec}"
+
+rm "${patches_list}" "${patches_apply}"
+
+#
+# Update the original commit to include the new set of patches
+#
+git commit --amend -m "Updated patches from ${patches_branch}" "${spec}" ${new_patches}


More information about the scm-commits mailing list