aboutsummaryrefslogtreecommitdiffstats
path: root/english/lts
diff options
context:
space:
mode:
authorThomas Lange <lange@debian.org>2024-01-13 15:49:39 +0100
committerThomas Lange <lange@debian.org>2024-01-13 15:49:39 +0100
commit99ddce9fa6bb8742d67aa0f8c3dfb36a287e735f (patch)
treec83f7b27a0b6f1ea1d2eafb611f8c9dae85c60a9 /english/lts
parentf5025bb27b189058c7f8ed5827b85bff7d9e96ea (diff)
remove unused script
Diffstat (limited to 'english/lts')
-rwxr-xr-xenglish/lts/security/parse-dla.pl221
1 files changed, 0 insertions, 221 deletions
diff --git a/english/lts/security/parse-dla.pl b/english/lts/security/parse-dla.pl
deleted file mode 100755
index 7d4679f5ea0..00000000000
--- a/english/lts/security/parse-dla.pl
+++ /dev/null
@@ -1,221 +0,0 @@
-#!/usr/bin/perl
-#
-# parse-dla.pl
-#
-# Copyright © 2016 Frank Lichtenheld
-# Based on parse-advisories.pl:
-# Copyright (C) 2001 Josip Rodin
-# Copyright (c) 2002,3 Josip Rodin, Martin Schulze
-# Licensed under the GNU General Public License version 2.
-
-use strict;
-use warnings;
-
-use File::Path qw(remove_tree make_path);
-use MIME::QuotedPrint;
-use POSIX qw(strftime);
-
-my $debug = 0;
-my $adv = $ARGV[0];
-if ($adv eq "-d") {
- $debug = 1;
- $adv = $ARGV[1];
-}
-
-$adv || die "you must specify a parameter (original advisory file)!\n";
-die "that advisory file either ain't there or doesn't have anything in it!\n" unless -s $adv;
-
-# i'm lame, so shoot me
-my %longmoy = ( en => [
- 'January', 'February', 'March', 'April', 'May', 'June',
- 'July', 'August', 'September', 'October', 'November', 'December' ]
-);
-my %shortmoy = ( en => [
- 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
- 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]
-);
-
-open(my $fh, '<', $adv) or die "couldn't open advisory file $adv: $!\n";
-my ($dla, $date, $package, $version, @dbids, $moreinfo, $year);
-$package = $moreinfo = $dla = '';
-$year = strftime "%Y", localtime;
-$date = strftime "%Y-%m-%d", localtime;
-my ($nl, $mi, $headersnearingend);
-while (my $l = <$fh>) {
- $l = decode_qp($l);
- # match Subject line or advisory header to retrieve DLA string
- if (
- ($l =~ /Subject.*:.*\[(DLA[- ]\d+-\d+)\]/)
- or ($l =~ /^Debian LTS Advisory (DLA[- ]\d+-\d+)/)
- ) {
- $dla = $1;
- }
- if ($l =~ /Date.*:.*\s(\d+)\s+(\w+)\s+(\d+)/) {
- my $month = $2; my $day = $1; $year = $3;
- my $i = 0;
- while ($i < 12) {
- if ($month eq $longmoy{en}[$i]) {
- $month = $i + 1;
- $date = "$year-$month-$day";
- $i = 12;
- }
- elsif ($month eq $shortmoy{en}[$i]) {
- $month = $i + 1;
- $date = "$year-$month-$day";
- $i = 12;
- }
- $i++
- }
- }
- if ($l =~ /Package(?:s)*\s*: (.+)\s*/) {
- $package = $1;
- }
- if ($l =~ /Version\s*: (.+)\s*/) {
- $version = $1;
- }
- if ($l =~ /^(Debian Bug\(?s?\)?)\s*: (.+)/i) {
- for my $id (split (/,? /, $2)) {
- push @dbids, "Bug#".$id if ($id ne "none");
- }
- }
- if ($l =~ /^(CVE (names?|id\(?s?\)?|references?)?|CERT advisor(y|ies))\s*: (.+)/i) {
- push @dbids, join (" ", split (/,? /, $4));
- }
- if ($l =~ /^\s+((?:CVE-\d+-\d+[ ]*)+)$/i) {
- push @dbids, join (" ", split (/,? /, $1));
- }
- if ($l =~ /^\s+((?:VU#\d+[ ]*)+)$/i) {
- push @dbids, join (" ", split (/,? /, $1));
- }
- if ($l =~ /^Bugtraq Ids?\s*: (.+)/i) {
- for my $id (split (/,? /, $1)) {
- push @dbids, "BID".$id;
- }
- }
- last if ($l =~ /Learn more about the/i);
- last if ($l =~ /Thanks to.+for proof read/i);
- last if ($l =~ /Regards,/i);
- last if ($l =~ /^-- /);
- last if ($l =~ /^Ben Hutchings/);
- last if ($l =~ /^Raphaël Hertzog/);
- last if ($l =~ /^mike gabriel aka sunweaver/);
- last if ($l =~ /^Support Debian LTS:/);
- last if ($l =~ /^-----BEGIN PGP SIGNATURE/);
- last if ($package and $l =~ /^--[a-zA-Z0-9]+$/); # another MIME boundary, we're done
- last if ($l =~ /^Attachment: /);
- last if ($l =~ /<strong>Attachment:$/);
- #$mi = 0 if ($l =~ /^(wget url|Obtaining updates|Upgrade Instructions)/i);
- $moreinfo .= "<p>" if ($mi && $nl);
- $nl = 0;
- $nl = 1 if ($mi && ($l eq "\n") && $moreinfo);
- if ($mi) {
- if ($mi > 1) {
- $moreinfo .= $l;
- } else {
- $moreinfo .= "\n<p>".$l;
- $mi++;
- }
- }
- $headersnearingend++ if ($l =~ /Package(?:s)*\s*:/);
- if ($headersnearingend && $l =~ /^\s*$/) {
- $mi++;
- $headersnearingend = 0;
- }
-
-}
-close $fh;
-
-
-$moreinfo =~ s/(- )?-+\n//g;
-$moreinfo =~ s/\n\n$/\n/s;
-$moreinfo =~ s/^\n+/\n/s;
-$moreinfo =~ s/\n<p>\n$//;
-$moreinfo =~ s/\n<p>note\:/<p><b>Note<\/b>:/ig;
-$moreinfo =~ s/(\s)"(\w[\w\.,'\(\)\s]*?\w)"([\:\.',\(\)\s])/$1<q>$2<\/q>$3/g;
-$moreinfo =~ s/(\s)'(\w[\w\.,\(\)\s]*?\w)'([\:\.,\(\)\s])/$1<q>$2<\/q>$3/g;
-$moreinfo =~ s|\n+(<p>(CAN\|CVE)-\d+-\d+[\:]*)\s?(\s*)(\S+)|\n\n$1\n$3$4|g;
-$moreinfo =~ s/\n\n/<\/p>\n\n/sg;
-$moreinfo =~ s|\n<p>((CAN\|CVE)-\d+-\d+[^\n]*)</p>\n|\n<li>$1\n|g;
-$moreinfo =~ s|\n<p>((CAN\|CVE)-\d+-\d+[^\n]*)\n|\n<li>$1\n<p>\n|g;
-$moreinfo =~ s|((CAN\|CVE)-\d+-\d+)|<a href="https://security-tracker.debian.org/tracker/$1">$1</a>|g;
-$moreinfo =~ s|</p>\n\n<p>\n<p>(\w* \w* stable)|</p></li>\n\n</ul>\n\n<p>$1|;
-$moreinfo =~ s|<p>(\s+)|$1<p>|g;
-$moreinfo =~ s|<p><p>|<p>|g;
-$moreinfo =~ s/\n<p>$//;
-$moreinfo =~ s|</p>$||;
-$moreinfo =~ s|</p>\n\n<li>|</p></li>\n\n<li>|g;
-$moreinfo =~ s|</li>\n\n<li>|\n\n<ul>\n\n<li>|;
-$moreinfo =~ s|(\s+)(https?://[^\s<>{}\\^\[\]\"\'\`]+)|$1<a href="$2">$2</a>|g;
-
-if (($moreinfo =~ /<ul>\n\n<li>/) && ($moreinfo !~ /<\/li>\n\n<\/ul>/)){
- $moreinfo =~ s{</p>\n\n<p>(((\w+ ){1,3}(old ?stable|stable|testing|Debian \d))|Th[eo]se)}{</p></li>\n\n</ul>\n\n<p>$1};
-}
-chomp ($moreinfo);
-if (($moreinfo =~ /<ul>\n\n<li>/) && ($moreinfo !~ /<\/li>\n\n<\/ul>/)){
- $moreinfo .= "</p></li>\n\n</ul>";
-}else{
- $moreinfo .= '</p>';
-}
-
-my ($wml, $data, $pagetitle);
-if (defined($package) && $dla =~ /DLA[- ](\d+)-(\d+)/ ) {
- my $dla_number=$1;
- my $dla_revision=$2;
- my $suffix = '';
- if ($dla_revision != 1) {
- $suffix = "-$dla_revision";
- }
- $wml = "$year/dla-$dla_number$suffix.wml";
- $data = "$year/dla-$dla_number$suffix.data";
- $pagetitle = "DLA-$dla_number-$dla_revision $package";
-} elsif (! defined $package){
- die "Could not parse advisory filename '$adv'. Package information missing from '$dla'\n";
-} else {
- die "Could not parse advisory filename '$adv'. DLA name missing in '$dla'\n";
-}
-
-if (!(-d $year)){
- mkdir($year);
-}
-
-&make_data;
-&make_wml;
-
-sub make_data{
- my $fh = *STDOUT;
- if (not $debug) {
- if (-f $data){
- print STDERR "Data file \"$data\" already exists for advisory in file '$adv'\n";
- return;
- }
- open($fh, ">", "$data") or die "Can't write to data file \"$data\": $!";
- }
- print $fh "<define-tag pagetitle>$pagetitle</define-tag>\n";
- print $fh "<define-tag report_date>$date</define-tag>\n";
- print $fh "<define-tag secrefs>@dbids</define-tag>\n" if @dbids;
- print $fh "<define-tag packages>$package</define-tag>\n";
- print $fh "<define-tag isvulnerable>yes</define-tag>\n";
- print $fh "<define-tag fixed>yes</define-tag>\n";
- print $fh "<define-tag fixed-section>no</define-tag>\n"; # Kaare, 2011-01-24: Line added because the "fixed in" section is no longer available
- print $fh "\n#use wml::debian::security\n\n";
- close $fh if not $debug;
- return
-}
-
-sub make_wml{
- my $fh = *STDOUT;
- if (not $debug) {
- if (-f $wml){
- print STDERR "WML file \"$wml\" already exists for advisory in file '$adv'\n";
- return;
- }
- open($fh, ">", "$wml") or die "Can't write to WML file \"$wml\": $!";
- }
- print $fh "<define-tag description>LTS security update</define-tag>\n";
- print $fh "<define-tag moreinfo>$moreinfo\n</define-tag>\n";
- print $fh "\n# do not modify the following line\n";
- print $fh "#include \"\$(ENGLISHDIR)/lts/security/$data\"\n";
- printf $fh "# %sId: \$\n", "\$";
- close $fh if not $debug;
- return;
-}

© 2014-2024 Faster IT GmbH | imprint | privacy policy