[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#718362: workaround to #718362 (tracker/data/unknown-packages)



Hi,
  These two scripts might help as a workaround.

This one uses sources.debian.net
./unknown-packages.py  | grep WAT

and this one packages.qa.debian.org
./unknown-packages-pts.py | grep WAT

   I think the tracker does not depend on any external elements now. Does it 
make sense to include something like these scripts in the tracker?

Cheers, luciano
#!/usr/bin/python
from BeautifulSoup import BeautifulSoup 
import urllib2
import json
import SOAPpy

soup = BeautifulSoup(urllib2.urlopen('https://security-tracker.debian.org/tracker/data/unknown-packages').read())

pkgs=[ r('td')[0].string for r in soup('table')[0].findAll('tr')[1:] ]

ws = SOAPpy.SOAPProxy('https://packages.qa.debian.org/cgi-bin/soap-alpha.cgi')

for pkg in pkgs:
    print pkg,
    try: 
       ws.versions(source=pkg)
    except SOAPpy.faultType:
       print '<-- WAT?'
    else: print "OK"
#!/usr/bin/python
from BeautifulSoup import BeautifulSoup 
import urllib2
import json

soup = BeautifulSoup(urllib2.urlopen('https://security-tracker.debian.org/tracker/data/unknown-packages').read())

pkgs=[ r('td')[0].string for r in soup('table')[0].findAll('tr')[1:] ]

for pkg in pkgs:
    print pkg,
    try: 
       data = json.load(urllib2.urlopen('http://sources.debian.net/api/src/%s/latest/' %pkg))
    except urllib2.HTTPError as e:
       print "Unexpected error:", e
    if 'error' in data: print '<-- WAT?'
    else: print ", ".join(data['pkg_infos']['suites'])

Reply to: