[Pkg-sugar-devel] Patch for Browse package
Jonas Smedegaard
jonas at jones.dk
Fri Apr 21 07:23:59 UTC 2017
[re-sent to list - please do not cc me discretely on list posts]
Quoting Sebastian Silva (2017-04-21 07:08:23)
> It's been a couple of years since I last tried to help with packages.
>
> Here's a patch to the packaging of Browse. However I'm a little rusty on
> pristine-tar etc.
>
> Could you please guide me? Perhaps there's a better way.
Apart from James' excellent comments, a more general note:
It seems you let dpkg auto-generate a patch for you.
Not sure if better or I am just old-fashioned, but whenever dpkg
auto-generates a patch for me, I take it as an error: Throw away that
patch, roll back to a stable state in git, and try again.
I use quilt to manage patches - here's how to add a file to an existing
patch using quilt:
1extend) apply the old patch:
quilt push
(if there were multiple patches in the stack, keep pushing unitl the
patch you want to edit is the one applied (no no other on top of that).
2) register with git the new (i.e. not yet existing) file):
quilt add path/to/new/file
3) edit the file:
[here: simply copy the new file into place]
4) update the patch:
quilt refresh
5) unapply the patch (and any other patches below that in the stack):
quilt pop -a
You should now have a clean git, except the patch file below
/debian/patches is changed.
If you instead want to add a new patch at the end of the patch stack,
replace 1-extend) with this:
1append)
quilt push -a
quilt new name-of-new-patch.patch
End result should then be a clean git, except the aded patch and a
one-line change to debian/patches/series.
By default, patches are created with timestamps and other embedded
hints.
To avoid that (and a few other tricks), I have the following in the file
~/.quiltrc:
d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
if [ -d $d/debian ] && [ -z $QUILT_PATCHES ]; then
# if in Debian packaging tree with unset $QUILT_PATCHES
QUILT_PATCHES="debian/patches"
QUILT_PATCH_OPTS="--reject-format=unified"
QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
fi
To tidy existing patches, use "quilt refresh" after they are applied.
What I do to tidy a full patch series is repeat this until it fails:
quilt push && quilt refresh
Hope that helps,
- Jonas
--
* Jonas Smedegaard - idealist & Internet-arkitekt
* Tlf.: +45 40843136 Website: http://dr.jones.dk/
[x] quote me freely [ ] ask before reusing [ ] keep private
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-sugar-devel/attachments/20170421/7f61167f/attachment.sig>
More information about the pkg-sugar-devel
mailing list