[Git][reproducible-builds/strip-nondeterminism][master] Update the Javadoc handler to handle "dc.created" meta headers too for OpenJDK…

Chris Lamb gitlab at salsa.debian.org
Wed Nov 7 12:13:08 CET 2018


Chris Lamb pushed to branch master at Reproducible Builds / strip-nondeterminism


Commits:
f7454848 by Emmanuel Bourg at 2018-11-07T11:11:46Z
Update the Javadoc handler to handle "dc.created" meta headers too for OpenJDK 11. (Closes: #913132)

Signed-off-by: Chris Lamb <lamby at debian.org>

- - - - -


3 changed files:

- lib/File/StripNondeterminism/handlers/javadoc.pm
- + t/fixtures/javadoc/java11.html.in
- + t/fixtures/javadoc/java11.html.out


Changes:

=====================================
lib/File/StripNondeterminism/handlers/javadoc.pm
=====================================
@@ -59,14 +59,14 @@ sub normalize {
 			  unless $line
 			  =~ /^\s*$/; # elide lines that are now whitespace-only
 			$modified = 1;
-		} elsif ($line =~ /\<META NAME="date" CONTENT="[^"]*"\>/i) {
+		} elsif ($line =~ /\<META NAME="(date|dc.created)" CONTENT="[^"]*"\>/i) {
 			if (defined $File::StripNondeterminism::canonical_time) {
 				my $date = strftime('%Y-%m-%d',
 					gmtime($File::StripNondeterminism::canonical_time));
 				$line
-				  =~ s/\<(META NAME="date" CONTENT)="[^"]*"\>/<$1="$date">/gi;
+				  =~ s/\<(META NAME="(?:date|dc.created)" CONTENT)="[^"]*"\>/<$1="$date">/gi;
 			} else {
-				$line =~ s/\<META NAME="date" CONTENT="[^"]*"\>//gi;
+				$line =~ s/\<META NAME="(?:date|dc.created)" CONTENT="[^"]*"\>//gi;
 			}
 			print $tempfile $line
 			  unless $line


=====================================
t/fixtures/javadoc/java11.html.in
=====================================
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<!-- NewPage -->
+<html lang="en">
+<head>
+<!-- Generated by javadoc (11.0.1) on Wed Nov 07 09:50:23 CET 2018 -->
+<title>Generated Documentation (Untitled)</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="dc.created" content="2018-11-07">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
+<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
+<script type="text/javascript" src="script.js"></script>


=====================================
t/fixtures/javadoc/java11.html.out
=====================================
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<!-- NewPage -->
+<html>
+<head>
+<title>Generated Documentation (Untitled)</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<meta name="dc.created" content="2015-02-05">
+<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
+<link rel="stylesheet" type="text/css" href="jquery/jquery-ui.css" title="Style">
+<script type="text/javascript" src="script.js"></script>



View it on GitLab: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/commit/f7454848002b94500c1f3848be54b5c5ba276e92

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/strip-nondeterminism/commit/f7454848002b94500c1f3848be54b5c5ba276e92
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20181107/0ef12e5b/attachment.html>


More information about the rb-commits mailing list