From f6255af7f36187b6efe62a4ec2c69119aa2eb004 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sun, 7 Feb 2010 13:55:50 +0100 Subject: angstrom feed sorter: add archos5it support --- contrib/angstrom/sort.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh index 88f0fb92f9..6c42a095b3 100755 --- a/contrib/angstrom/sort.sh +++ b/contrib/angstrom/sort.sh @@ -58,7 +58,7 @@ case "$arch" in "armv7") machines="" ;; "armv7a") - machines="archos5 palmpre cm-t35 igep0020 omap3-touchbook beagleboard omap3evm am3517-evm omap3517-evm omap3-pandora omapzoom omapzoom2 overo" ;; + machines="archos5 archos5it palmpre cm-t35 igep0020 omap3-touchbook beagleboard omap3evm am3517-evm omap3517-evm omap3-pandora omapzoom omapzoom2 overo" ;; "avr32") machines="atngw100 at32stk1000" ;; "bfin") -- cgit v1.2.3 From dd269e0e8b9cf892ddb92043beeb4702efcee014 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Wed, 10 Feb 2010 18:05:06 +0100 Subject: check-kernel-updates: simple shell script to check for versions of stable kernels Signed-off-by: Marcin Juszkiewicz --- contrib/hrw/check-kernel-updates.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 contrib/hrw/check-kernel-updates.sh (limited to 'contrib') diff --git a/contrib/hrw/check-kernel-updates.sh b/contrib/hrw/check-kernel-updates.sh new file mode 100644 index 0000000000..389265a057 --- /dev/null +++ b/contrib/hrw/check-kernel-updates.sh @@ -0,0 +1,9 @@ + +echo "fetching list of changelogs" +#echo "ls ChangeLog-*" |lftp ftp://www.kernel.org/pub/linux/kernel/v2.6/> changes.txt + +for release in `seq 16 32`; +do + LATEST=`grep ChangeLog-2.6.$release changes.txt | sed -e "s/^.*ChangeLog-2.6.$release.//g"| sort -n -r|head -n1` + echo "latest patch: 2.6.$release.$LATEST" +done -- cgit v1.2.3 From 6687b01b725288ae365b776c7545324bfc3abb8e Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Fri, 12 Feb 2010 22:53:27 +0000 Subject: omap3-mkcard.sh : make fdisk parsing a little more robust --- contrib/angstrom/omap3-mkcard.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/angstrom/omap3-mkcard.sh b/contrib/angstrom/omap3-mkcard.sh index dc4359c38c..d8b5b4373d 100755 --- a/contrib/angstrom/omap3-mkcard.sh +++ b/contrib/angstrom/omap3-mkcard.sh @@ -6,7 +6,7 @@ # Parts of the procudure base on the work of Denys Dmytriyenko # http://wiki.omap.com/index.php/MMC_Boot_Format -LC_ALL=C +export LC_ALL=C if [ $# -ne 1 ]; then echo "Usage: $0 " @@ -17,7 +17,7 @@ DRIVE=$1 dd if=/dev/zero of=$DRIVE bs=1024 count=1024 -SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'` +SIZE=`fdisk -l $DRIVE | grep Disk | grep bytes | awk '{print $5}'` echo DISK SIZE - $SIZE bytes -- cgit v1.2.3 From 0452a571a031a9977b5096780d33a5bcc9d26bad Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Mon, 22 Feb 2010 10:47:03 +0100 Subject: angstrom feed sorter: qemux86 changed arch --- contrib/angstrom/sort.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh index 6c42a095b3..ce2959b134 100755 --- a/contrib/angstrom/sort.sh +++ b/contrib/angstrom/sort.sh @@ -69,9 +69,9 @@ case "$arch" in "i486") machines="x86" ;; "i586") - machines="epia qemux86" ;; + machines="epia" ;; "i686") - machines="eee701 guinness progear" ;; + machines="eee701 qemux86 guinness progear" ;; "iwmmxt") machines="" ;; "ppc405") -- cgit v1.2.3 From 2d8dc03f6f7e5670890257cbb1ece8eeed7e1aa0 Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Tue, 23 Feb 2010 12:01:36 -0500 Subject: weekly-changelog-report.py: add staging-branch --- contrib/weekly-changelog-report.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'contrib') diff --git a/contrib/weekly-changelog-report.py b/contrib/weekly-changelog-report.py index 902089bdad..b477c7910b 100755 --- a/contrib/weekly-changelog-report.py +++ b/contrib/weekly-changelog-report.py @@ -21,14 +21,20 @@ end_day = today - datetime.timedelta(today_weekday) start_day = end_day - datetime.timedelta(7) +print "=====================================================" print "OE weekly changelog %s to %s\n" % (start_day.isoformat(), end_day.isoformat()) os.system("git shortlog --since=%s --until=%s | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat())) +print "=====================================================" +print "Staging branch (holger/staging-branch) weekly changelog %s to %s\n" % (start_day.isoformat(), end_day.isoformat()) +os.system("git shortlog --since=%s --until=%s origin/holger/staging-branch | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat())) + os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&known_name=1WFixed&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=RESOLVED%2CVERIFIED%2CCLOSED&value0-0-0=&ctype=csv' -O resolved-bugs.csv >& /dev/null") os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=NEW&bugidtype=include&chfield=%5BBug%20creation%5D&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=NEW&value0-0-0=&ctype=csv' -O new-bugs.csv &> /dev/null") +print "=====================================================" print "Bugs fixed:\n" os.system("cat resolved-bugs.csv | awk -F, '{print $1 \" \" $7 \"\t \" $8}' | sed s:\\\"::g") -- cgit v1.2.3 From dc99213ca3d937474fb9e2c85dc7a674a1654f2e Mon Sep 17 00:00:00 2001 From: Cliff Brake Date: Thu, 25 Feb 2010 08:24:10 -0500 Subject: weekly-changelog-report: make script more general make script general for any branch, and create wrapper script --- contrib/weekly-changelog-report.py | 17 +++++++++++------ contrib/weekly-changelog-report.sh | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+), 6 deletions(-) create mode 100755 contrib/weekly-changelog-report.sh (limited to 'contrib') diff --git a/contrib/weekly-changelog-report.py b/contrib/weekly-changelog-report.py index b477c7910b..e52a70e52c 100755 --- a/contrib/weekly-changelog-report.py +++ b/contrib/weekly-changelog-report.py @@ -10,6 +10,8 @@ import datetime import os +import sys +import string today = datetime.date.today() @@ -21,14 +23,17 @@ end_day = today - datetime.timedelta(today_weekday) start_day = end_day - datetime.timedelta(7) -print "=====================================================" -print "OE weekly changelog %s to %s\n" % (start_day.isoformat(), end_day.isoformat()) +if (len(sys.argv) <= 1): + branch = "origin/org.openembedded.dev" +else: + branch = sys.argv[1] -os.system("git shortlog --since=%s --until=%s | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat())) +branch_pretty = string.replace(branch, "origin/", "") -print "=====================================================" -print "Staging branch (holger/staging-branch) weekly changelog %s to %s\n" % (start_day.isoformat(), end_day.isoformat()) -os.system("git shortlog --since=%s --until=%s origin/holger/staging-branch | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat())) +print "OE weekly changelog for %s, %s to %s\n" % (branch_pretty, start_day.isoformat(), end_day.isoformat()) +os.system("git shortlog --since=%s --until=%s %s | grep -v 'Merge branch' | grep -v 'Merge commit'|sed -e 's/^ //g'|cut -b -78 " % (start_day.isoformat(), end_day.isoformat(), branch)) + +sys.exit(0) os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&known_name=1WFixed&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=RESOLVED%2CVERIFIED%2CCLOSED&value0-0-0=&ctype=csv' -O resolved-bugs.csv >& /dev/null") os.system("wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=NEW&bugidtype=include&chfield=%5BBug%20creation%5D&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=NEW&value0-0-0=&ctype=csv' -O new-bugs.csv &> /dev/null") diff --git a/contrib/weekly-changelog-report.sh b/contrib/weekly-changelog-report.sh new file mode 100755 index 0000000000..3bdafcdc17 --- /dev/null +++ b/contrib/weekly-changelog-report.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +echo "=====================================================" +./contrib/weekly-changelog-report.py +echo +echo "=====================================================" +./contrib/weekly-changelog-report.py origin/holger/staging-branch +echo + +wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&bugidtype=include&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&known_name=1WFixed&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=RESOLVED%2CVERIFIED%2CCLOSED&value0-0-0=&ctype=csv' -O resolved-bugs.csv >& /dev/null + +wget 'http://bugs.openembedded.net/buglist.cgi?bug_file_loc=&bug_file_loc_type=allwordssubstr&bug_id=&bug_status=NEW&bugidtype=include&chfield=%5BBug%20creation%5D&chfieldfrom=7d&chfieldto=Now&chfieldvalue=&email1=&email2=&emailassigned_to1=1&emailassigned_to2=1&emailcc2=1&emailqa_contact2=1&emailreporter2=1&emailtype1=substring&emailtype2=substring&field-1-0-0=bug_status&field0-0-0=noop&long_desc=&long_desc_type=substring&query_format=advanced&remaction=&short_desc=&short_desc_type=allwordssubstr&type-1-0-0=anyexact&type0-0-0=noop&value-1-0-0=NEW&value0-0-0=&ctype=csv' -O new-bugs.csv &> /dev/null + +echo "=====================================================" +echo "Bugs fixed:" +cat resolved-bugs.csv | awk -F, '{print $1 " " $7 "\t " $8}' | sed s:\\\"::g + +echo +echo "Bugs opened:" +cat new-bugs.csv | awk -F, '{print $1 " " $7 "\t " $8}' | sed s:\\\"::g + -- cgit v1.2.3 From f3d6c69826ab936a976d298be15b1a1536b6880e Mon Sep 17 00:00:00 2001 From: Steffen Sledz Date: Fri, 12 Mar 2010 09:34:32 +0100 Subject: angstrom: add hipox machine to feed sorter --- contrib/angstrom/sort.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh index ce2959b134..2e2cefaac6 100755 --- a/contrib/angstrom/sort.sh +++ b/contrib/angstrom/sort.sh @@ -48,7 +48,7 @@ case "$arch" in "armv4t") machines="micro2440 ep93xx h6300 om-gta01 om-gta02 fic-gta01 fic-gta02" ;; "armv5te") - machines="hawkboard da850-omapl138-evm da830-omapl137-evm htcalpine dm6446-evm dm6467-evm dm6467t-evm dm355-evm dm365-evm dm357-evm topas910 sheevaplug openrd-client openrd-base dm355-leopard n2100 dns323 mv2120 kuropro lspro tsx09 ts409 davinci-dvevm davinci-sffsdr neuros-osd neuros-osd2 gumstix-connex gumstix-verdex gumstix e680 a780 a1200 at91sam9263ek rokre6 rokre2 rokr-e2 akita c7x0 h2200 h3900 h4000 h5000 htcapache htctornado htcblueangel htcuniversal hx4700 nslu2le hx2000 ixp4xxle magician netbook-pro nokia770 palmt650 palmt680 palmld palmtx palmtt3 palmz72 qemuarm omap5912osk poodle spitz tosa mx27ads at91sam9g20ek mainstone" ;; + machines="hawkboard da850-omapl138-evm da830-omapl137-evm htcalpine dm6446-evm dm6467-evm dm6467t-evm dm355-evm dm365-evm dm357-evm topas910 sheevaplug openrd-client openrd-base dm355-leopard n2100 dns323 mv2120 kuropro lspro tsx09 ts409 davinci-dvevm davinci-sffsdr neuros-osd neuros-osd2 gumstix-connex gumstix-verdex gumstix e680 a780 a1200 at91sam9263ek rokre6 rokre2 rokr-e2 akita c7x0 h2200 h3900 h4000 h5000 htcapache htctornado htcblueangel htcuniversal hx4700 nslu2le hx2000 ixp4xxle magician netbook-pro nokia770 palmt650 palmt680 palmld palmtx palmtt3 palmz72 qemuarm omap5912osk poodle spitz tosa mx27ads at91sam9g20ek mainstone hipox" ;; "armv5teb") machines="ixp4xxbe nslu2be" ;; "armv6-novfp") -- cgit v1.2.3 From ccc8a55321a9795e67a34b205eb499c5f3a71fc0 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 16 Mar 2010 07:52:47 +0100 Subject: contrib/qa/oe_audit.py: Add audit script Add my script to compare a FreeBSD auditfile with a list of package names as output by bitbake -s. --- contrib/qa/oe_audit.py | 184 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100755 contrib/qa/oe_audit.py (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py new file mode 100755 index 0000000000..c0ac9c0aa0 --- /dev/null +++ b/contrib/qa/oe_audit.py @@ -0,0 +1,184 @@ +#!/usr/bin/env python + +def read_available(filename): + """ + Parses the output of bitbake -s + minus the first few lines + """ + f = open(filename) + packages = {} + + for line in f: + # str.split can not be used as we have multiple whitespace + first_space = line.find(" ") + package = line[0:first_space] + rest = line[first_space+1:] + pv = rest.strip().split(" ")[0] + + packages[package] = pv + return packages + + +def map_names(str): + """Map a FreeBSD name to OE""" + maps = { + "libpurple" : "pidgin", + "php4" : "php", + "php5" : "php", + "expat2" : "expat", + "freeciv-gtk" : "freeciv", + "pcre" : "libpcre", + "vim-gnome" : "vim", + "python23" : "python", + "python24" : "python", + "python25" : "python", + "python+ipv6" : "python", + "wget-devel" : "wget", + "xchat2" : "xchat", + "freetype" : "freetype", + "qemu-devel" : "qemu", + "krb5-beta" : "krb5", + "freeciv-gtk2": "freeciv", + } + + try: + return maps[str] + except: + return str + +def is_not_in_oe(name): + """Method to reject packages not in OE""" + not_in = [ + "openoffice.org-2-devel", + "linux-firefox", "fr-linux-netscape", "linux-netscape-{communicator,navigator}", + "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", + ] + + return name in not_in + +class freebsd_info: + """ + Handles an entry like the one below: + vulnerability-test-port>=2000<2010.02.26|http://cvsweb.freebsd.org/ports/security/vulnerability-test-port/|Not vulnerable, just a test port (database: 2010-02-26) + """ + def __init__(self, line): + split = line.split("|") + for i in range(0, len(split[0])): + c = split[0][i] + if c != '<' and c != '=' and c != '>': + continue + self.name = map_names(split[0][0:i]) + self.versions = self.split_versions(split[0][i:]) + break + + self.link = split[1] + self.kind = split[2] + + @classmethod + def split_versions(self, input): + """ + Split versions by <, >, >=, >= + """ + versions = [] + last_pos = 0 + + # Try to determine <, >, >=, <= + # we will have to carry stuff on to find the + # version.. + i = 0 + while i < len(input) - 1: + c1 = input[i] + c2 = input[i+1] + if c1 != '<' and c1 != '>' and c1 != '=': + i = i + 1 + continue + + # is a '=' coming behind it? + next = i + 1 + if c2 == '=': + next = next + 1 + + # submit + if last_pos != 0: + versions.append((next_type, input[last_pos:i])) + + # remember stuff + next_type = input[i:next] + last_pos = next + i = next + + assert last_pos != 0 + versions.append((next_type, input[last_pos:len(input)])) + return versions + + def __repr__(self): + return "%s: %s" % (self.name, self.versions) + +def read_auditfile(filename): + """ + Read an uncompressed audit file from freebsd + """ + f = open(filename) + packages = {} + for line in f: + if line.startswith("#"): + continue + + info = freebsd_info(line) + try: + packages[info.name].append(info) + except: + packages[info.name] = [] + packages[info.name].append(info) + return packages + + +def strip_oe_version(oe_version): + """ + We need to strip the package epoch... and the PR to compare + it to the FreeBSD versions. Also FreeBSD seems to use _N as + PR so we might need to do more.. + """ + split = oe_version.split(':', 1) + ver = split[1] + + split = ver.rsplit('-r', 1) + ver = split[0] + return ver + +def strip_bsd_version(bsd_version): + """ + FreeBSD is adding ,1 for revisions.. remove that + """ + split = bsd_version.rsplit(',', 1) + return split[0] + +def compare_versions(oe, freebsd, not_known): + def handle_package(oe_name, bsd_name): + if not oe_name in oe: + if oe_name == bsd_name: + print >> not_known, "%s is not in OE" % oe_name + return + + oe_version = strip_oe_version(oe[oe_name]) + for ver in freebsd[bsd_name]: + str = [] + for (cmp, vers) in ver.versions: + bsd_ver = strip_bsd_version(vers) + str.append("%s %s %s %s" % (oe_name, oe_version, cmp, bsd_ver)) + print " && ".join(str), ver.link + + for package in freebsd.keys(): + # handle the various versions of OE packages + handle_package(package, package) + handle_package("%s-native" % package, package) + handle_package("%s-full-native" % package, package) + handle_package("%s-sdk" % package, package) + + +# read the input data +oe_packages = read_available("available") +freebsd_vuln = read_auditfile("auditfile") +buggy = open("not_in_oe.bugs", "w+") + +compare_versions(oe=oe_packages, freebsd=freebsd_vuln, not_known=buggy) -- cgit v1.2.3 From c574f947e3b88e412b77f45a3b969c6251f5dd56 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Tue, 16 Mar 2010 10:37:24 +0100 Subject: check-kernel-updates.sh: really fetch list Signed-off-by: Marcin Juszkiewicz --- contrib/hrw/check-kernel-updates.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/hrw/check-kernel-updates.sh b/contrib/hrw/check-kernel-updates.sh index 389265a057..7758baf69d 100644 --- a/contrib/hrw/check-kernel-updates.sh +++ b/contrib/hrw/check-kernel-updates.sh @@ -1,6 +1,6 @@ echo "fetching list of changelogs" -#echo "ls ChangeLog-*" |lftp ftp://www.kernel.org/pub/linux/kernel/v2.6/> changes.txt +echo "ls ChangeLog-*" |lftp ftp://www.kernel.org/pub/linux/kernel/v2.6/> changes.txt for release in `seq 16 32`; do -- cgit v1.2.3 From 9e8743297d49e37e9be3e217a5cf735cc694bc57 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 16 Mar 2010 08:23:53 +0100 Subject: oe_audit.py: Ignore packets that are not in OE Split the list in two parts with packets that will be never in OE and thet ones that are not in OE right now. --- contrib/qa/oe_audit.py | 70 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 20 deletions(-) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index c0ac9c0aa0..132adca143 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -39,6 +39,14 @@ def map_names(str): "qemu-devel" : "qemu", "krb5-beta" : "krb5", "freeciv-gtk2": "freeciv", + "gtk" : "gtk+", + "wget+ipv6" : "wget", + "ja-gd" : "gd", + "openvpn-devel" : "openvpn", + "mpeg123-esound" : "mpeg123", + "mpeg123-nas" : "mpeg123", + "cdrtools-cjk" : "cdrtools", + "apache+mod_ssl+mod_deflate" : "apache2", } try: @@ -49,9 +57,20 @@ def map_names(str): def is_not_in_oe(name): """Method to reject packages not in OE""" not_in = [ - "openoffice.org-2-devel", + # packages that we will never have... "linux-firefox", "fr-linux-netscape", "linux-netscape-{communicator,navigator}", - "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", + "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", "zhTW-linux-mozillafirebird", "ja-linux-mozillafirebird-gtk1", "el-linux-mozillafirebird", + "acroread4", "acroread7", + "linux-openmotif", "linux-flock", "linux-jdk", "linux-curl", + + # packages that we don't have now but maybe will have in + # the future and blacklisting them here might be a problem + "openoffice.org-2-devel", "openoffice.org-2", "it-openoffice", "ca-openoffice","sl-openoffice-SI" + "drupal4", "drupal5", "drupal6", + "gpdf", + "nagios", + "kdenetwork", "ja-kdelibs", + "xemacs-devel", "xemacs-devel-21.5", "xemacs-mule", "zh-xemacs", ] return name in not_in @@ -61,18 +80,10 @@ class freebsd_info: Handles an entry like the one below: vulnerability-test-port>=2000<2010.02.26|http://cvsweb.freebsd.org/ports/security/vulnerability-test-port/|Not vulnerable, just a test port (database: 2010-02-26) """ - def __init__(self, line): - split = line.split("|") - for i in range(0, len(split[0])): - c = split[0][i] - if c != '<' and c != '=' and c != '>': - continue - self.name = map_names(split[0][0:i]) - self.versions = self.split_versions(split[0][i:]) - break - - self.link = split[1] - self.kind = split[2] + def __init__(self, name, versions, link, kind): + self.name = name + self.versions = versions + self.link = link @classmethod def split_versions(self, input): @@ -114,6 +125,24 @@ class freebsd_info: def __repr__(self): return "%s: %s" % (self.name, self.versions) +def create_infos(line): + split = line.split("|") + for i in range(0, len(split[0])): + c = split[0][i] + if c != '<' and c != '=' and c != '>': + continue + name = map_names(split[0][0:i]) + versions = freebsd_info.split_versions(split[0][i:]) + break + + if is_not_in_oe(name): + print "Not in oe %s" % name + return [] + + link = split[1] + kind = split[2] + return [freebsd_info(name, versions, link, kind)] + def read_auditfile(filename): """ Read an uncompressed audit file from freebsd @@ -124,12 +153,13 @@ def read_auditfile(filename): if line.startswith("#"): continue - info = freebsd_info(line) - try: - packages[info.name].append(info) - except: - packages[info.name] = [] - packages[info.name].append(info) + infos = create_infos(line) + for info in infos: + try: + packages[info.name].append(info) + except: + packages[info.name] = [] + packages[info.name].append(info) return packages -- cgit v1.2.3 From 87c53fe1e5dc6f011f6b2397e95ce1d0dd093dea Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 16 Mar 2010 11:07:06 +0100 Subject: oe_audit.py: Upgrade list of packet match --- contrib/qa/oe_audit.py | 45 ++++++++++++++++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 7 deletions(-) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 132adca143..71658029da 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -47,6 +47,35 @@ def map_names(str): "mpeg123-nas" : "mpeg123", "cdrtools-cjk" : "cdrtools", "apache+mod_ssl+mod_deflate" : "apache2", + "apache+mod_ssl*" : "apache2", + "vim-gtk2" : "vim", + "zh-emacs" : "emacs", + "{ja-,}bugzilla" : "bugzilla", + "zh-tin" : "tin", + "mozilla+ipv6": "mozilla", + "mozilla-embeddded" : "mozilla", + "rar" : "unrar", + "libsndfile" : "libsndfile1", + "sylpheed-gtk2": "sylpheed", + "cdrtools-devel": "cdrtools", + "pine4-ssl": "pine", + "apache" : "apache2", + "ghostscript-gpl" : "gs", + "ghostscript-gnu-nox11" : "gs", + "ghostscript8" : "gs", + "ghostscript-afpl-nox11" : "gs", + "ghostscript-afpl" : "gs", + "isc-dhcp" : "dhcp", + "mplayer-gtk" : "mplayer", + "xerces-c2" : "xerces-c", + "libxml" : "libxml2", + "vim+ruby" : "vim", + "mplayer{,-gtk}{,-esound}" : "mplayer", + "proftpd-devel": "proftpd", + "neon28" : "neon", + "php4-dba" : "php", + "php5-{cgi,cli}" : "php", + } try: @@ -59,18 +88,20 @@ def is_not_in_oe(name): not_in = [ # packages that we will never have... "linux-firefox", "fr-linux-netscape", "linux-netscape-{communicator,navigator}", - "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", "zhTW-linux-mozillafirebird", "ja-linux-mozillafirebird-gtk1", "el-linux-mozillafirebird", - "acroread4", "acroread7", - "linux-openmotif", "linux-flock", "linux-jdk", "linux-curl", + "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", "zhTW-linux-mozillafirebird", "ja-linux-mozillafirebird-gtk1", "el-linux-mozillafirebird", "mozilla-firebird", "netscape7", + "acroread4", "acroread7", "acroread5", + "linux-openmotif", "linux-flock", "linux-jdk", "linux-curl", "linux-png", "linux-firefox-devel", # packages that we don't have now but maybe will have in # the future and blacklisting them here might be a problem - "openoffice.org-2-devel", "openoffice.org-2", "it-openoffice", "ca-openoffice","sl-openoffice-SI" - "drupal4", "drupal5", "drupal6", + "openoffice.org-2-devel", "openoffice.org-2", "it-openoffice", "ca-openoffice","sl-openoffice-SI", "ja-openoffice", + "drupal4", "drupal5", "drupal6", "drupal-pubcookie", "gpdf", "nagios", - "kdenetwork", "ja-kdelibs", - "xemacs-devel", "xemacs-devel-21.5", "xemacs-mule", "zh-xemacs", + "kdenetwork", "ja-kdelibs", "kdegraphics", "kdepim", "kdebase4-runtime", + "xemacs-devel", "xemacs-devel-21.5", "xemacs-mule", "zh-xemacs", "zh-xemacs-mule", + "geeklog", "apach13-ssl", "nvidia-driver", "eGroupWare", "varnish", "heimdal", + "bugzilla", "agenda-snow-libs", "mozilla", ] return name in not_in -- cgit v1.2.3 From 690e114ba85eec8693957d204079d9b770ffec5c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 16 Mar 2010 11:07:41 +0100 Subject: oe_audit.py: Print only vulnerabe software --- contrib/qa/oe_audit.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 71658029da..6a820cd618 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -1,5 +1,7 @@ #!/usr/bin/env python +import bb + def read_available(filename): """ Parses the output of bitbake -s @@ -212,6 +214,8 @@ def strip_bsd_version(bsd_version): FreeBSD is adding ,1 for revisions.. remove that """ split = bsd_version.rsplit(',', 1) + split = split[0] + split = split.rsplit('_', 1) return split[0] def compare_versions(oe, freebsd, not_known): @@ -223,11 +227,37 @@ def compare_versions(oe, freebsd, not_known): oe_version = strip_oe_version(oe[oe_name]) for ver in freebsd[bsd_name]: + affected = True str = [] for (cmp, vers) in ver.versions: bsd_ver = strip_bsd_version(vers) + cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, 'r0')) + if cmp == '<': + if cmp_res >= 0: + affected = False + pass + elif cmp == '<=': + if cmp_res > 0: + affected = False + pass + elif cmp == '>': + if cmp_res <= 0: + affected = False + pass + elif cmp == '>=': + if cmp_res < 0: + affected = False + pass + elif cmp == '=': + if cmp_res > 0: + affected = False + else: + print cmp + assert True + str.append("%s %s %s %s" % (oe_name, oe_version, cmp, bsd_ver)) - print " && ".join(str), ver.link + if affected: + print " && ".join(str), ver.link for package in freebsd.keys(): # handle the various versions of OE packages -- cgit v1.2.3 From 0785f3f8ca3d3373c481d44cf4f367120fb1d185 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 17 Mar 2010 09:19:15 +0100 Subject: angstrom feed sorter: add smdk6410 --- contrib/angstrom/sort.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh index 2e2cefaac6..f18a1e5651 100755 --- a/contrib/angstrom/sort.sh +++ b/contrib/angstrom/sort.sh @@ -54,7 +54,7 @@ case "$arch" in "armv6-novfp") machines="htcdiamond htckaiser htcpolaris htcraphael htcvogue" ;; "armv6") - machines="smartq5 bug mx31ads nokia800 " ;; + machines="smdk6410 smartq5 bug mx31ads nokia800 " ;; "armv7") machines="" ;; "armv7a") -- cgit v1.2.3 From 1d85542eb64ec28aae9b70694b4f8b7680b42c0d Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 18 Mar 2010 13:51:10 +0100 Subject: oe_audit.py: Document a bug which was uncovered on chat --- contrib/qa/oe_audit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 6a820cd618..7e04480626 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -169,7 +169,7 @@ def create_infos(line): break if is_not_in_oe(name): - print "Not in oe %s" % name + #print "Not in oe %s" % name return [] link = split[1] @@ -213,6 +213,7 @@ def strip_bsd_version(bsd_version): """ FreeBSD is adding ,1 for revisions.. remove that """ + # FIXME return a tuple with a revision... split = bsd_version.rsplit(',', 1) split = split[0] split = split.rsplit('_', 1) -- cgit v1.2.3 From bd415877ea420a848481f72a3227fdc577c5242c Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 18 Mar 2010 13:56:59 +0100 Subject: oe_audit.py: Parse the full output of bitbake -s Instead of being forced to manually edit we can now parse the full output of bitbake -s. --- contrib/qa/oe_audit.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 7e04480626..905f1108d3 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -11,6 +11,9 @@ def read_available(filename): packages = {} for line in f: + if line.startswith("NOTE: ") or line.startswith("Parsing .bb"): + continue + # str.split can not be used as we have multiple whitespace first_space = line.find(" ") package = line[0:first_space] -- cgit v1.2.3 From dbbe0cae855f2057583c013cdf7a6d0166a46218 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 18 Mar 2010 14:36:00 +0100 Subject: feed-browser: add unstable configs for beagle and hawk --- contrib/feed-browser/includes/config.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'contrib') diff --git a/contrib/feed-browser/includes/config.inc b/contrib/feed-browser/includes/config.inc index 2bc34f7d63..341ba87c36 100644 --- a/contrib/feed-browser/includes/config.inc +++ b/contrib/feed-browser/includes/config.inc @@ -155,6 +155,14 @@ $feeds = array( 'url'=>'ppc603e/gstreamer', ), + array( + 'name'=>'Beagleboard machine feed', + 'url'=>'armv7a/machine/beagleboard', + ), + array( + 'name'=>'Hawkoard machine feed', + 'url'=>'armv5te/machine/hawkboard', + ), array( 'name'=>'Motorola A780', 'url'=>'armv5te/machine/a780', -- cgit v1.2.3 From ccb23a493e54f2c3ccb3e7e74fa32a24842c6c29 Mon Sep 17 00:00:00 2001 From: Graeme Gregory Date: Fri, 19 Mar 2010 23:29:40 +0000 Subject: contrib/angstrom/sort.sh : add the new omapzoom36x machine Signed-off-by: Graeme Gregory --- contrib/angstrom/sort.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/angstrom/sort.sh b/contrib/angstrom/sort.sh index f18a1e5651..2d0598b41c 100755 --- a/contrib/angstrom/sort.sh +++ b/contrib/angstrom/sort.sh @@ -58,7 +58,7 @@ case "$arch" in "armv7") machines="" ;; "armv7a") - machines="archos5 archos5it palmpre cm-t35 igep0020 omap3-touchbook beagleboard omap3evm am3517-evm omap3517-evm omap3-pandora omapzoom omapzoom2 overo" ;; + machines="archos5 archos5it palmpre cm-t35 igep0020 omap3-touchbook beagleboard omap3evm am3517-evm omap3517-evm omap3-pandora omapzoom omapzoom2 omapzoom36x overo" ;; "avr32") machines="atngw100 at32stk1000" ;; "bfin") -- cgit v1.2.3 From 888edecd1b34a4f23e000e08f88a81e43f95732e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 18 Mar 2010 14:18:07 +0100 Subject: oe_audit.py: Properly handle used version.. There might be a third column for -s and we want to use that one. It seems bitbake is a bit confused about latest vs. current... and it is helping. --- contrib/qa/oe_audit.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'contrib') diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py index 905f1108d3..bb7915b5f2 100755 --- a/contrib/qa/oe_audit.py +++ b/contrib/qa/oe_audit.py @@ -11,16 +11,22 @@ def read_available(filename): packages = {} for line in f: - if line.startswith("NOTE: ") or line.startswith("Parsing .bb"): + if line.startswith("NOTE: ") or line.startswith("Parsing .bb") or line.startswith("done."): continue # str.split can not be used as we have multiple whitespace - first_space = line.find(" ") - package = line[0:first_space] - rest = line[first_space+1:] - pv = rest.strip().split(" ")[0] - - packages[package] = pv + split = line.split(" ", 1) + package = split[0] + rest = split[1].strip() + + # we might have a latest package... + split = rest.split(" ", 1) + if len(split) == 2: + version = split[1].strip() + else: + version = split[0] + + packages[package] = version return packages -- cgit v1.2.3 From 654f95c32918456f928f117871b15f09c0b6ae25 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 04:21:17 +0100 Subject: oeaudit: Move the oeaudit into a new subdirectory and split it up * OE should contain OE related handling * FreeBSD should contain the handling of FreeBSD specific things like the auditfile format, mapping BSD names to OE.. --- contrib/oeaudit/freebsd.py | 181 ++++++++++++++++++++++++++++ contrib/oeaudit/oe.py | 28 +++++ contrib/oeaudit/oe_audit.py | 82 +++++++++++++ contrib/qa/oe_audit.py | 285 -------------------------------------------- 4 files changed, 291 insertions(+), 285 deletions(-) create mode 100644 contrib/oeaudit/freebsd.py create mode 100644 contrib/oeaudit/oe.py create mode 100755 contrib/oeaudit/oe_audit.py delete mode 100755 contrib/qa/oe_audit.py (limited to 'contrib') diff --git a/contrib/oeaudit/freebsd.py b/contrib/oeaudit/freebsd.py new file mode 100644 index 0000000000..5e8c22ec0c --- /dev/null +++ b/contrib/oeaudit/freebsd.py @@ -0,0 +1,181 @@ +""" +Handle FreeBSD port audit files and map the names to OpenEmbedded +""" + +class freebsd_info: + """ + Handles an entry like the one below: + vulnerability-test-port>=2000<2010.02.26|http://cvsweb.freebsd.org/ports/security/vulnerability-test-port/|Not vulnerable, just a test port (database: 2010-02-26) + """ + def __init__(self, name, versions, link, kind): + self.name = name + self.versions = versions + self.link = link + + @classmethod + def split_versions(self, input): + """ + Split versions by <, >, >=, >= + """ + versions = [] + last_pos = 0 + + # Try to determine <, >, >=, <= + # we will have to carry stuff on to find the + # version.. + i = 0 + while i < len(input) - 1: + c1 = input[i] + c2 = input[i+1] + if c1 != '<' and c1 != '>' and c1 != '=': + i = i + 1 + continue + + # is a '=' coming behind it? + next = i + 1 + if c2 == '=': + next = next + 1 + + # submit + if last_pos != 0: + versions.append((next_type, input[last_pos:i])) + + # remember stuff + next_type = input[i:next] + last_pos = next + i = next + + assert last_pos != 0 + versions.append((next_type, input[last_pos:len(input)])) + return versions + + def __repr__(self): + return "%s: %s" % (self.name, self.versions) + + +def map_names(str): + """Map a FreeBSD name to OE""" + maps = { + "libpurple" : "pidgin", + "php4" : "php", + "php5" : "php", + "expat2" : "expat", + "freeciv-gtk" : "freeciv", + "pcre" : "libpcre", + "vim-gnome" : "vim", + "python23" : "python", + "python24" : "python", + "python25" : "python", + "python+ipv6" : "python", + "wget-devel" : "wget", + "xchat2" : "xchat", + "freetype" : "freetype", + "qemu-devel" : "qemu", + "krb5-beta" : "krb5", + "freeciv-gtk2": "freeciv", + "gtk" : "gtk+", + "wget+ipv6" : "wget", + "ja-gd" : "gd", + "openvpn-devel" : "openvpn", + "mpeg123-esound" : "mpeg123", + "mpeg123-nas" : "mpeg123", + "cdrtools-cjk" : "cdrtools", + "apache+mod_ssl+mod_deflate" : "apache2", + "apache+mod_ssl*" : "apache2", + "vim-gtk2" : "vim", + "zh-emacs" : "emacs", + "{ja-,}bugzilla" : "bugzilla", + "zh-tin" : "tin", + "mozilla+ipv6": "mozilla", + "mozilla-embeddded" : "mozilla", + "rar" : "unrar", + "libsndfile" : "libsndfile1", + "sylpheed-gtk2": "sylpheed", + "cdrtools-devel": "cdrtools", + "pine4-ssl": "pine", + "apache" : "apache2", + "ghostscript-gpl" : "gs", + "ghostscript-gnu-nox11" : "gs", + "ghostscript8" : "gs", + "ghostscript-afpl-nox11" : "gs", + "ghostscript-afpl" : "gs", + "isc-dhcp" : "dhcp", + "mplayer-gtk" : "mplayer", + "xerces-c2" : "xerces-c", + "libxml" : "libxml2", + "vim+ruby" : "vim", + "mplayer{,-gtk}{,-esound}" : "mplayer", + "proftpd-devel": "proftpd", + "neon28" : "neon", + "php4-dba" : "php", + "php5-{cgi,cli}" : "php", + + } + + try: + return maps[str] + except: + return str + +def is_not_in_oe(name): + """Method to reject packages not in OE""" + not_in = [ + # packages that we will never have... + "linux-firefox", "fr-linux-netscape", "linux-netscape-{communicator,navigator}", + "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", "zhTW-linux-mozillafirebird", "ja-linux-mozillafirebird-gtk1", "el-linux-mozillafirebird", "mozilla-firebird", "netscape7", + "acroread4", "acroread7", "acroread5", + "linux-openmotif", "linux-flock", "linux-jdk", "linux-curl", "linux-png", "linux-firefox-devel", + + # packages that we don't have now but maybe will have in + # the future and blacklisting them here might be a problem + "openoffice.org-2-devel", "openoffice.org-2", "it-openoffice", "ca-openoffice","sl-openoffice-SI", "ja-openoffice", + "drupal4", "drupal5", "drupal6", "drupal-pubcookie", + "gpdf", + "nagios", + "kdenetwork", "ja-kdelibs", "kdegraphics", "kdepim", "kdebase4-runtime", + "xemacs-devel", "xemacs-devel-21.5", "xemacs-mule", "zh-xemacs", "zh-xemacs-mule", + "geeklog", "apach13-ssl", "nvidia-driver", "eGroupWare", "varnish", "heimdal", + "bugzilla", "agenda-snow-libs", "mozilla", + ] + + return name in not_in + +def create_infos(line): + split = line.split("|") + for i in range(0, len(split[0])): + c = split[0][i] + if c != '<' and c != '=' and c != '>': + continue + name = map_names(split[0][0:i]) + versions = freebsd_info.split_versions(split[0][i:]) + break + + if is_not_in_oe(name): + #print "Not in oe %s" % name + return [] + + link = split[1] + kind = split[2] + return [freebsd_info(name, versions, link, kind)] + + +def read_auditfile(filename): + """ + Read an uncompressed audit file from freebsd + """ + f = open(filename) + packages = {} + for line in f: + if line.startswith("#"): + continue + + infos = create_infos(line) + for info in infos: + try: + packages[info.name].append(info) + except: + packages[info.name] = [] + packages[info.name].append(info) + return packages + + diff --git a/contrib/oeaudit/oe.py b/contrib/oeaudit/oe.py new file mode 100644 index 0000000000..f3326a5338 --- /dev/null +++ b/contrib/oeaudit/oe.py @@ -0,0 +1,28 @@ +def read_available(filename): + """ + Parses the output of bitbake -s + minus the first few lines + """ + f = open(filename) + packages = {} + + for line in f: + if line.startswith("NOTE: ") or line.startswith("Parsing .bb") or line.startswith("done."): + continue + + # str.split can not be used as we have multiple whitespace + split = line.split(" ", 1) + package = split[0] + rest = split[1].strip() + + # we might have a latest package... + split = rest.split(" ", 1) + if len(split) == 2: + version = split[1].strip() + else: + version = split[0] + + packages[package] = version + return packages + + diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py new file mode 100755 index 0000000000..6729edfa73 --- /dev/null +++ b/contrib/oeaudit/oe_audit.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python + +import freebsd, oe, bb + +def strip_oe_version(oe_version): + """ + We need to strip the package epoch... and the PR to compare + it to the FreeBSD versions. Also FreeBSD seems to use _N as + PR so we might need to do more.. + """ + split = oe_version.split(':', 1) + ver = split[1] + + split = ver.rsplit('-r', 1) + ver = split[0] + return ver + +def strip_bsd_version(bsd_version): + """ + FreeBSD is adding ,1 for revisions.. remove that + """ + # FIXME return a tuple with a revision... + split = bsd_version.rsplit(',', 1) + split = split[0] + split = split.rsplit('_', 1) + return split[0] + +def compare_versions(oe, freebsd, not_known): + def handle_package(oe_name, bsd_name): + if not oe_name in oe: + if oe_name == bsd_name: + print >> not_known, "%s is not in OE" % oe_name + return + + oe_version = strip_oe_version(oe[oe_name]) + for ver in freebsd[bsd_name]: + affected = True + str = [] + for (cmp, vers) in ver.versions: + bsd_ver = strip_bsd_version(vers) + cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, 'r0')) + if cmp == '<': + if cmp_res >= 0: + affected = False + pass + elif cmp == '<=': + if cmp_res > 0: + affected = False + pass + elif cmp == '>': + if cmp_res <= 0: + affected = False + pass + elif cmp == '>=': + if cmp_res < 0: + affected = False + pass + elif cmp == '=': + if cmp_res > 0: + affected = False + else: + print cmp + assert True + + str.append("%s %s %s %s" % (oe_name, oe_version, cmp, bsd_ver)) + if affected: + print " && ".join(str), ver.link + + for package in freebsd.keys(): + # handle the various versions of OE packages + handle_package(package, package) + handle_package("%s-native" % package, package) + handle_package("%s-full-native" % package, package) + handle_package("%s-sdk" % package, package) + + +# read the input data +oe_packages = oe.read_available("available") +freebsd_vuln = freebsd.read_auditfile("auditfile") +buggy = open("not_in_oe.bugs", "w+") + +compare_versions(oe=oe_packages, freebsd=freebsd_vuln, not_known=buggy) diff --git a/contrib/qa/oe_audit.py b/contrib/qa/oe_audit.py deleted file mode 100755 index bb7915b5f2..0000000000 --- a/contrib/qa/oe_audit.py +++ /dev/null @@ -1,285 +0,0 @@ -#!/usr/bin/env python - -import bb - -def read_available(filename): - """ - Parses the output of bitbake -s - minus the first few lines - """ - f = open(filename) - packages = {} - - for line in f: - if line.startswith("NOTE: ") or line.startswith("Parsing .bb") or line.startswith("done."): - continue - - # str.split can not be used as we have multiple whitespace - split = line.split(" ", 1) - package = split[0] - rest = split[1].strip() - - # we might have a latest package... - split = rest.split(" ", 1) - if len(split) == 2: - version = split[1].strip() - else: - version = split[0] - - packages[package] = version - return packages - - -def map_names(str): - """Map a FreeBSD name to OE""" - maps = { - "libpurple" : "pidgin", - "php4" : "php", - "php5" : "php", - "expat2" : "expat", - "freeciv-gtk" : "freeciv", - "pcre" : "libpcre", - "vim-gnome" : "vim", - "python23" : "python", - "python24" : "python", - "python25" : "python", - "python+ipv6" : "python", - "wget-devel" : "wget", - "xchat2" : "xchat", - "freetype" : "freetype", - "qemu-devel" : "qemu", - "krb5-beta" : "krb5", - "freeciv-gtk2": "freeciv", - "gtk" : "gtk+", - "wget+ipv6" : "wget", - "ja-gd" : "gd", - "openvpn-devel" : "openvpn", - "mpeg123-esound" : "mpeg123", - "mpeg123-nas" : "mpeg123", - "cdrtools-cjk" : "cdrtools", - "apache+mod_ssl+mod_deflate" : "apache2", - "apache+mod_ssl*" : "apache2", - "vim-gtk2" : "vim", - "zh-emacs" : "emacs", - "{ja-,}bugzilla" : "bugzilla", - "zh-tin" : "tin", - "mozilla+ipv6": "mozilla", - "mozilla-embeddded" : "mozilla", - "rar" : "unrar", - "libsndfile" : "libsndfile1", - "sylpheed-gtk2": "sylpheed", - "cdrtools-devel": "cdrtools", - "pine4-ssl": "pine", - "apache" : "apache2", - "ghostscript-gpl" : "gs", - "ghostscript-gnu-nox11" : "gs", - "ghostscript8" : "gs", - "ghostscript-afpl-nox11" : "gs", - "ghostscript-afpl" : "gs", - "isc-dhcp" : "dhcp", - "mplayer-gtk" : "mplayer", - "xerces-c2" : "xerces-c", - "libxml" : "libxml2", - "vim+ruby" : "vim", - "mplayer{,-gtk}{,-esound}" : "mplayer", - "proftpd-devel": "proftpd", - "neon28" : "neon", - "php4-dba" : "php", - "php5-{cgi,cli}" : "php", - - } - - try: - return maps[str] - except: - return str - -def is_not_in_oe(name): - """Method to reject packages not in OE""" - not_in = [ - # packages that we will never have... - "linux-firefox", "fr-linux-netscape", "linux-netscape-{communicator,navigator}", - "linux_base", "ja-netscape7", "{ja,ko}-netscape-{communicator,navigator}-linux", "zhTW-linux-mozillafirebird", "ja-linux-mozillafirebird-gtk1", "el-linux-mozillafirebird", "mozilla-firebird", "netscape7", - "acroread4", "acroread7", "acroread5", - "linux-openmotif", "linux-flock", "linux-jdk", "linux-curl", "linux-png", "linux-firefox-devel", - - # packages that we don't have now but maybe will have in - # the future and blacklisting them here might be a problem - "openoffice.org-2-devel", "openoffice.org-2", "it-openoffice", "ca-openoffice","sl-openoffice-SI", "ja-openoffice", - "drupal4", "drupal5", "drupal6", "drupal-pubcookie", - "gpdf", - "nagios", - "kdenetwork", "ja-kdelibs", "kdegraphics", "kdepim", "kdebase4-runtime", - "xemacs-devel", "xemacs-devel-21.5", "xemacs-mule", "zh-xemacs", "zh-xemacs-mule", - "geeklog", "apach13-ssl", "nvidia-driver", "eGroupWare", "varnish", "heimdal", - "bugzilla", "agenda-snow-libs", "mozilla", - ] - - return name in not_in - -class freebsd_info: - """ - Handles an entry like the one below: - vulnerability-test-port>=2000<2010.02.26|http://cvsweb.freebsd.org/ports/security/vulnerability-test-port/|Not vulnerable, just a test port (database: 2010-02-26) - """ - def __init__(self, name, versions, link, kind): - self.name = name - self.versions = versions - self.link = link - - @classmethod - def split_versions(self, input): - """ - Split versions by <, >, >=, >= - """ - versions = [] - last_pos = 0 - - # Try to determine <, >, >=, <= - # we will have to carry stuff on to find the - # version.. - i = 0 - while i < len(input) - 1: - c1 = input[i] - c2 = input[i+1] - if c1 != '<' and c1 != '>' and c1 != '=': - i = i + 1 - continue - - # is a '=' coming behind it? - next = i + 1 - if c2 == '=': - next = next + 1 - - # submit - if last_pos != 0: - versions.append((next_type, input[last_pos:i])) - - # remember stuff - next_type = input[i:next] - last_pos = next - i = next - - assert last_pos != 0 - versions.append((next_type, input[last_pos:len(input)])) - return versions - - def __repr__(self): - return "%s: %s" % (self.name, self.versions) - -def create_infos(line): - split = line.split("|") - for i in range(0, len(split[0])): - c = split[0][i] - if c != '<' and c != '=' and c != '>': - continue - name = map_names(split[0][0:i]) - versions = freebsd_info.split_versions(split[0][i:]) - break - - if is_not_in_oe(name): - #print "Not in oe %s" % name - return [] - - link = split[1] - kind = split[2] - return [freebsd_info(name, versions, link, kind)] - -def read_auditfile(filename): - """ - Read an uncompressed audit file from freebsd - """ - f = open(filename) - packages = {} - for line in f: - if line.startswith("#"): - continue - - infos = create_infos(line) - for info in infos: - try: - packages[info.name].append(info) - except: - packages[info.name] = [] - packages[info.name].append(info) - return packages - - -def strip_oe_version(oe_version): - """ - We need to strip the package epoch... and the PR to compare - it to the FreeBSD versions. Also FreeBSD seems to use _N as - PR so we might need to do more.. - """ - split = oe_version.split(':', 1) - ver = split[1] - - split = ver.rsplit('-r', 1) - ver = split[0] - return ver - -def strip_bsd_version(bsd_version): - """ - FreeBSD is adding ,1 for revisions.. remove that - """ - # FIXME return a tuple with a revision... - split = bsd_version.rsplit(',', 1) - split = split[0] - split = split.rsplit('_', 1) - return split[0] - -def compare_versions(oe, freebsd, not_known): - def handle_package(oe_name, bsd_name): - if not oe_name in oe: - if oe_name == bsd_name: - print >> not_known, "%s is not in OE" % oe_name - return - - oe_version = strip_oe_version(oe[oe_name]) - for ver in freebsd[bsd_name]: - affected = True - str = [] - for (cmp, vers) in ver.versions: - bsd_ver = strip_bsd_version(vers) - cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, 'r0')) - if cmp == '<': - if cmp_res >= 0: - affected = False - pass - elif cmp == '<=': - if cmp_res > 0: - affected = False - pass - elif cmp == '>': - if cmp_res <= 0: - affected = False - pass - elif cmp == '>=': - if cmp_res < 0: - affected = False - pass - elif cmp == '=': - if cmp_res > 0: - affected = False - else: - print cmp - assert True - - str.append("%s %s %s %s" % (oe_name, oe_version, cmp, bsd_ver)) - if affected: - print " && ".join(str), ver.link - - for package in freebsd.keys(): - # handle the various versions of OE packages - handle_package(package, package) - handle_package("%s-native" % package, package) - handle_package("%s-full-native" % package, package) - handle_package("%s-sdk" % package, package) - - -# read the input data -oe_packages = read_available("available") -freebsd_vuln = read_auditfile("auditfile") -buggy = open("not_in_oe.bugs", "w+") - -compare_versions(oe=oe_packages, freebsd=freebsd_vuln, not_known=buggy) -- cgit v1.2.3 From d0263eb39f48ad368601adffd8edde954af6aedf Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 04:34:52 +0100 Subject: oeaudit: Print a friendly message when the bitbake module can not be found --- contrib/oeaudit/oe_audit.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'contrib') diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py index 6729edfa73..b15a32fdea 100755 --- a/contrib/oeaudit/oe_audit.py +++ b/contrib/oeaudit/oe_audit.py @@ -1,6 +1,15 @@ #!/usr/bin/env python -import freebsd, oe, bb +import freebsd, oe + +try: + import bb +except Exception, e: + import sys + sys.stderr.write("Set PYTHONPATH to bitbake/lib and restart.\n") + sys.stderr.write("The backtrace can be seen below.\n") + raise e + def strip_oe_version(oe_version): """ -- cgit v1.2.3 From fc461bbba2814ee97eb20cbb1c01b82218ab3abd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 04:49:24 +0100 Subject: oeaudit: Use optparse to specify the parameters --- contrib/oeaudit/oe_audit.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'contrib') diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py index b15a32fdea..986a12e758 100755 --- a/contrib/oeaudit/oe_audit.py +++ b/contrib/oeaudit/oe_audit.py @@ -82,10 +82,25 @@ def compare_versions(oe, freebsd, not_known): handle_package("%s-full-native" % package, package) handle_package("%s-sdk" % package, package) +def handle_options(args): + import optparse + parser = optparse.OptionParser(version = "OE Audit version 0.1", + usage = "%prog [options]") + parser.add_option("-a", "--auditfile", help = "FreeBSD auditfile to use", + action = "store", dest = "freebsd_auditfile", default = None) + parser.add_option("-p", "--available", help = "Output of bitbake -s", + action = "store", dest = "oe_available", default = None) + parser.add_option("-b", "--buggy", help = "Write out unmaped packets", + action = "store", dest = "buggy", default = "not_in_oe.bugs") + + options, args = parser.parse_args(args) + return options # read the input data -oe_packages = oe.read_available("available") -freebsd_vuln = freebsd.read_auditfile("auditfile") -buggy = open("not_in_oe.bugs", "w+") +import sys +opts = handle_options(sys.argv) +oe_packages = oe.read_available(opts.oe_available) +freebsd_vuln = freebsd.read_auditfile(opts.freebsd_auditfile) +buggy = open(opts.buggy, "w+") compare_versions(oe=oe_packages, freebsd=freebsd_vuln, not_known=buggy) -- cgit v1.2.3 From 054df308d46daa9563ecb0123e7a2d166b8c56cd Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 05:10:49 +0100 Subject: oeaudit: Do the PR thin inside the freebsd config. --- contrib/oeaudit/freebsd.py | 11 +++++++++++ contrib/oeaudit/oe_audit.py | 22 ++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'contrib') diff --git a/contrib/oeaudit/freebsd.py b/contrib/oeaudit/freebsd.py index 5e8c22ec0c..e5e8440a2d 100644 --- a/contrib/oeaudit/freebsd.py +++ b/contrib/oeaudit/freebsd.py @@ -179,3 +179,14 @@ def read_auditfile(filename): return packages +def prepare_version(bsd_version): + """ + FreeBSD is adding ,1 for revisions.. remove that + """ + # FIXME return a tuple with a revision... + rev = "r0" + split = bsd_version.rsplit(',', 1) + split = split[0] + split = split.rsplit('_', 1) + return (split[0], rev) + diff --git a/contrib/oeaudit/oe_audit.py b/contrib/oeaudit/oe_audit.py index 986a12e758..018547a04e 100755 --- a/contrib/oeaudit/oe_audit.py +++ b/contrib/oeaudit/oe_audit.py @@ -24,17 +24,7 @@ def strip_oe_version(oe_version): ver = split[0] return ver -def strip_bsd_version(bsd_version): - """ - FreeBSD is adding ,1 for revisions.. remove that - """ - # FIXME return a tuple with a revision... - split = bsd_version.rsplit(',', 1) - split = split[0] - split = split.rsplit('_', 1) - return split[0] - -def compare_versions(oe, freebsd, not_known): +def compare_versions(oe, freebsd_dict, not_known): def handle_package(oe_name, bsd_name): if not oe_name in oe: if oe_name == bsd_name: @@ -42,12 +32,12 @@ def compare_versions(oe, freebsd, not_known): return oe_version = strip_oe_version(oe[oe_name]) - for ver in freebsd[bsd_name]: + for ver in freebsd_dict[bsd_name]: affected = True str = [] for (cmp, vers) in ver.versions: - bsd_ver = strip_bsd_version(vers) - cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, 'r0')) + (bsd_ver, bsd_pr) = freebsd.prepare_version(vers) + cmp_res = bb.utils.vercmp(('0', oe_version, 'r0'), ('0', bsd_ver, bsd_pr)) if cmp == '<': if cmp_res >= 0: affected = False @@ -75,7 +65,7 @@ def compare_versions(oe, freebsd, not_known): if affected: print " && ".join(str), ver.link - for package in freebsd.keys(): + for package in freebsd_dict.keys(): # handle the various versions of OE packages handle_package(package, package) handle_package("%s-native" % package, package) @@ -103,4 +93,4 @@ oe_packages = oe.read_available(opts.oe_available) freebsd_vuln = freebsd.read_auditfile(opts.freebsd_auditfile) buggy = open(opts.buggy, "w+") -compare_versions(oe=oe_packages, freebsd=freebsd_vuln, not_known=buggy) +compare_versions(oe=oe_packages, freebsd_dict=freebsd_vuln, not_known=buggy) -- cgit v1.2.3 From 950e9fd872480a8f0feeecf274fdd54d53cc07cb Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 22 Mar 2010 05:21:36 +0100 Subject: oeaudit: Add the FreeBSD revision to the package version. --- contrib/oeaudit/freebsd.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib') diff --git a/contrib/oeaudit/freebsd.py b/contrib/oeaudit/freebsd.py index e5e8440a2d..5765e8a726 100644 --- a/contrib/oeaudit/freebsd.py +++ b/contrib/oeaudit/freebsd.py @@ -188,5 +188,7 @@ def prepare_version(bsd_version): split = bsd_version.rsplit(',', 1) split = split[0] split = split.rsplit('_', 1) + if len(split) == 2: + rev = "r%s" % split[1] return (split[0], rev) -- cgit v1.2.3