[Secure-testing-commits] r31443 - bin

Raphael Geissert geissert at moszumanska.debian.org
Sat Jan 17 18:43:01 UTC 2015


Author: geissert
Date: 2015-01-17 18:43:01 +0000 (Sat, 17 Jan 2015)
New Revision: 31443

Added:
   bin/split-by-year
Log:
really add the split-by-year script


Added: bin/split-by-year
===================================================================
--- bin/split-by-year	                        (rev 0)
+++ bin/split-by-year	2015-01-17 18:43:01 UTC (rev 31443)
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+####################
+#    Copyright (C) 2011 by Raphael Geissert <geissert at debian.org>
+#
+#
+#    This file is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This file is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this file.  If not, see <http://www.gnu.org/licenses/>.
+####################
+
+set -eu
+
+list=data/CVE/list
+
+[ -f $list ] || {
+    echo "error: $list doesn't exist" >&2
+    exit 1
+}
+
+cve=
+year=
+while read line; do
+    case $line in
+	CVE-*)
+	    cve="$line"
+	    year="${cve#CVE-}"
+	    year="${year%%-*}"
+	;;
+	*)
+	    if [ "$cve" ]; then
+		printf "%s\n" "$cve" >> data/CVE/list.$year
+		cve=
+	    fi
+	    printf "\t%s\n" "$line" >> data/CVE/list.$year
+	;;
+    esac
+done < "$list"


Property changes on: bin/split-by-year
___________________________________________________________________
Added: svn:executable
   + *




More information about the Secure-testing-commits mailing list