Subject: [alpine-devel] Re: [PATCH] alpine-conf: add script to add dl-3 internet repos from setup-alpine script

From: Natanael Copa <[email-masked]>
Date: Tue, 28 Dec 2010 15:42:23 +0100

On Mon, 27 Dec 2010 18:10:52 -0500
Jeff Bilyk <[email-masked]> wrote:

> Hey Natanael,
> Thoughts on this patch?

sorry for beeing slow :-(

1. we should autodetect if its v2.2+ or edge. I don't think we need to
backport to pre v2.2. Also, we do not want modify this script everytiem
we make new release.

So what do you think about something like:

	release=$(cut -f1 /etc/alpine-release)
	case "$release" in
		*_git*) repo="edge";;
		[0-9]*.[0-9]*.[0-9]*)
			# release is in x.y.z format. lets cut the last
				digit
			repo=v${release%.[0-9]*};;
	esac
	
	if [ -z "$repo" ]; then
	  #prompt user
	fi

2. we should append the arch (right Timo?)

	case "$(uname -m)" in
		i[3-9]86) arch=x86;;
		x86_64) arch=x86_64;;
	esac

3. we should not have any hardcoded repo (dl-3.a.o) but we should fetch
a list of mirrors with wget and either present a choice for the users
or just pick one without any questions asked. I'd prefer the latter.

	mirror=$(wget -q -O - \
		http://www.alpinelinux.org/alpine/MIRRORS.txt \
		| head -n 1)

	url=$mirror/$repo/$arch
	...

That said, we gotta start from somewhere so I applied your patch.

Thanks for looking into this!

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Timo Teräs <[email-masked]>
Date: Tue, 28 Dec 2010 16:52:59 +0200

> 2. we should append the arch (right Timo?)

To where?

Apk-tools will auto-append that, so no, it should not be in
/etc/apk/repositories

- Timo

---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 29 Dec 2010 08:22:33 +0100

On Tue, 28 Dec 2010 16:52:59 +0200

> Apk-tools will auto-append that, so no, it should not be in

Is that supposed to work in current apk-tools, because it does not.

ncopa-desktop:~$ uname -m
x86_64
ncopa-desktop:~$ cat /etc/apk/repositories 
http://nl.alpinelinux.org/alpine/edge/main
#http://nl.alpinelinux.org/alpine/edge/main/x86_64
#http://nl.alpinelinux.org/alpine/edge/testing/x86_64

ncopa-desktop:~$ sudo apk add -v sed
(1/1) Installing sed (4.2.1-r1)
Executing busybox-1.17.4-r0.trigger
OK: 276 packages, 2688 dirs, 36927 files
ncopa-desktop:~$ file /usr/bin/sed 
/usr/bin/sed: ELF 32-bit LSB shared object, Intel 80386, version 1
(SYSV), dynamically linked (uses shared libs), stripped

hum. Maybe i need to make a git snapshot of apk-tools.

Thanks!

-nc

---

---

From: Timo Teräs <[email-masked]>
Date: Wed, 29 Dec 2010 09:24:55 +0200

> Is that supposed to work in current apk-tools, because it does not.

Implemented in commit fca1c30b801537ce35c1e4aa50331ae52c9bf567.
Not sure if it's in any pre-built binary yet.

- Timo

---

---

From: Natanael Copa <[email-masked]>
Date: Thu, 30 Dec 2010 20:49:37 +0000

On Wed, 29 Dec 2010 09:24:55 +0200

> Not sure if it's in any pre-built binary yet.

Oh, yes... I don't think its applied yet.

I'll apply it sometime you are around and have time to fix bugs. iirc
it segfaults with apk add --virtual .makedepends-foo pkg1 pkg2

-nc

---