diff options
author | Thomas Lange <lange@debian.org> | 2024-01-13 15:42:30 +0100 |
---|---|---|
committer | Thomas Lange <lange@debian.org> | 2024-01-13 15:42:30 +0100 |
commit | e5052a72bd09dde564c0d85e35df0f53d0241a43 (patch) | |
tree | 2d162ca5845bcb4e24616c1dade1918de8bf8ad1 /english/template | |
parent | c2fc4bd99b1a5488049b5f013fbf7a070665c9ba (diff) |
remove unused perl code
Diffstat (limited to 'english/template')
-rw-r--r-- | english/template/debian/recent_list_security.wml | 298 |
1 files changed, 0 insertions, 298 deletions
diff --git a/english/template/debian/recent_list_security.wml b/english/template/debian/recent_list_security.wml deleted file mode 100644 index 23a1076b6bf..00000000000 --- a/english/template/debian/recent_list_security.wml +++ /dev/null @@ -1,298 +0,0 @@ -#use wml::debian::ctime -#use wml::debian::common_tags -#use wml::debian::openrecode -#use wml::debian::recent_list_common - -<define-tag noitemsforthisyear whitespace=delete> - <gettext>No items for this year.</gettext> -</define-tag> - - -<define-tag new_revision whitespace="delete"> - <gettext>(new revision)</gettext> -</define-tag> - -<perl> - -sub format_security_items { - my ($data, $format_item) = @_; - - my @dates = sort { $b <=> $a } keys %$data; - - unless (@dates) { - return "<noitemsforthisyear/>\n"; - } - - my @str; - foreach my $date (@dates){ - #warn "date=".scalar gmtime($date)."\n"; - foreach my $file_data (sort { $b->{title} cmp $a->{title} } @{$data->{$date}}){ - #warn "title=$file_data->{title}\n"; - push @str, $format_item->($file_data); - } - } - return join('',@str); -} - -sub format_security_item { - my ($file_data) = @_; - my $new_revision = $file_data->{revision} > 1 ? ' <new_revision>' : ''; - return "<tt>[$file_data->{date}]</tt> " - ."<strong><a href=\"$file_data->{basename}\">$file_data->{title}</a></strong> " - ."$file_data->{description}$new_revision<br />\n"; -} - -my $security_homepage = 'https://www.debian.org/security/'; - -sub format_security_item_rdf_seq { - my ($file_data) = @_; - # we need absolute paths for rdf - (my $rdfbase = $file_data->{basename}) =~ s@^security/@@; -<protect pass=2> - return qq{<rdf:li resource="$security_homepage$rdfbase" />\n}; -</protect> -} - -sub format_security_item_rdf { - my ($file_data) = @_; - # we need absolute paths for rdf - (my $rdfbase = $file_data->{basename}) =~ s@^security/@@; - return "\n" - ."<item rdf:about=\"$security_homepage$rdfbase\">\n" - ." <title>$file_data->{title}</title>\n" - ." <link>$security_homepage$rdfbase</link>\n" - ." <description>\n" - ." $file_data->{description}\n" - ." </description>\n" - ." <dc:date>$file_data->{isodate}</dc:date>\n" - ."</item>\n"; -} - -sub format_security_item_rdf_long { - my ($file_data) = @_; - # we need absolute paths for rdf - (my $rdfbase = $file_data->{basename}) =~ s@^security/@@; - - # $moreinfo is WML/HTML; we need to strip tags here - <protect pass=2> - my $moreinfo = $file_data->{moreinfo}; - # HTML entities - $moreinfo =~ s/(&[^#;]+;)/&decodehtmlentity($1)/ge; - # <email "xxx"> <url "xxx"> - $moreinfo =~ s#<email "?([^>"]+)"?>#<a href="mailto:$1">$1</a>#g; - $moreinfo =~ s#<url "([^>]+)">#<a href="$1">$1</a>#g; - # HTML tags - $moreinfo =~ s/</</g; - $moreinfo =~ s/>/>/g; - $moreinfo =~ s/"/"/g; #" - # WML continuation - $moreinfo =~ s/\\\n//g; - </protect> - - return "\n" - ."<item rdf:about=\"$security_homepage$rdfbase\">\n" - ." <title>$file_data->{title} - $file_data->{description}</title>\n" - ." <link>$security_homepage$rdfbase</link>\n" - ." <description>\n" - ." $moreinfo\n" - ." </description>\n" - ." <dc:date>$file_data->{isodate}</dc:date>\n" - ."</item>\n"; -} - - -# decode_html_entity is used in the RDF outputs to convert the predefined -# HTML/SGML entities to NCRs, as they are not predefined for XML formats. -sub decodehtmlentity { - my $ent = shift; - - # ISO 8859-1 entities - @entities = ( - ' ', '¡', '¢', '£', '¤', '¥', - '¦', '§', '¨', '©', 'ª', '«', '¬', - '­', '®', '¯', '°', '±', '²', '³', - '´', 'µ', '¶', '·', '¸', '¹', - 'º', '»', '¼', '½', '¾', '¿', - 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', - 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', - 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', - 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', - 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', - 'Þ', 'ß', 'à', 'á', 'â', 'ã', - 'ä', 'å', 'æ', 'ç', 'è', 'é', - 'ê', 'ë', 'ì', 'í', 'î', 'ï', - 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', - 'ö', '÷', 'ø', 'ù', 'ú', 'û', - 'ü', 'ý', 'þ', 'ÿ' - ); - - for (my $i = 0; $i < $#entities; ++ $i) - { - return "&#".($i+160).";" if $entities[$i] eq $ent; - } - - # Non-ISO 8859-1 entities - %entities = ( - # Specials - 'Œ' => 'Œ', - 'œ' => 'œ', - 'Š' => 'Š', - 'š' => 'š', - 'Ÿ' => 'Ÿ', - 'ˆ' => 'ˆ', - '˜' => '˜', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‌' => '‌', - '‍' => '‍', - '‎' => '‎', - '‏' => '‏', - '–' => '–', - '—' => '—', - '‘' => '‘', - '’' => '’', - '‚' => '‚', - '“' => '“', - '”' => '”', - '„' => '„', - '†' => '†', - '‡' => '‡', - '‰' => '‰', - '‹' => '‹', - '›' => '›', - '€' => '€', - # Symbols - 'ƒ' => 'ƒ', - 'Α' => 'Α', - 'Β' => 'Β', - 'Γ' => 'Γ', - 'Δ' => 'Δ', - 'Ε' => 'Ε', - 'Ζ' => 'Ζ', - 'Η' => 'Η', - 'Θ' => 'Θ', - 'Ι' => 'Ι', - 'Κ' => 'Κ', - 'Λ' => 'Λ', - 'Μ' => 'Μ', - 'Ν' => 'Ν', - 'Ξ' => 'Ξ', - 'Ο' => 'Ο', - 'Π' => 'Π', - 'Ρ' => 'Ρ', - 'Σ' => 'Σ', - 'Τ' => 'Τ', - 'Υ' => 'Υ', - 'Φ' => 'Φ', - 'Χ' => 'Χ', - 'Ψ' => 'Ψ', - 'Ω' => 'Ω', - 'α' => 'α', - 'β' => 'β', - 'γ' => 'γ', - 'δ' => 'δ', - 'ε' => 'ε', - 'ζ' => 'ζ', - 'η' => 'η', - 'θ' => 'θ', - 'ι' => 'ι', - 'κ' => 'κ', - 'λ' => 'λ', - 'μ' => 'μ', - 'ν' => 'ν', - 'ξ' => 'ξ', - 'ο' => 'ο', - 'π' => 'π', - 'ρ' => 'ρ', - 'ς' => 'ς', - 'σ' => 'σ', - 'τ' => 'τ', - 'υ' => 'υ', - 'φ' => 'φ', - 'χ' => 'χ', - 'ψ' => 'ψ', - 'ω' => 'ω', - 'ϑ' => 'ϑ', - 'ϒ' => 'ϒ', - 'ϖ' => 'ϖ', - '•' => '•', - '…' => '…', - '′' => '′', - '″' => '″', - '‾' => '‾', - '⁄' => '⁄', - '℘' => '℘', - 'ℑ' => 'ℑ', - 'ℜ' => 'ℜ', - '™' => '™', - 'ℵ' => 'ℵ', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '↔' => '↔', - '↵' => '↵', - '⇐' => '⇐', - '⇑' => '⇑', - '⇒' => '⇒', - '⇓' => '⇓', - '⇔' => '⇔', - '∀' => '∀', - '∂' => '∂', - '∃' => '∃', - '∅' => '∅', - '∇' => '∇', - '∈' => '∈', - '∉' => '∉', - '∋' => '∋', - '∏' => '∏', - '∑' => '∑', - '−' => '−', - '∗' => '∗', - '√' => '√', - '∝' => '∝', - '∞' => '∞', - '∠' => '∠', - '∧' => '∧', - '∨' => '∨', - '∩' => '∩', - '∪' => '∪', - '∫' => '∫', - '∴' => '∴', - '∼' => '∼', - '≅' => '≅', - '≈' => '≈', - '≠' => '≠', - '≡' => '≡', - '≤' => '≤', - '≥' => '≥', - '⊂' => '⊂', - '⊃' => '⊃', - '⊄' => '⊄', - '⊆' => '⊆', - '⊇' => '⊇', - '⊕' => '⊕', - '⊗' => '⊗', - '⊥' => '⊥', - '⋅' => '⋅', - '⌈' => '⌈', - '⌉' => '⌉', - '⌊' => '⌊', - '⌋' => '⌋', - '⟨' => '〈', - '⟩' => '〉', - '◊' => '◊', - '♠' => '♠', - '♣' => '♣', - '♥' => '♥', - '♦' => '♦', - ); - return $entities{$ent} if defined $entities{$ent}; - return '?'; # Say what? -} -</perl> - -# -# vim:ts=8:sw=4: -# |