Bug#626254: PTS Code is pretty simple
On 09/07/12 at 12:28 -0400, Scott Kitterman wrote:
> Here's the PTS code for collecting the version information from DEHS:
>
> # read info gathered from watch file scanner
> data = yaml.load(file(os.path.join(dir, "dehs.yaml")), yaml.CLoader)
> dehs = {}
> for entry in data:
> pkgname = entry["package"]
> if "status" in entry and "Newer version" in entry["status"]:
> if pkgname not in dehs:
> dehs[pkgname] = {}
> dehs[pkgname]["newer"] = str(entry["upstream-version"])
> dehs[pkgname]["url"] = entry["upstream-url"]
> if "warnings" in entry:
> if pkgname not in dehs:
> dehs[pkgname] = {}
> dehs[pkgname]["error"] = entry["warnings"]
>
> It's retrieving the yaml file from get http://qa.debian.org/cgi-bin/udd-dehs.
> This looks like a YAML file with the following format:
>
> -
> debian-mangled-uversion: 1.4.2
> debian-uversion: 1.4.2~dfsg0
> package: qlandkartegt
> status: up to date
> upstream-url:
> http://qa.debian.org/watch/sf.php/qlandkartegt/qlandkartegt-1.4.2.tar.gz
> upstream-version: 1.4.2
>
> Possible status results are:
>
> "up to date"
> "Debian version newer than remote site"
> "Newer version available"
>
> Packages for which there is no information don't seem to to appear at all.
>
> If UDD could output such a file and we could change the location the PTS was
> pulling from, then we could get this part of it back in business. Is that a
> reasonable approach?
What about http://udd.debian.org/cgi-bin/upstream-status.json.cgi ?
Note: it's JSON, not YAML. I could do YAML if that's a problem.
It also includes paragraphs with status=error. You might want to
filter then out.
Lucas
Reply to: