Skip to content

Commit f299ba7

Browse files
Don't consider uniqueness based on the package name, so we can parse different coreos currents
1 parent 32f16ad commit f299ba7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

scripts/kernel-crawler.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"subdirs" : [
129129
""
130130
],
131-
"page_pattern" : "/html/body//a[regex:test(@href, '^[5-9][0-9][0-9]')]/@href"
131+
"page_pattern" : "/html/body//a[regex:test(@href, '^[5-9][0-9][0-9]|current')]/@href"
132132
},
133133

134134
{
@@ -137,7 +137,7 @@
137137
"subdirs" : [
138138
""
139139
],
140-
"page_pattern" : "/html/body//a[regex:test(@href, '^[5-9][0-9][0-9]')]/@href"
140+
"page_pattern" : "/html/body//a[regex:test(@href, '^[5-9][0-9][0-9]|current')]/@href"
141141
},
142142

143143
{
@@ -146,7 +146,7 @@
146146
"subdirs" : [
147147
""
148148
],
149-
"page_pattern" : "/html/body//a[regex:test(@href, '^[4-9][0-9][0-9]')]/@href"
149+
"page_pattern" : "/html/body//a[regex:test(@href, '^[4-9][0-9][0-9]|current')]/@href"
150150
}
151151
]
152152
}
@@ -157,7 +157,7 @@
157157
# links will be found automagically without needing to write any single line of
158158
# code.
159159
#
160-
packages = {}
160+
urls = set()
161161

162162
if len(sys.argv) < 2 or not sys.argv[1] in repos:
163163
sys.stderr.write("Usage: " + sys.argv[0] + " <distro>\n")
@@ -184,13 +184,12 @@
184184
rpms = html.fromstring(page).xpath(repo["page_pattern"], namespaces = {"regex": "http://exslt.org/regular-expressions"})
185185

186186
for rpm in rpms:
187-
if not rpm in packages:
188-
packages[rpm] = source + rpm
187+
urls.add(source + rpm)
189188
except:
190189
continue
191190

192191
#
193192
# Print URLs to stdout
194193
#
195-
for rpm, url in packages.iteritems():
194+
for url in urls:
196195
print(url)

0 commit comments

Comments
 (0)