~alpine/aports

3 3

[alpine-aports] Please *don't* drop prepare!

Isaac Dunham <ibid.ag@gmail.com>
Details
Message ID
<20160201020958.GA4726@newbook>
Sender timestamp
1454292599
DKIM signature
missing
Download raw message
I noticed this recent commit:
>commit 5c904717322f8113870abf48cc93c3c8b00ab4e8
>commit 68558ab72661ec5091323aca7b3ff85679220433
>Author: Sören Tempel <email hidden>
>Date:   Sun Jan 31 13:30:14 2016 +0100
>
>    testing/noice: upgrade to 0.4
>
>    diff --git a/testing/noice/APKBUILD b/testing/noice/APKBUILD
>    index c2e2eed..77a7f0b 100644
>
>...
>-prepare() {
>-	local i
>-	cd "$_builddir"
>-	for i in $source; do
>-		case $i in
>-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
>-		esac
>-	done
>-}
>-

DON'T DO THAT!

This makes it needlessly hard to add patches: the moment someone wants to
fix a problem, this bites them because they'll try adding a patch,
build, and wonder "Why on earth am I seeing the problem I just fixed?"

I just ran into this with bridge-utils.


Anyhow...
Is there a reason that this couldn't be moved to abuild?
I know that bash uses -p0 patches, which wouldn't work with this.
But other than that, it seems to be a universal constant.

Thanks,
Isaac Dunham


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20160201092107.4bb58861@ncopa-desktop.alpinelinux.org>
In-Reply-To
<20160201020958.GA4726@newbook> (view parent)
Sender timestamp
1454314867
DKIM signature
missing
Download raw message
On Sun, 31 Jan 2016 18:09:59 -0800
Isaac Dunham <ibid.ag@gmail.com> wrote:

> I noticed this recent commit:
> >commit 5c904717322f8113870abf48cc93c3c8b00ab4e8
> >commit 68558ab72661ec5091323aca7b3ff85679220433
> >Author: Sören Tempel <email hidden>
> >Date:   Sun Jan 31 13:30:14 2016 +0100
> >
> >    testing/noice: upgrade to 0.4
> >
> >    diff --git a/testing/noice/APKBUILD b/testing/noice/APKBUILD
> >    index c2e2eed..77a7f0b 100644
> >
> >...
> >-prepare() {
> >-	local i
> >-	cd "$_builddir"
> >-	for i in $source; do
> >-		case $i in
> >-		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
> >-		esac
> >-	done
> >-}
> >-  
> 
> DON'T DO THAT!
> 
> This makes it needlessly hard to add patches: the moment someone wants to
> fix a problem, this bites them because they'll try adding a patch,
> build, and wonder "Why on earth am I seeing the problem I just fixed?"
> 
> I just ran into this with bridge-utils.

+1
 
> Anyhow...
> Is there a reason that this couldn't be moved to abuild?

Not really.

> I know that bash uses -p0 patches, which wouldn't work with this.
> But other than that, it seems to be a universal constant.

I think gentoo tries various -pN variants before error. We could do something like:

patch -p1 -i .... || patch -p0 -i ...



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Timo Teras <timo.teras@iki.fi>
Details
Message ID
<20160201111925.035fedb8@vostro>
In-Reply-To
<20160201092107.4bb58861@ncopa-desktop.alpinelinux.org> (view parent)
Sender timestamp
1454318365
DKIM signature
missing
Download raw message
On Mon, 1 Feb 2016 09:21:07 +0100
Natanael Copa <ncopa@alpinelinux.org> wrote:

> On Sun, 31 Jan 2016 18:09:59 -0800
> Isaac Dunham <ibid.ag@gmail.com> wrote:
> 
> > Anyhow...
> > Is there a reason that this couldn't be moved to abuild?  
> 
> Not really.

I think the basic patching could be a dedicated block that goes to
default_prepare or so.

> > I know that bash uses -p0 patches, which wouldn't work with this.
> > But other than that, it seems to be a universal constant.  
> 
> I think gentoo tries various -pN variants before error. We could do
> something like:
> 
> patch -p1 -i .... || patch -p0 -i ...

Please don't do that. It breaks horribly if the patch is only adding
new files. I had major failures due to this kind of hackery early in
gentoo times.

I think we should just require -p1 or force user override the default
step.

Thanks,
Timo


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Details
Message ID
<20160201212908.GA19972@francium.lan>
In-Reply-To
<20160201092107.4bb58861@ncopa-desktop.alpinelinux.org> (view parent)
Sender timestamp
1454362148
DKIM signature
missing
Download raw message
On 01.02.16, Natanael Copa wrote:
> > This makes it needlessly hard to add patches: the moment someone wants to
> > fix a problem, this bites them because they'll try adding a patch,
> > build, and wonder "Why on earth am I seeing the problem I just fixed?"
> > 
> > I just ran into this with bridge-utils.
> 
> +1

I just assumed that noice was simple enough to probably never need
patches in the future, however, if it's considered a "common practice"
to always keep the prepare function than I will do so in the future.

>  
> > Anyhow...
> > Is there a reason that this couldn't be moved to abuild?
> 
> Not really.

I would also prefer it if all source files matching "*.patch" would be
applied automatically.

> > I know that bash uses -p0 patches, which wouldn't work with this.
> > But other than that, it seems to be a universal constant.
> 
> I think gentoo tries various -pN variants before error. We could do something like:
> 
> patch -p1 -i .... || patch -p0 -i ...

That can cause a lot of problems. I think the easier solution would be
to simply add an optional variable (with the default value "-p1") which
allows you to pass extra command line flags to patch(1) from the
APKBUILD itself.

Sören.


---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)