euscan: Adding naive deb handler, TODO updated
Signed-off-by: volpino <fox91@anche.no>
This commit is contained in:
parent
4b29c6db2b
commit
0203a465ee
18
TODO
18
TODO
@ -41,12 +41,18 @@ packages:
|
|||||||
|
|
||||||
### handlers
|
### handlers
|
||||||
|
|
||||||
- freecode: to scan freecode.com
|
- remote-id type deb repository:
|
||||||
- remote-id: type deb repository. Example I always scan:
|
- Fix handler to support Packages.gz or Packages.bz2
|
||||||
http://dl.google.com/linux/musicmanager/deb/dists/stable/main/binary-i386/Packages
|
- find out how to get download url
|
||||||
to see if google has release an update, same would help for all google
|
|
||||||
packages and some of the actual debian packages.
|
### remote-id
|
||||||
Something similar could be done for rpm repositories.
|
- Propose new remote-id: deb
|
||||||
|
e.g.: <remote-id type="deb">
|
||||||
|
http://mysite.com/deb/dists/stable/main/binary-i386/Packages
|
||||||
|
</remote-id>
|
||||||
|
- Propose new remote-id: freecode
|
||||||
|
e.g.: <remote-id type="freecode">projectname</remote-id>
|
||||||
|
|
||||||
|
|
||||||
euscanwww
|
euscanwww
|
||||||
---------
|
---------
|
||||||
|
46
pym/euscan/handlers/deb.py
Normal file
46
pym/euscan/handlers/deb.py
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
import urllib
|
||||||
|
import re
|
||||||
|
|
||||||
|
import portage
|
||||||
|
|
||||||
|
from euscan import mangling, helpers, output
|
||||||
|
|
||||||
|
HANDLER_NAME = "deb"
|
||||||
|
CONFIDENCE = 100
|
||||||
|
PRIORITY = 90
|
||||||
|
|
||||||
|
|
||||||
|
def can_handle(pkg, url=None):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def scan_pkg(pkg, options):
|
||||||
|
cp, ver, rev = portage.pkgsplit(pkg.cpv)
|
||||||
|
|
||||||
|
packages_url, package_name = options['data'].strip().split(" ", 1)
|
||||||
|
|
||||||
|
output.einfo("Using Debian Packages: " + packages_url)
|
||||||
|
|
||||||
|
fp = urllib.urlopen(packages_url)
|
||||||
|
content = fp.read()
|
||||||
|
|
||||||
|
# TODO: Add support for .gz and .bz2 Packages file
|
||||||
|
|
||||||
|
content = content.split("\n\n")
|
||||||
|
|
||||||
|
result = []
|
||||||
|
|
||||||
|
for package_info in content:
|
||||||
|
for line in package_info.split("\n"):
|
||||||
|
res = re.search("^Version: (.*)$", line)
|
||||||
|
if res:
|
||||||
|
result.append(res.group(1))
|
||||||
|
|
||||||
|
ret = []
|
||||||
|
for up_pv in result:
|
||||||
|
url = "" # TODO: How to find the url?
|
||||||
|
pv = mangling.mangle_version(up_pv, options)
|
||||||
|
if helpers.version_filtered(cp, ver, pv):
|
||||||
|
continue
|
||||||
|
ret.append((url, pv, HANDLER_NAME, CONFIDENCE))
|
||||||
|
return ret
|
@ -17,7 +17,7 @@ def can_handle(pkg, url=None):
|
|||||||
def scan_pkg(pkg, options):
|
def scan_pkg(pkg, options):
|
||||||
cp, ver, rev = portage.pkgsplit(pkg.cpv)
|
cp, ver, rev = portage.pkgsplit(pkg.cpv)
|
||||||
|
|
||||||
package = options['data']
|
package = options['data'].strip()
|
||||||
|
|
||||||
output.einfo("Using FreeCode handler: " + package)
|
output.einfo("Using FreeCode handler: " + package)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user