Subject: [alpine-devel] [PATCH] setup-apkrepos: remove links dependency

From: Jeff Bilyk <[email-masked]>
Date: Fri, 7 Jan 2011 17:13:17 +0000

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