File: ScanTwHistory

package info (click to toggle)
libzypp 17.38.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 27,744 kB
  • sloc: cpp: 132,661; xml: 2,587; sh: 518; python: 266; makefile: 27
file content (32 lines) | stat: -rwxr-xr-x 836 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3

import urllib3
import sys
import re

p = re.compile('.*debuginfo.*')

http = urllib3.PoolManager()
r = http.request('GET', 'http://download.opensuse.org/history/list')
if ( r.status != 200 ):
  print("Failed to download history list\n")
  sys.exit(1)

html = r.data.decode("utf-8")
list = html.split("\n")  

for i in list:
  if ( len(i) == 0 ):
    continue
  print ( "Searching for history in: "+i )
  rEntries = http.request('GET', "http://download.opensuse.org/history/"+i.strip()+"/rpm.list", preload_content=False )
  if ( rEntries.status != 200 ):
    print("Failed to download history database for "+i+"\n")
    continue
  
  for line in rEntries:
    if ( p.search( line.decode() ) ):
       print("Found match: "+line.decode()+" in: "+"http://download.opensuse.org/history/"+i.strip() )


print("Done")