Using git for patch management in Fedora
by Richard W.M. Jones
Several packages are using git for patch management. eg:
http://pkgs.fedoraproject.org/cgit/erlang.git/tree/erlang.spec#n46
http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/libguestfs.spec?h=...
http://pkgs.fedoraproject.org/cgit/qemu.git/tree/
http://pkgs.fedoraproject.org/cgit/ocaml.git/tree/ocaml.spec#n16
Some of these packages have invented home-brewed methods to generate
the Patch lines in the spec file, eg:
http://pkgs.fedoraproject.org/cgit/erlang.git/tree/otp-get-patches.sh
http://pkgs.fedoraproject.org/cgit/libguestfs.git/tree/copy-patches.sh?h=f20
More importantly, all are using random git repositories to store the
exploded tree. This makes it difficult for co-maintainers and proven
packagers to fit in with the patch management chosen by the
maintainer. Usually they won't have access to the git repository for
these patches, making it difficult to add patches and near impossible
to upgrade to a new version.
I think that git is an excellent way to manage patches, but we ought
to think about formalizing this process. I think the goals should be:
(1) A git repository is used that co-maintainers and proven packagers
automatically have access to.
(2) A single method & script is used to update the patches in the spec file.
Although there is already a git repository satisfying (1) above,
namely dist-git, it isn't suitable for storing the exploded tree since
commits to the spec file would conflict with commits (patches) to the
tree. So either a separate side repository which packages could
opt-in to, or perhaps a separate branch of the same git repo could be
used. I think using a branch would require no additional
infrastructure.
For (2) I would suggest a lightweight technique where git-managed
patches are marked in the spec file using:
### GIT-MANAGED-PATCHES ###
### END-GIT-MANGED-PATCHES ###
and a simple script that replaces everything between those marks with
PatchXXXX lines. The script could be adapted from copy-patches.sh
(see above).
To apply the patches, a standard RPM macro could be created:
%prep
%setup -q
%{git_apply_patches}
which would expand to something like:
git init
git config user.email "%{name}-owner(a)fedoraproject.org"
git config user.name "%{name}"
git add .
git commit -a -q -m "%{version} baseline"
git am %{patches}
Thoughts on this?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top
10 years, 3 months
[wings/f19] Ver. 1.5.2
by Peter Lemenkov
Summary of changes:
8b193d9... Ver. 1.5.2 (*)
(*) This commit already existed in another branch; no separate mail sent
10 years, 4 months
[wings/f20] Ver. 1.5.2
by Peter Lemenkov
Summary of changes:
8b193d9... Ver. 1.5.2 (*)
(*) This commit already existed in another branch; no separate mail sent
10 years, 4 months
[wings] Ver. 1.5.2
by Peter Lemenkov
commit 8b193d99c44ebe8e5643da9e1690dac97617292d
Author: Peter Lemenkov <lemenkov(a)gmail.com>
Date: Fri Dec 27 21:54:41 2013 +0400
Ver. 1.5.2
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
.gitignore | 1 +
sources | 2 +-
wings-0001-Don-t-try-to-build-installer.patch | 9 +--------
wings-0002-Respect-CFLAGS.patch | 10 +---------
wings.spec | 5 ++++-
5 files changed, 8 insertions(+), 19 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2b0bd59..f66ee83 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ wings-1.2.tar.bz2
/wings3d_manual1.6.1.pdf
/dgud-wings-9a2473e.tar.gz
/wings-1.5.1.tar.gz
+/wings-1.5.2.tar.gz
diff --git a/sources b/sources
index d9fd247..f29ff19 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-7c4583eccd294cf6f2f7d5bc4925eb03 wings-1.5.1.tar.gz
+abf84d377fc3bbe193436766bdb45584 wings-1.5.2.tar.gz
c01d19b4be79b647b8605dd32753da3a wings3d_manual1.6.1.pdf
diff --git a/wings-0001-Don-t-try-to-build-installer.patch b/wings-0001-Don-t-try-to-build-installer.patch
index 128bcff..52daf18 100644
--- a/wings-0001-Don-t-try-to-build-installer.patch
+++ b/wings-0001-Don-t-try-to-build-installer.patch
@@ -1,12 +1,8 @@
-From f5b08d51ea3010b844918fcd03e87f14aaba22a6 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov(a)gmail.com>
Date: Thu, 21 Mar 2013 18:45:25 +0400
-Subject: [PATCH 1/2] Don't try to build installer
+Subject: [PATCH] Don't try to build installer
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
----
- Makefile | 1 -
- 1 file changed, 1 deletion(-)
diff --git a/Makefile b/Makefile
index 51f2727..1335aa5 100644
@@ -20,6 +16,3 @@ index 51f2727..1335aa5 100644
#
# Build the source distribution.
---
-1.8.3.1
-
diff --git a/wings-0002-Respect-CFLAGS.patch b/wings-0002-Respect-CFLAGS.patch
index 54a724d..d246a31 100644
--- a/wings-0002-Respect-CFLAGS.patch
+++ b/wings-0002-Respect-CFLAGS.patch
@@ -1,13 +1,8 @@
-From 2ffdacceba53e93d9e9da2ef8c710ed47762aa03 Mon Sep 17 00:00:00 2001
From: Peter Lemenkov <lemenkov(a)gmail.com>
Date: Thu, 21 Mar 2013 18:53:10 +0400
-Subject: [PATCH 2/2] Respect CFLAGS
+Subject: [PATCH] Respect CFLAGS
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
----
- plugins_src/accel/Makefile | 8 ++------
- plugins_src/jpeg/Makefile | 4 +---
- 2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/plugins_src/accel/Makefile b/plugins_src/accel/Makefile
index 3439272..0848839 100644
@@ -57,6 +52,3 @@ index 6707f35..43eb52f 100644
endif
---
-1.8.3.1
-
diff --git a/wings.spec b/wings.spec
index 06b84a0..47efd19 100644
--- a/wings.spec
+++ b/wings.spec
@@ -11,7 +11,7 @@
Name: wings
-Version: 1.5.1
+Version: 1.5.2
Release: 1%{?dist}
Summary: 3D Subdivision Modeler
@@ -129,6 +129,9 @@ desktop-file-install \
%changelog
+* Fri Dec 27 2013 Peter Lemenkov <lemenkov(a)gmail.com> - 1.5.2-2
+- Ver. 1.5.2
+
* Sat Nov 02 2013 Peter Lemenkov <lemenkov(a)gmail.com> - 1.5.1-1
- Ver. 1.5.1
- Dropped upstreamed patches
10 years, 4 months
[erlang] Don't generate signature and stats - they are noisy
by Peter Lemenkov
commit 2845f9192535b10cfbda10fb3d9a19b0f28d1a5f
Author: Peter Lemenkov <lemenkov(a)gmail.com>
Date: Thu Dec 26 18:11:53 2013 +0400
Don't generate signature and stats - they are noisy
Signed-off-by: Peter Lemenkov <lemenkov(a)gmail.com>
otp-get-patches.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/otp-get-patches.sh b/otp-get-patches.sh
index d9ca70d..033db0e 100755
--- a/otp-get-patches.sh
+++ b/otp-get-patches.sh
@@ -42,7 +42,7 @@ tmpdir="$(mktemp -d --tmpdir="$PWD")"
# Generate patch files
pushd "$otp_dir"
-git format-patch -N -o "$tmpdir" "${otp_upstream}..${otp_fedora}" > "$tmpdir/patch-list.txt"
+git format-patch -N --no-signature --no-stat -o "$tmpdir" "${otp_upstream}..${otp_fedora}" > "$tmpdir/patch-list.txt"
popd
test -s "$tmpdir/patch-list.txt"
10 years, 4 months
hello
by Peter Lemenkov
--
With best regards, Peter Lemenkov.
10 years, 4 months