[110882] trunk/dports/tex/pTeX
takanori at macports.org
takanori at macports.org
Mon Sep 9 05:26:26 PDT 2013
Revision: 110882
https://trac.macports.org/changeset/110882
Author: takanori at macports.org
Date: 2013-09-09 05:26:25 -0700 (Mon, 09 Sep 2013)
Log Message:
-----------
pTeX:
- fixed buffer overflow problems in mendexk
( http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=534641 etc.)
- from now on, font map files are created/updated during the post-activate phase,
not in the destroot phase
(because 'updmap-sys' cannot open tmpdir properly on the latest MacPorts)
- add notes
Modified Paths:
--------------
trunk/dports/tex/pTeX/Portfile
trunk/dports/tex/pTeX/files/patch-2extract-src.sh.diff
Added Paths:
-----------
trunk/dports/tex/pTeX/files/archive/mendexk-ptex#00349.diff
Modified: trunk/dports/tex/pTeX/Portfile
===================================================================
--- trunk/dports/tex/pTeX/Portfile 2013-09-09 08:40:39 UTC (rev 110881)
+++ trunk/dports/tex/pTeX/Portfile 2013-09-09 12:26:25 UTC (rev 110882)
@@ -4,7 +4,7 @@
name pTeX
version 20110314
-revision 6
+revision 7
epoch ${version}
set ver_ptetex3 20080616
set ver_dvipdfmx 20110311
@@ -261,12 +261,12 @@
# Update ls-R, map and fmt files (before packaging)
set destroot_var "PATH=\"${destroot}${prefix}/bin:$env(PATH)\" TEXMFMAIN=${destroot}${prefix}/share/texmf LD_LIBRARY_PATH=${destroot}${prefix}/lib"
system "${destroot_var} mktexlsr"
- if {![variant_isset no_hiragino]} {
- system "${destroot_var} updmap-sys --setoption kanjiEmbed hiragino --nomkmap || true"
- system "${destroot_var} updmap-sys --disable morisawa.map --nomkmap || true"
- system "${destroot_var} updmap-sys --enable KanjiMap morisawa-hiraginoEmbed.map --nomkmap || true"
- system "${destroot_var} updmap-sys"
- }
+# if {![variant_isset no_hiragino]} {
+# system "${destroot_var} updmap-sys --setoption kanjiEmbed hiragino --nomkmap || true"
+# system "${destroot_var} updmap-sys --disable morisawa.map --nomkmap || true"
+# system "${destroot_var} updmap-sys --enable KanjiMap morisawa-hiraginoEmbed.map --nomkmap || true"
+# system "${destroot_var} updmap-sys"
+# }
system "${destroot_var} fmtutil-sys --all"
# Modify mktex.opt to force use of varfonts
@@ -294,6 +294,12 @@
system "${prefix}/bin/updmap-sys --enable Map ${f} --nomkmap || true"
}
+ if {![variant_isset no_hiragino]} {
+ system "${prefix}/bin/updmap-sys --setoption kanjiEmbed hiragino --nomkmap || true"
+ system "${prefix}/bin/updmap-sys --disable morisawa.map --nomkmap || true"
+ system "${prefix}/bin/updmap-sys --enable KanjiMap morisawa-hiraginoEmbed.map --nomkmap || true"
+ }
+
system "${prefix}/bin/updmap-sys"
system "${prefix}/bin/fmtutil-sys --all"
}
@@ -336,6 +342,11 @@
platform darwin 9 {}
+notes "
+This port is based on (p)teTeX, which is no longer maintained.
+If there is no special reason, it is highly recommended to use TeXLive.
+"
+
livecheck.type regex
livecheck.url "http://tutimura.ath.cx/~nob/tex/ptetex/ptetex3/?C=M;O=D"
livecheck.version ${ver_ptetex3}
Added: trunk/dports/tex/pTeX/files/archive/mendexk-ptex#00349.diff
===================================================================
--- trunk/dports/tex/pTeX/files/archive/mendexk-ptex#00349.diff (rev 0)
+++ trunk/dports/tex/pTeX/files/archive/mendexk-ptex#00349.diff 2013-09-09 12:26:25 UTC (rev 110882)
@@ -0,0 +1,313 @@
+--- tetex-src-3.0/texk/mendexk/fwrite.c.orig 2013-09-09 18:13:05.000000000 +0900
++++ tetex-src-3.0/texk/mendexk/fwrite.c 2013-09-09 18:14:31.000000000 +0900
+@@ -12,12 +12,15 @@
+
+ int line_length=0;
+
++#define BUFFERLEN 4096
++
+ static void printpage P4H(struct index*, FILE*, int, char*);
+ static int range_check P3H(struct index, int, char*);
+ static void linecheck P2H(char*, char*);
+ static void crcheck P2H(char*, FILE*);
+
+-#define TAIL(x) (x+strlen(x))
++#define TAIL(x) ((x)+strlen(x))
++#define LEN(x) (sizeof(x)-strlen(x))
+ #define BEGIN_PVAR_FUNC { /* this is dummy, included in PVAR2C() */
+ #define END_PVAR_FUNC }
+
+@@ -66,7 +69,7 @@
+ void indwrite P3C(char*, filename, struct index *, ind, int ,pagenum)
+ {
+ int i,j,hpoint=0;
+- unsigned char datama[256],lbuff[4096];
++ unsigned char datama[256],lbuff[BUFFERLEN];
+ FILE *fp;
+
+ if (filename[0]!='\0') fp=fopen(filename,"w");
+@@ -93,7 +96,7 @@
+ fprintf(fp,"%s%s%s",lethead_prefix,symhead_negative,lethead_suffix);
+ }
+ }
+- sprintf(lbuff,"%s%s",item_0,ind[i].idx[0]);
++ snprintf(lbuff,sizeof(lbuff),"%s%s",item_0,ind[i].idx[0]);
+ }
+ else if (alphabet(ind[i].dic[0][0])) {
+ if (lethead_flag>0) {
+@@ -102,7 +105,7 @@
+ else if (lethead_flag<0) {
+ fprintf(fp,"%s%c%s",lethead_prefix,ind[i].dic[0][0]+32,lethead_suffix);
+ }
+- sprintf(lbuff,"%s%s",item_0,ind[i].idx[0]);
++ snprintf(lbuff,sizeof(lbuff),"%s%s",item_0,ind[i].idx[0]);
+ }
+ else if (japanese(ind[i].dic[0])) {
+ if (lethead_flag) {
+@@ -119,7 +122,7 @@
+ }
+ fputs(lethead_suffix,fp);
+ }
+- sprintf(lbuff,"%s%s",item_0,ind[i].idx[0]);
++ snprintf(lbuff,sizeof(lbuff),"%s%s",item_0,ind[i].idx[0]);
+ for (hpoint=0;hpoint<(strlen(datama)/2);hpoint++) {
+ if (ind[i].dic[0][1]<datama[hpoint*2+1]) {
+ break;
+@@ -128,18 +131,18 @@
+ }
+ switch (ind[i].words) {
+ case 1:
+- sprintf(TAIL(lbuff),"%s",delim_0);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",delim_0);
+ break;
+
+ case 2:
+- sprintf(TAIL(lbuff),"%s%s",item_x1,ind[i].idx[1]);
+- sprintf(TAIL(lbuff),"%s",delim_1);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s",item_x1,ind[i].idx[1]);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",delim_1);
+ break;
+
+ case 3:
+- sprintf(TAIL(lbuff),"%s%s",item_x1,ind[i].idx[1]);
+- sprintf(TAIL(lbuff),"%s%s",item_x2,ind[i].idx[2]);
+- sprintf(TAIL(lbuff),"%s",delim_2);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s",item_x1,ind[i].idx[1]);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s",item_x2,ind[i].idx[2]);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",delim_2);
+ break;
+
+ default:
+@@ -195,41 +198,41 @@
+
+ switch (ind[i].words) {
+ case 1:
+- sprintf(TAIL(lbuff),"%s%s%s",item_0,ind[i].idx[0],delim_0);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_0,ind[i].idx[0],delim_0);
+ break;
+
+ case 2:
+ if (strcmp(ind[i-1].dic[0],ind[i].dic[0])!=0) {
+- sprintf(TAIL(lbuff),"%s%s%s",item_0,ind[i].idx[0],item_x1);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_0,ind[i].idx[0],item_x1);
+ }
+ else {
+ if (ind[i-1].words==1) {
+- sprintf(TAIL(lbuff),"%s",item_01);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",item_01);
+ }
+ else {
+- sprintf(TAIL(lbuff),"%s",item_1);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",item_1);
+ }
+ }
+- sprintf(TAIL(lbuff),"%s",ind[i].idx[1]);
+- sprintf(TAIL(lbuff),"%s",delim_1);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",ind[i].idx[1]);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",delim_1);
+ break;
+
+ case 3:
+ if (strcmp(ind[i-1].dic[0],ind[i].dic[0])) {
+- sprintf(TAIL(lbuff),"%s%s",item_0,ind[i].idx[0]);
+- sprintf(TAIL(lbuff),"%s%s%s",item_x1,ind[i].idx[1],item_x2);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s",item_0,ind[i].idx[0]);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_x1,ind[i].idx[1],item_x2);
+ }
+ else if (ind[i-1].words==1) {
+- sprintf(TAIL(lbuff),"%s%s%s",item_01,ind[i].idx[1],item_x2);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_01,ind[i].idx[1],item_x2);
+ }
+ else if (strcmp(ind[i-1].dic[1],ind[i].dic[1])) {
+- if (ind[i-1].words==2) sprintf(TAIL(lbuff),"%s%s%s",item_1,ind[i].idx[1],item_12);
+- else sprintf(TAIL(lbuff),"%s%s%s",item_1,ind[i].idx[1],item_x2);
++ if (ind[i-1].words==2) snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_1,ind[i].idx[1],item_12);
++ else snprintf(TAIL(lbuff),LEN(lbuff),"%s%s%s",item_1,ind[i].idx[1],item_x2);
+ }
+ else {
+- sprintf(TAIL(lbuff),"%s",item_2);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",item_2);
+ }
+- sprintf(TAIL(lbuff),"%s%s",ind[i].idx[2],delim_2);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s%s",ind[i].idx[2],delim_2);
+ break;
+
+ default:
+@@ -247,7 +250,7 @@
+ static void printpage P4C(struct index*, ind, FILE* ,fp, int, num, char*, lbuff)
+ {
+ int i,j,k,cc;
+- char buff[4096],tmpbuff[4096],errbuff[4096];
++ char buff[BUFFERLEN],tmpbuff[BUFFERLEN],errbuff[BUFFERLEN];
+
+ buff[0]=tmpbuff[0]='\0';
+
+@@ -266,25 +269,25 @@
+ || ind[num].p[j].enc[0]==range_close)
+ ind[num].p[j].enc++;
+ if (strlen(ind[num].p[j].enc)>0) {
+- sprintf(buff,"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
++ snprintf(buff,sizeof(buff),"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
+ }
+ if (strlen(suffix_3p)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))==2) {
+- sprintf(TAIL(buff),"%s%s",ind[num].p[j].page,suffix_3p);
++ snprintf(TAIL(buff),LEN(buff),"%s%s",ind[num].p[j].page,suffix_3p);
+ }
+ else if (strlen(suffix_mp)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))>=2) {
+- sprintf(TAIL(buff),"%s%s",ind[num].p[j].page,suffix_mp);
++ snprintf(TAIL(buff),LEN(buff),"%s%s",ind[num].p[j].page,suffix_mp);
+ }
+ else if (strlen(suffix_2p)>0 && (pnumconv(ind[num].p[cc].page,ind[num].p[cc].attr[0])-pnumconv(ind[num].p[j].page,ind[num].p[j].attr[0]))==1) {
+- sprintf(TAIL(buff),"%s%s",ind[num].p[j].page,suffix_2p);
++ snprintf(TAIL(buff),LEN(buff),"%s%s",ind[num].p[j].page,suffix_2p);
+ }
+ else {
+- sprintf(TAIL(buff),"%s%s",ind[num].p[j].page,delim_r);
+- sprintf(TAIL(buff),"%s",ind[num].p[cc].page);
++ snprintf(TAIL(buff),LEN(buff),"%s%s",ind[num].p[j].page,delim_r);
++ snprintf(TAIL(buff),LEN(buff),"%s",ind[num].p[cc].page);
+ }
+- sprintf(TAIL(tmpbuff),"%s",buff);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s",buff);
+ buff[0]='\0';
+ if (strlen(ind[num].p[j].enc)>0) {
+- sprintf(TAIL(tmpbuff),"%s",encap_suffix);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s",encap_suffix);
+ }
+ linecheck(lbuff,tmpbuff);
+ j=cc;
+@@ -292,53 +295,53 @@
+ goto PRINT;
+ }
+ else {
+- sprintf(TAIL(tmpbuff),"%s",delim_n);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s",delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ }
+ else if (strlen(ind[num].p[j].enc)>0) {
+ /* normal encap */
+ if (ind[num].p[j].enc[0]==range_close) {
+- sprintf(errbuff,"Warning: Unmatched range closing operator \'%c\',",range_close);
+- for (i=0;i<ind[num].words;i++) sprintf(TAIL(errbuff),"%s.",ind[num].idx[i]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range closing operator \'%c\',",range_close);
++ for (i=0;i<ind[num].words;i++) snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind[num].idx[i]);
+ warn_printf(efp, "%s\n", errbuff);
+ ind[num].p[j].enc++;
+ }
+ if (strlen(ind[num].p[j].enc)>0) {
+- sprintf(TAIL(tmpbuff),"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
+- sprintf(TAIL(tmpbuff),"%s%s%s",ind[num].p[j].page,encap_suffix,delim_n);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s%s",ind[num].p[j].page,encap_suffix,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ else {
+- sprintf(TAIL(tmpbuff),"%s%s",ind[num].p[j].page,delim_n);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s",ind[num].p[j].page,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ }
+ else {
+ /* no encap */
+- sprintf(TAIL(tmpbuff),"%s%s",ind[num].p[j].page,delim_n);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s",ind[num].p[j].page,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ }
+
+ if (ind[num].p[j].enc[0]==range_open) {
+- sprintf(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open);
+- for (k=0;k<ind[num].words;k++) sprintf(TAIL(errbuff),"%s.",ind[num].idx[k]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range opening operator \'%c\',",range_open);
++ for (k=0;k<ind[num].words;k++) snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind[num].idx[k]);
+ warn_printf(efp, "%s\n", errbuff);
+ ind[num].p[j].enc++;
+ }
+ else if (ind[num].p[j].enc[0]==range_close) {
+- sprintf(errbuff,"Warning: Unmatched range closing operator \'%c\',",range_close);
+- for (k=0;k<ind[num].words;k++) sprintf(TAIL(errbuff),"%s.",ind[num].idx[k]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range closing operator \'%c\',",range_close);
++ for (k=0;k<ind[num].words;k++) snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind[num].idx[k]);
+ warn_printf(efp, "%s\n", errbuff);
+ ind[num].p[j].enc++;
+ }
+ if (strlen(ind[num].p[j].enc)>0) {
+- sprintf(TAIL(tmpbuff),"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
+- sprintf(TAIL(tmpbuff),"%s%s",ind[num].p[j].page,encap_suffix);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s%s",encap_prefix,ind[num].p[j].enc,encap_infix);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s%s",ind[num].p[j].page,encap_suffix);
+ }
+ else {
+- sprintf(TAIL(tmpbuff),"%s",ind[num].p[j].page);
++ snprintf(TAIL(tmpbuff),LEN(tmpbuff),"%s",ind[num].p[j].page);
+ }
+ linecheck(lbuff,tmpbuff);
+
+@@ -351,12 +354,12 @@
+ static int range_check P3C(struct index, ind, int, count, char*, lbuff)
+ {
+ int i,j,k,cc1,cc2,start,force=0;
+- char tmpbuff[4096],errbuff[4096];
++ char tmpbuff[BUFFERLEN],errbuff[BUFFERLEN];
+
+ for (i=count;i<ind.num+1;i++) {
+ if (ind.p[i].enc[0]==range_close) {
+- sprintf(errbuff,"Warning: Unmatched range closing operator \'%c\',",range_close);
+- sprintf(TAIL(errbuff),"%s.",ind.idx[0]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range closing operator \'%c\',",range_close);
++ snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind.idx[0]);
+ warn_printf(efp, "%s\n", errbuff);
+ ind.p[i].enc++;
+ }
+@@ -372,21 +375,20 @@
+ break;
+ }
+ else if (j!=i && ind.p[j].enc[0]==range_open) {
+- sprintf(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open);
+- for (k=0;k<ind.words;k++) sprintf(TAIL(errbuff),"%s.",ind.idx[k]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range opening operator \'%c\',",range_open);
++ for (k=0;k<ind.words;k++) snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind.idx[k]);
+ warn_printf(efp, "%s\n", errbuff);
+ ind.p[j].enc++;
+ }
+ if (strlen(ind.p[j].enc)>0) {
+- sprintf(tmpbuff,"%s%s%s",encap_prefix,ind.p[j].enc,encap_infix);
+- sprintf(tmpbuff,"%s%s%s",ind.p[j].page,encap_suffix,delim_n);
++ snprintf(tmpbuff,sizeof(tmpbuff),"%s%s%s%s%s%s",encap_prefix,ind.p[j].enc,encap_infix,ind.p[j].page,encap_suffix,delim_n);
+ linecheck(lbuff,tmpbuff);
+ }
+ }
+ }
+ if (j==ind.num+1) {
+- sprintf(errbuff,"Warning: Unmatched range opening operator \'%c\',",range_open);
+- for (k=0;k<ind.words;k++) sprintf(TAIL(errbuff),"%s.",ind.idx[k]);
++ snprintf(errbuff,sizeof(errbuff),"Warning: Unmatched range opening operator \'%c\',",range_open);
++ for (k=0;k<ind.words;k++) snprintf(TAIL(errbuff),LEN(errbuff),"%s.",ind.idx[k]);
+ warn_printf(efp, "%s\n", errbuff);
+ }
+ i=j-1;
+@@ -418,12 +420,12 @@
+ static void linecheck P2C(char*, lbuff, char*, tmpbuff)
+ {
+ if (line_length+strlen(tmpbuff)>line_max) {
+- sprintf(TAIL(lbuff),"\n%s%s",indent_space,tmpbuff);
++ snprintf(TAIL(lbuff),LEN(lbuff),"\n%s%s",indent_space,tmpbuff);
+ line_length=indent_length+strlen(tmpbuff);
+ tmpbuff[0]='\0';
+ }
+ else {
+- sprintf(TAIL(lbuff),"%s",tmpbuff);
++ snprintf(TAIL(lbuff),LEN(lbuff),"%s",tmpbuff);
+ line_length+=strlen(tmpbuff);
+ tmpbuff[0]='\0';
+ }
+@@ -432,7 +434,7 @@
+ static void crcheck P2C(char*, lbuff, FILE*, fp)
+ {
+ int i;
+- char buff[4096];
++ char buff[BUFFERLEN];
+
+ for (i=strlen(lbuff);i>=0;i--) {
+ if (lbuff[i]=='\n') {
Modified: trunk/dports/tex/pTeX/files/patch-2extract-src.sh.diff
===================================================================
--- trunk/dports/tex/pTeX/files/patch-2extract-src.sh.diff 2013-09-09 08:40:39 UTC (rev 110881)
+++ trunk/dports/tex/pTeX/files/patch-2extract-src.sh.diff 2013-09-09 12:26:25 UTC (rev 110882)
@@ -73,7 +73,7 @@
#exit # uncomment if 'mktemp' command doesn't exist
# Don't use PID for temporary file names in scripts. (impoted from FC4)
cpatch security/tetex-3.0-badscript.patch 1 $SRC
-@@ -263,7 +258,15 @@
+@@ -263,7 +258,16 @@
## check
@@ -85,6 +85,7 @@
+ cpatch archive/dvipdfm-png14.diff 1 $SRC
+ cpatch archive/getline-lion.diff 1 $SRC
+ cpatch archive/pdftexdir-png15.diff 1 $SRC
++ cpatch archive/mendexk-ptex#00349.diff 1 $SRC
+ exit
+fi
cat <<EOF
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130909/42709775/attachment-0001.html>
More information about the macports-changes
mailing list