From fd60784ec413a506af8e2721d3cf265582c58d01 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 31 Aug 2007 18:13:25 +0000 Subject: new scripts to help with ubuntu kernel releases git-svn-id: svn+ssh://svn.debian.org/svn/kernel-sec@937 e094ebfe-e918-0410-adfb-c712417f3574 --- scripts/ubuntu-release | 7 +++++++ scripts/ubuntu-usn-desc | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 scripts/ubuntu-release create mode 100755 scripts/ubuntu-usn-desc (limited to 'scripts') diff --git a/scripts/ubuntu-release b/scripts/ubuntu-release new file mode 100644 index 00000000..cf436685 --- /dev/null +++ b/scripts/ubuntu-release @@ -0,0 +1,7 @@ +#!/bin/bash +echo 'This is just a place holder for future scripts. View source for examples.' +exit 1 + +# Examples: +#../scripts/ubuntu-usn-desc $(egrep '^2.6.20-feisty-security: pending' CVE* | cut -d: -f1) +#perl -pi -e 's/^2.6.20-feisty-security: pending \(2\.6\.20-16\.30\)/2.6.20-feisty-security: released (2.6.20-16.31)/' CVE* diff --git a/scripts/ubuntu-usn-desc b/scripts/ubuntu-usn-desc new file mode 100755 index 00000000..9894a9e8 --- /dev/null +++ b/scripts/ubuntu-usn-desc @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# Dumps the Ubuntu-Descriptions in a form suitable for a USN announcement +import sys, deb822 + +def wrap(text, width): + """ + A word-wrap function that preserves existing line breaks + and most spaces in the text. Expects that existing line + breaks are posix newlines (\n). + """ + return reduce(lambda line, word, width=width: '%s%s%s' % + (line, + ' \n'[(len(line)-line.rfind('\n')-1 + + len(word.split('\n',1)[0] + ) >= width)], + word), + text.split(' ') + ) + +for cve in sys.argv[1:]: + desc = deb822.deb822(file(cve))['Ubuntu-Description'].strip() + if len(sys.argv[1:])!=1: + desc += " (%s)"%cve + print + print wrap(desc,75) -- cgit v1.2.3