summaryrefslogtreecommitdiff
path: root/Build/source/libs/libpaper/TLpatches
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/libpaper/TLpatches')
-rw-r--r--Build/source/libs/libpaper/TLpatches/ChangeLog16
-rw-r--r--Build/source/libs/libpaper/TLpatches/TL-Changes23
-rw-r--r--Build/source/libs/libpaper/TLpatches/patch-01-JIS44
-rw-r--r--Build/source/libs/libpaper/TLpatches/patch-02-TL171
-rw-r--r--Build/source/libs/libpaper/TLpatches/patch-03-getopt49
-rw-r--r--Build/source/libs/libpaper/TLpatches/patch-04-unsigned29
6 files changed, 332 insertions, 0 deletions
diff --git a/Build/source/libs/libpaper/TLpatches/ChangeLog b/Build/source/libs/libpaper/TLpatches/ChangeLog
new file mode 100644
index 00000000000..88935dabef6
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/ChangeLog
@@ -0,0 +1,16 @@
+2014-06-18 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-04-unsigned (new): Avoid undefined behaviour.
+
+2013-11-20 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * patch-03-getopt (new): Adapt paperconf.1 to non-GNU getopt.
+
+2013-10-24 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ Imported libpaper-1.1.24+nmu2 source tree from:
+ ftp://ftp.de.debian.org/debian/pool/main/libp/libpaper
+
+ * patch-01-JIS (new): Add JIS paper specs.
+ * patch-02-TL (new): No /etc/papersize for TeX Live.
+
diff --git a/Build/source/libs/libpaper/TLpatches/TL-Changes b/Build/source/libs/libpaper/TLpatches/TL-Changes
new file mode 100644
index 00000000000..779b6d4ff35
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/TL-Changes
@@ -0,0 +1,23 @@
+Changes applied to the libpaper-1.1.24+nmu2/ tree as obtained from:
+ ftp://ftp.de.debian.org/debian/pool/main/libp/libpaper/
+
+Removed:
+ COPYING
+ INSTALL
+ Makefile.in
+ aclocal.m4
+ compile
+ config.guess
+ config.sub
+ configure
+ depcomp
+ install-sh
+ ltmain.sh
+ missing
+ mkinstalldirs
+ lib/Makefile.in
+ man/Makefile.in
+ src/Makefile.in
+
+Removed unused dirs:
+ debian
diff --git a/Build/source/libs/libpaper/TLpatches/patch-01-JIS b/Build/source/libs/libpaper/TLpatches/patch-01-JIS
new file mode 100644
index 00000000000..ce2016ad995
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/patch-01-JIS
@@ -0,0 +1,44 @@
+diff -ur libpaper-1.1.24+nmu2.orig/lib/paperspecs libpaper-1.1.24+nmu2/lib/paperspecs
+--- libpaper-1.1.24+nmu2.orig/lib/paperspecs 2012-05-03 21:05:12.000000000 +0200
++++ libpaper-1.1.24+nmu2/lib/paperspecs 2013-10-24 11:32:28.000000000 +0200
+@@ -40,6 +40,18 @@
+ c6 114 162 mm
+ c7 81 114 mm
+ c8 57 81 mm
++jisb0 1030 1456 mm
++jisb1 728 1030 mm
++jisb2 515 728 mm
++jisb3 364 515 mm
++jisb4 257 364 mm
++jisb5 182 257 mm
++jisb6 128 182 mm
++jisb7 91 128 mm
++jisb8 64 91 mm
++jisb9 45 64 mm
++jisb10 32 45 mm
++b5var 182 230 mm
+ DL 110 220 mm
+ Comm10 297 684
+ Monarch 279 540
+diff -ur libpaper-1.1.24+nmu2.orig/lib/paperspecs.h libpaper-1.1.24+nmu2/lib/paperspecs.h
+--- libpaper-1.1.24+nmu2.orig/lib/paperspecs.h 2012-05-04 12:11:27.000000000 +0200
++++ libpaper-1.1.24+nmu2/lib/paperspecs.h 2013-10-24 11:32:42.000000000 +0200
+@@ -43,6 +43,18 @@
+ { "c6", 323.149606, 459.212598 },
+ { "c7", 229.606299, 323.149606 },
+ { "c8", 161.574803, 229.606299 },
++ { "jisb0", 2919.685039, 4127.244094 },
++ { "jisb1", 2063.622047, 2919.685039 },
++ { "jisb2", 1459.842520, 2063.622047 },
++ { "jisb3", 1031.811024, 1459.842520 },
++ { "jisb4", 728.503937, 1031.811024 },
++ { "jisb5", 515.905512, 728.503937 },
++ { "jisb6", 362.834646, 515.905512 },
++ { "jisb7", 257.952756, 362.834646 },
++ { "jisb8", 181.417323, 257.952756 },
++ { "jisb9", 127.559055, 181.417323 },
++ { "jisb10", 90.708661, 127.559055 },
++ { "b5var", 515.905512, 651.968504 },
+ { "DL", 311.811024, 623.622047 },
+ { "Comm10", 297.000000, 684.000000 },
+ { "Monarch", 279.000000, 540.000000 },
diff --git a/Build/source/libs/libpaper/TLpatches/patch-02-TL b/Build/source/libs/libpaper/TLpatches/patch-02-TL
new file mode 100644
index 00000000000..601ccb9d252
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/patch-02-TL
@@ -0,0 +1,171 @@
+diff -ur libpaper-1.1.24+nmu2.orig/lib/paper.c libpaper-1.1.24+nmu2/lib/paper.c
+--- libpaper-1.1.24+nmu2.orig/lib/paper.c 2010-04-24 14:12:11.000000000 +0200
++++ libpaper-1.1.24+nmu2/lib/paper.c 2013-10-24 15:45:37.955710461 +0200
+@@ -87,24 +87,11 @@
+ }
+
+ const char* defaultpapersizefile(void) {
+- return PAPERCONF;
++ return NULL;
+ }
+
+ const char* systempapersizefile(void) {
+- const char* paperconf = getenv(PAPERCONFVAR);
+-/*
+-Previously PAPERCONFVAR used to contain a paper name and PAPERSIZEVAR
+-contained a file path. Now they're reversed. If we don't find a '/'
+-in PAPERCONFVAR, fall-back to the old behaviour.
+-*/
+-
+- if ((paperconf != NULL) && (strchr(paperconf, '/') == NULL)) {
+- paperconf = getenv(PAPERSIZEVAR);
+- if ((paperconf != NULL) && (strchr(paperconf, '/') == NULL))
+- paperconf = NULL;
+- }
+-
+- return paperconf ? paperconf : defaultpapersizefile();
++ return NULL;
+ }
+
+ const char* defaultpapername(void) {
+@@ -112,26 +99,14 @@
+ }
+
+ char* systempapername(void) {
+- const char* paperconf;
+ char* paperstr;
+ char* paperenv;
+ const char* paperdef;
+- FILE* ps;
+- struct stat statbuf;
+ const struct paper* pp;
+- int c;
+-
+-/*
+-Previously PAPERSIZEVAR used to contain a file path and PAPERCONFVAR
+-contained a paper name. Now they're reversed. If we find a '/' in
+-PAPERSIZEVAR, fall-back to the old behaviour.
+-*/
+
+ paperenv = getenv(PAPERSIZEVAR);
+ if ((paperenv != NULL) && (strchr(paperenv, '/') != NULL)) {
+- paperenv = getenv(PAPERCONFVAR);
+- if ((paperenv != NULL) && (strchr(paperenv, '/') != NULL))
+- paperenv = NULL;
++ paperenv = NULL;
+ }
+
+ if (paperenv) {
+@@ -145,61 +120,6 @@
+ return strcpy(paperstr, paperenv);
+ }
+
+- paperconf = systempapersizefile();
+- if (paperconf && stat(paperconf, &statbuf) == -1) return 0;
+-
+- if (!paperconf) paperconf = defaultpapersizefile();
+-
+- if ((stat(paperconf, &statbuf) != -1) &&
+- (ps = fopen(paperconf, "r"))) {
+-
+- while ((c = getc(ps)) != EOF) {
+- if (c == '#') {
+- while ((c = getc(ps)) != EOF && c != '\n');
+- if (c == EOF) {
+- break;
+- }
+- } else if (!isspace(c)) {
+- unsigned n = 0, m = 64;
+- char* papername = malloc(m * sizeof(char));
+-
+- if (!papername) {
+- fclose(ps);
+- return 0;
+- }
+-
+- do {
+- if (n == m-1) {
+- char* newpaper = realloc(papername,
+- (m *= 2) * sizeof(char));
+- if (!newpaper) {
+- free(papername);
+- fclose(ps);
+- return 0;
+- }
+- papername = newpaper;
+- }
+- papername[n++] = c;
+- } while ((c = getc(ps)) != EOF && !isspace(c));
+-
+- papername[n] = 0;
+-
+- fclose(ps);
+-
+- paperstr = malloc((strlen(papername) + 1) * sizeof(char));
+- if (! paperstr) return 0;
+-
+- strcpy(paperstr, papername);
+- free(papername);
+-
+- if ((pp = paperinfo(paperstr)))
+- return strcpy(paperstr, pp->name);
+- else
+- return paperstr;
+- }
+- }
+- }
+-
+ paperdef = defaultpapername();
+ paperstr = malloc((strlen(paperdef) + 1) * sizeof(char));
+
+diff -ur libpaper-1.1.24+nmu2.orig/man/paperconf.1.in libpaper-1.1.24+nmu2/man/paperconf.1.in
+--- libpaper-1.1.24+nmu2.orig/man/paperconf.1.in 2012-05-03 21:05:12.000000000 +0200
++++ libpaper-1.1.24+nmu2/man/paperconf.1.in 2013-10-25 08:27:54.783329615 +0200
+@@ -1,4 +1,4 @@
+-.TH PAPERCONF 1 "24 April 2001"
++.TH PAPERCONF 1 "25 October 2013"
+ .SH NAME
+ .B paperconf
+ \- print paper configuration information
+@@ -46,13 +46,10 @@
+ prints the name of the system- or user-specified paper, obtained by
+ looking in order at the
+ .B @PAPERSIZEVAR@
+-environment variable, at the contents of the file specified by the
+-.B @PAPERCONFVAR@
+-environment variable, at the contents of
+-.B @PAPERCONF@
++environment variable
+ or by using
+-.B letter
+-as a fall-back value if none of the other alternatives are successful.
++.B a4
++as a fall-back value.
+ By default, width and height of the paper are printed in PostScript points.
+ .SH OPTIONS
+ .TP
+@@ -98,21 +95,9 @@
+ .SH ENVIRONMENT
+ .TP 20
+ .B @PAPERSIZEVAR@
+-Paper size to use regardless of what the papersize file contains.
+-.TP 20
+-.B @PAPERCONFVAR@
+-Full path to a file containing the paper size to use.
+-.SH FILES
+-.TP 20
+-.B @PAPERCONF@
+-Contains the name of the system-wide default paper size to be used
+-if the
+-.B @PAPERSIZEVAR@
+-and
+-.B @PAPERCONFVAR@
+-variables are not set.
++Paper size to use.
+ .SH AUTHOR
+ Yves Arrouye <arrouye@debian.org>
+-.SH SEE ALSO
+-.BR papersize (5)
++
++Modified for TeX Live by Peter Breitenlohner <tex-live@tug.org>
+
diff --git a/Build/source/libs/libpaper/TLpatches/patch-03-getopt b/Build/source/libs/libpaper/TLpatches/patch-03-getopt
new file mode 100644
index 00000000000..cec650d1108
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/patch-03-getopt
@@ -0,0 +1,49 @@
+diff -ur libpaper-1.1.24+nmu2.orig/man/paperconf.1.in libpaper-1.1.24+nmu2/man/paperconf.1.in
+--- libpaper-1.1.24+nmu2.orig/man/paperconf.1.in 2013-10-25 08:27:54.000000000 +0200
++++ libpaper-1.1.24+nmu2/man/paperconf.1.in 2013-11-20 13:59:18.000000000 +0100
+@@ -3,39 +3,12 @@
+ .B paperconf
+ \- print paper configuration information
+ .SH SYNOPSIS
+-.B paperconf
+-[
+-[
+-.B \-p
+-]
+-.I paper
+-|
+-.B \-d
+-|
+-.B \-a
+-]
+-[
+-.B \-z
+-]
+-[
+-.B \-n
+-|
+-.B \-N
+-]
+-[
+-.B \-s
+-|
+-.B \-w
+-|
+-.B \-h
+-]
+-[
+-.B \-c
+-|
+-.B \-m
+-|
+-.B \-i
+-]
++\fBpaperconf\fR
++[\fB\-z\fR]
++[\fB\-n\fR|\fB\-N\fR]
++[\fB\-s\fR|\fB\-w\fR|\fB\-h\fR]
++[\fB\-c\fR|\fB\-m\fR|\fB\-i\fR]
++[[\fB\-p\fR] \fIpaper\fR|\fB\-d\fR|\fB\-a\fR]
+ .SH DESCRIPTION
+ .B paperconf
+ prints information about a given paper.
diff --git a/Build/source/libs/libpaper/TLpatches/patch-04-unsigned b/Build/source/libs/libpaper/TLpatches/patch-04-unsigned
new file mode 100644
index 00000000000..13c798bc1e5
--- /dev/null
+++ b/Build/source/libs/libpaper/TLpatches/patch-04-unsigned
@@ -0,0 +1,29 @@
+diff -ur libpaper-1.1.24+nmu2.orig/lib/dimen.c libpaper-1.1.24+nmu2/lib/dimen.c
+--- libpaper-1.1.24+nmu2.orig/lib/dimen.c 2002-11-11 01:56:08.000000000 +0100
++++ libpaper-1.1.24+nmu2/lib/dimen.c 2014-06-18 08:31:52.000000000 +0200
+@@ -53,9 +53,9 @@
+
+ if (*(unit = what) == '-') ++unit;
+
+- for (; isdigit(*unit) || (*unit == '.' && !dot++); ++unit);
++ for (; isdigit((unsigned char)*unit) || (*unit == '.' && !dot++); ++unit);
+
+- if (*unit && !isalpha(*unit)) {
++ if (*unit && !isalpha((unsigned char)*unit)) {
+ return -1;
+ } else {
+ double base = atof(what);
+diff -ur libpaper-1.1.24+nmu2.orig/src/paperconf.c libpaper-1.1.24+nmu2/src/paperconf.c
+--- libpaper-1.1.24+nmu2.orig/src/paperconf.c 2012-05-03 21:05:12.000000000 +0200
++++ libpaper-1.1.24+nmu2/src/paperconf.c 2014-06-18 08:31:54.000000000 +0200
+@@ -53,8 +53,8 @@
+ printf("%s", papername(paper));
+ pr = 1;
+ } else if (options & OPT_UPPERNAME) {
+- if (islower(*papername(paper))) {
+- printf("%c%s", toupper(*papername(paper)), papername(paper) + 1);
++ if (islower((unsigned char)*papername(paper))) {
++ printf("%c%s", toupper((unsigned char)*papername(paper)), papername(paper) + 1);
+ } else {
+ printf("%s", papername(paper));
+ }