[kernel-sec-discuss] r937 - scripts

keescook-guest at alioth.debian.org keescook-guest at alioth.debian.org
Fri Aug 31 18:13:25 UTC 2007


Author: keescook-guest
Date: 2007-08-31 18:13:25 +0000 (Fri, 31 Aug 2007)
New Revision: 937

Added:
   scripts/ubuntu-release
   scripts/ubuntu-usn-desc
Log:
new scripts to help with ubuntu kernel releases

Added: scripts/ubuntu-release
===================================================================
--- scripts/ubuntu-release	                        (rev 0)
+++ scripts/ubuntu-release	2007-08-31 18:13:25 UTC (rev 937)
@@ -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*

Added: scripts/ubuntu-usn-desc
===================================================================
--- scripts/ubuntu-usn-desc	                        (rev 0)
+++ scripts/ubuntu-usn-desc	2007-08-31 18:13:25 UTC (rev 937)
@@ -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)


Property changes on: scripts/ubuntu-usn-desc
___________________________________________________________________
Name: svn:executable
   + *




More information about the kernel-sec-discuss mailing list