Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: [1]
Author Topic: Prefix Level (-p# option) in Plugins
Posts: 58
Post Prefix Level (-p# option) in Plugins
on: October 5, 2012, 00:24

I've been submitting some patches to automate the handling of patches to OpenWRT during the build phase inside DebWRT. The issue of whether to strip filename prefixes when applying patches has come up. When originally implemented, plugins/plugins.mk was set to run with `patch -p1`, which will strip one level of directories off filenames. Things are now set for unifying the handling of plugin patches to OpenWRT with DebWRT's own patches to OpenWRT. Issue is, DebWRT's patches were set for using `patch -p0`.

One advantage of using -p1 is if plugins were to commonly use patches from other sources, patches are most often set for application outside the directory with -p0 or inside with -p1. Meanwhile using -p0 keeps the patches a little smaller and can potentially be clearer if you need to look at a patch.

Maybe I'm over-thinking this, since when it comes down to it, running

`sed -e's/^+++ /+++ openwrt\//' -e's/^--- /--- openwrt.orig\//' -i`

will convert a patch from -p0 to -p1 and running

`sed -e's/^\(\(+++\)\|\(---\)\) [^\/]*\//\1 /'` -i

will convert a patch from -p1 to -p0.

Any opinions/advice about which way things should go?

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.016 seconds.