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

From: Isaac Dunham <[email-masked]>
Date: Sun, 31 Jan 2016 18:09:59 -0800

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:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 1 Feb 2016 09:21:07 +0100

On Sun, 31 Jan 2016 18:09:59 -0800

> I just ran into this with bridge-utils.

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

Not really.

> 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 ...

---

---

From: Timo Teras <[email-masked]>
Date: Mon, 1 Feb 2016 11:19:25 +0200

On Mon, 1 Feb 2016 09:21:07 +0100

> > Is there a reason that this couldn't be moved to abuild?  

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

> 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

---

---

From: Sören Tempel <[email-masked]>
Date: Mon, 1 Feb 2016 22:29:08 +0100

> > I just ran into this with bridge-utils.

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.

> > Is there a reason that this couldn't be moved to abuild?

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

> 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.

---