~alpine/devel

setup-apkrepos: remove links dependency v1 PROPOSED

Jeff Bilyk: 1
 setup-apkrepos: remove links dependency

 1 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/devel/patches/226/mbox | git am -3
Learn more about email & git

[alpine-devel] [PATCH] setup-apkrepos: remove links dependency Export this patch

remove links dependency by using awk, sed, and grep instead of links to parse HTML
---
 setup-apkrepos.in |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/setup-apkrepos.in b/setup-apkrepos.in
index a989918..c0349b3 100755
--- a/setup-apkrepos.in
+++ b/setup-apkrepos.in
@@ -24,8 +24,8 @@ else
		# Retrieve list of versions available on mirror 2.0 and above
		wget "$MIRROR" > /dev/null 2>&1
		availablerepos=""
		for version in `links ./index.html -dump | grep "v[2-9]" | awk -F '/' '{print $1}'`; do

#		for version in `links ./index.html -dump | grep "v[2-9]" | awk -F '/' '{print $1}'`; do
		for version in `cat index.html | grep 'a href' | grep v[2-9] | awk -F 'a href' '{print $2}' | awk -F '/a' '{print $1}' | awk -F '>' '{print $2}' | sed 's/<//'`; do
			availablerepos="$availablerepos $version"
		done
		rm index.html
@@ -42,3 +42,4 @@ fi

echo "${MIRROR}${repo}/main" >> /etc/apk/repositories
apk update

-- 
1.7.3.4



---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---