On Tue, Nov 19, 2013 at 06:28:47PM +0800, Mathieu Bridon wrote:
On Tue, 2013-11-19 at 10:22 +0000, Richard W.M. Jones wrote:
> 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}
Or maybe we could start using %autosetup ?
http://www.rpm.org/wiki/PackagerDocs/Autosetup
'%autosetup -S git' for sure, not plain %autosetup.
Git correctly handles file modes and binary patches (not that binary
patches should be much of a concern here, but file modes definitely
are).
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages.
http://libguestfs.org