aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ghostscript-no-header-uuid.patch
blob: b277a4bc2e139ff66819652c3a91943a956e3234 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
This patch makes the UUIDs in the XMP header optional, depending on the
setting of the environment variable GS_GENERATE_UUIDS.

If the environment variable GS_GENERATE_UUIDS is set to "0" or "no", it will
not write out the Document UUID field and also will write the Instance ID
field value as "".

Upstream does not want to do this.

See: https://bugs.ghostscript.com/show_bug.cgi?id=698208
diff --git a/devices/vector/gdevpdfe.c b/devices/vector/gdevpdfe.c
index f083f1e93..a19c64ac0 100644
--- a/devices/vector/gdevpdfe.c
+++ b/devices/vector/gdevpdfe.c
@@ -624,7 +624,7 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
         return code;
 
     /* PDF/A XMP reference recommends setting UUID to empty. If not empty must be a URI */
-    if (pdev->PDFA != 0)
+    if (pdev->PDFA != 0 || (getenv("GS_GENERATE_UUIDS") && (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") == 0 || strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") == 0)))
         instance_uuid[0] = 0x00;
 
     cre_date_time_len = pdf_get_docinfo_item(pdev, "/CreationDate", cre_date_time, sizeof(cre_date_time));
@@ -730,14 +730,17 @@ pdf_write_document_metadata(gx_device_pdf *pdev, const byte digest[6])
             pdf_xml_tag_close(s, "rdf:Description");
             pdf_xml_newline(s);
 
-            pdf_xml_tag_open_beg(s, "rdf:Description");
-            pdf_xml_copy(s, " rdf:about=\"\"");
-            pdf_xml_attribute_name(s, "xmlns:xapMM");
-            pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
-            pdf_xml_attribute_name(s, "xapMM:DocumentID");
-            pdf_xml_attribute_value(s, document_uuid);
-            pdf_xml_tag_end_empty(s);
-            pdf_xml_newline(s);
+            if (!getenv("GS_GENERATE_UUIDS") || (strcasecmp(getenv("GS_GENERATE_UUIDS"), "0") != 0 && strcasecmp(getenv("GS_GENERATE_UUIDS"), "no") != 0))
+            {
+                pdf_xml_tag_open_beg(s, "rdf:Description");
+                pdf_xml_copy(s, " rdf:about=\"\"");
+                pdf_xml_attribute_name(s, "xmlns:xapMM");
+                pdf_xml_attribute_value(s, "http://ns.adobe.com/xap/1.0/mm/");
+                pdf_xml_attribute_name(s, "xapMM:DocumentID");
+                pdf_xml_attribute_value(s, document_uuid);
+                pdf_xml_tag_end_empty(s);
+                pdf_xml_newline(s);
+            }
 
             pdf_xml_tag_open_beg(s, "rdf:Description");
             pdf_xml_copy(s, " rdf:about=\"\"");
n>Ludovic Courtès 2019-04-23doc: Add Spanish translation....* doc/local.mk (info_TEXINFOS): Add guix.es.texi. (TRANSLATED_INFO): Add guix.es.texi and contributing.es.texi. * po/doc/guix-manual.es.po: New file. * po/doc/local.mk: Add guix-manual.es.po. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Miguel Ángel Arruga Vivas 2019-03-14Merge branch 'staging' into core-updatesMarius Bakke 2019-03-13doc: Document the graphical installer some more....* doc/guix.texi (Preparing for Installation): Rewrite to specify the two installation modes. (Guided Graphical Installation): New node. (Manual Installation): New node, with the former sections. (After System Installation): New node. * doc/images/installer-network.png, doc/images/installer-partitions.png, doc/images/installer-resume.png: New files. * doc/local.mk (dist_infoimage_DATA): Add them. Ludovic Courtès 2018-12-11Merge branch 'master' into core-updatesMarius Bakke 2018-11-01doc: Add German translation....* doc/contributing.de.texi: New file. * doc/guix.de.texi: New file * doc/local.mk (TRANSLATED_INFO): Add them. (info_TEXINFOS): Add guix.de.texi. * po/doc/guix-manual.de.po: New file. * po/doc/local.mk (EXTRA_DIST): Add it. * doc/guix.texi: Document the German translation. Julien Lepiller 2018-09-23doc: Describe the Reduced Binary Seed bootstrap....* doc/guix.texi (Reduced Binary Seed Bootstrap): New node. * doc/images/gcc-mesboot-bag-graph.dot: New file. * doc/local.mk (DOT_FILES): Add it. Jan Nieuwenhuizen 2018-04-29build: Use only one domain for guix-manual....* Makefile.am (assert-no-store-file-names): Exclude guix-manual. * po/doc/guix.pot po/doc/contributing.pot: Merge into... * po/doc/guix-manual.pot: ...this. * po/doc/guix.fr.po po/doc/contributing.fr.po: Merge into... * po/doc/guix-manual.fr.po: ...this. * doc/local.mk: Replace old file names. * po/doc/local.mk: Replace old file names. Julien Lepiller 2018-04-25build: Add silent rules for Texinfo xref translation....* Makefile.am (AM_V_POXREF, AM_V_POXREF_, AM_V_POXREF_0): New variables. * doc/local.mk ($(srcdir)/%D%/guix.%.texi) ($(srcdir)/%D%/contributing.%.texi): Use $(AM_V_POXREF). Ludovic Courtès 2018-04-19gnu: doc: Add French documentation....* doc/contributing.fr.texi: New file. * doc/guix.fr.texi: New file. * doc/local.mk (TRANSLATED_INFO): Add them. (info_TEXINFOS): Add guix.fr.texi. * po/doc/contributing.fr.po: New file. * po/doc/guix.fr.po: New file. * po/doc/local.mk (EXTRA_DIST): Add them. Julien Lepiller 2018-04-19gnu: doc: Allow documentation to be translated....* po/doc/contributing.pot: New file. * po/doc/guix.pot: New file. * po/doc/local.mk: New file. * Makefile.am: Include it. Add gettext command. Add silent rules for po4a. * configure.ac: Look for po4a-translate and po4a-updatepo. * doc/local.mk: Add rules to generate translated texi files. (TRANSLATED_INFO): New variable. (BUILT_SOURCES, EXTRA_DIST, MAINTAINERCLEANFILES): Add it. * .gitignore: Add generated files. Julien Lepiller 2018-01-20build: Declare “doc/guix.texi“ dependencies....Fixes <https://bugs.gnu.org/29727>. * doc/local.mk (%C%_guix_TEXINFOS): New variable containing files included by “doc/guix.texi”. (EXTRA_DIST): Remove ‘.texi’ files. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Mathieu Lirzin