File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ function build_sysdigcloud {
118118
119119function coreos_build_old {
120120 VERSION_URL=$1
121- VERSION_NUMBER=$( echo $VERSION_URL | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+ ' )
121+ VERSION_NUMBER=$2
122122 COREOS_DIR=" coreos-" $VERSION_NUMBER
123123
124124 if [ ! -d $COREOS_DIR ]; then
@@ -175,7 +175,7 @@ function coreos_build_old {
175175
176176function coreos_build_new {
177177 VERSION_URL=$1
178- VERSION_NUMBER=$( echo $VERSION_URL | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+ ' )
178+ VERSION_NUMBER=$2
179179 COREOS_DIR=" coreos-" $VERSION_NUMBER
180180
181181 if [ ! -d $COREOS_DIR ]; then
@@ -409,12 +409,11 @@ URLS="$($DIR/kernel-crawler.py CoreOS)"
409409
410410for URL in $URLS
411411do
412- FULL_VERSION=$( echo $URL | cut -d/ -f5)
413- MAJOR_VERSION=$( echo $FULL_VERSION | cut -d. -f1)
414- if [ $MAJOR_VERSION -gt 890 ]; then
415- coreos_build_new $URL
412+ eval $( curl -s ${URL} version.txt)
413+ if [ $COREOS_BUILD -gt 890 ]; then
414+ coreos_build_new $URL $COREOS_VERSION
416415 else
417- coreos_build_old $URL
416+ coreos_build_old $URL $COREOS_VERSION
418417 fi
419418done
420419
Original file line number Diff line number Diff line change 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 {
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 {
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}
157157# links will be found automagically without needing to write any single line of
158158# code.
159159#
160- packages = {}
160+ urls = set ()
161161
162162if len (sys .argv ) < 2 or not sys .argv [1 ] in repos :
163163 sys .stderr .write ("Usage: " + sys .argv [0 ] + " <distro>\n " )
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 )
You can’t perform that action at this time.
0 commit comments