diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-04-30 13:21:50 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2013-04-30 13:21:50 +0000 |
commit | ef447158f844e9d9c2fb4e328cce5225e1f08fb9 (patch) | |
tree | 078ee5a14f27c241adecc0563617080fb5a6d562 /Build/source/texk/dvipdfmx | |
parent | d9138f40c346b88147148d28cf7e479013a51246 (diff) |
Add a compatible mode with the old behavior per Karl, where image cache is ignored (default).
git-svn-id: svn://tug.org/texlive/trunk@30184 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx')
-rw-r--r-- | Build/source/texk/dvipdfmx/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfmx/data/dvipdfmx.cfg | 3 | ||||
-rw-r--r-- | Build/source/texk/dvipdfmx/src/dpxfile.c | 10 | ||||
-rw-r--r-- | Build/source/texk/dvipdfmx/src/dvipdfmx.c | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfmx/src/pdfximage.c | 18 |
5 files changed, 28 insertions, 15 deletions
diff --git a/Build/source/texk/dvipdfmx/ChangeLog b/Build/source/texk/dvipdfmx/ChangeLog index 6de02b17a65..8def2587005 100644 --- a/Build/source/texk/dvipdfmx/ChangeLog +++ b/Build/source/texk/dvipdfmx/ChangeLog @@ -1,3 +1,9 @@ +2013-04-30 Akira Kakuto <kakuto@fuk.kindai.ac.jp> + + * src/dpxfile.c, src/pdfximage.c, src/dvipdfmx.c, data/dvipdfmx.cfg: + Add a compatible mode with the old behavior per Karl, where + image cache is ignored. + 2013-04-30 Peter Breitenlohner <peb@mppmu.mpg.de> * dvipdfmx.test: New shell script for a simple test. diff --git a/Build/source/texk/dvipdfmx/data/dvipdfmx.cfg b/Build/source/texk/dvipdfmx/data/dvipdfmx.cfg index 3aca31fd2ed..1832f5a9a85 100644 --- a/Build/source/texk/dvipdfmx/data/dvipdfmx.cfg +++ b/Build/source/texk/dvipdfmx/data/dvipdfmx.cfg @@ -193,7 +193,8 @@ D "rungs -q -dNOPAUSE -dBATCH -dEPSCrop -sDEVICE=pdfwrite -dCompatibilityLevel= %% Image cache life in hours %% 0 means erase all old images and leave new images %% -1 means erase all old images and also erase new images -%I -1 +%% -2 means ignore image cache +%I -2 %% Font Map Files %% diff --git a/Build/source/texk/dvipdfmx/src/dpxfile.c b/Build/source/texk/dvipdfmx/src/dpxfile.c index 7444632803a..8aa77d00d20 100644 --- a/Build/source/texk/dvipdfmx/src/dpxfile.c +++ b/Build/source/texk/dvipdfmx/src/dpxfile.c @@ -61,7 +61,7 @@ #endif static int verbose = 0; -int keep_cache = false; +int keep_cache = 0; void dpx_file_set_verbose (void) @@ -877,7 +877,11 @@ dpx_delete_old_cache (int life) struct dirent *de; time_t limit = time(NULL) - life * 60 * 60; - if (life >= 0) keep_cache = true; + if (life == -2) { + keep_cache = -1; + return; + } + if (life >= 0) keep_cache = 1; if ((dp = opendir(dir)) != NULL) { while((de = readdir(dp)) != NULL) { if (dpx_clear_cache_filter(de)) { @@ -900,7 +904,7 @@ dpx_delete_temp_file (char *tmp, int force) { if (!tmp) return; - if (force || !keep_cache) remove (tmp); + if (force || keep_cache != 1) remove (tmp); RELEASE(tmp); return; diff --git a/Build/source/texk/dvipdfmx/src/dvipdfmx.c b/Build/source/texk/dvipdfmx/src/dvipdfmx.c index 91371e5713a..cde17f051a6 100644 --- a/Build/source/texk/dvipdfmx/src/dvipdfmx.c +++ b/Build/source/texk/dvipdfmx/src/dvipdfmx.c @@ -89,7 +89,8 @@ static int pdfdecimaldigits = 2; /* Image cache life in hours */ /* 0 means erase all old images and leave new images */ /* -1 means erase all old images and also erase new images */ -static int image_cache_life = -1; +/* -2 means ignore image cache (default) */ +static int image_cache_life = -2; /* Encryption */ static int do_encryption = 0; @@ -186,9 +187,10 @@ show_usage (void) fprintf(stdout, "\t\tAnd negative values replace old values.\n"); fprintf(stdout, "-D template\tPS->PDF conversion command line template [none]\n"); fprintf(stdout, "-E \t\tEnable DVIPDFM emulation mode\n"); - fprintf(stdout, "-I number\tImage cache life in hours [-1]\n"); + fprintf(stdout, "-I number\tImage cache life in hours [-2]\n"); fprintf(stdout, " \t 0: erase all old images and leave new images\n"); fprintf(stdout, " \t-1: erase all old images and also erase new images\n"); + fprintf(stdout, " \t-2: ignore image cache\n"); fprintf(stdout, "-K number\tEncryption key length [40]\n"); fprintf(stdout, "-O number\tSet maximum depth of open bookmark items [0]\n"); fprintf(stdout, "-P number\tSet permission flags for PDF encryption [0x003C]\n"); diff --git a/Build/source/texk/dvipdfmx/src/pdfximage.c b/Build/source/texk/dvipdfmx/src/pdfximage.c index 1c18ea2ff9c..ff81ac697fb 100644 --- a/Build/source/texk/dvipdfmx/src/pdfximage.c +++ b/Build/source/texk/dvipdfmx/src/pdfximage.c @@ -193,7 +193,7 @@ pdf_close_images (void) * We also use this to convert a PS file only once if multiple * pages are imported from that file. */ - if (_opts.verbose > 1 && !keep_cache) + if (_opts.verbose > 1 && keep_cache != 1) MESG("pdf_image>> deleting temporary file \"%s\"\n", I->filename); dpx_delete_temp_file(I->filename, false); /* temporary filename freed here */ I->filename = NULL; @@ -883,19 +883,19 @@ ps_include_page (pdf_ximage *ximage) return -1; } - if (_opts.verbose > 1) { - MESG("\n"); - MESG("pdf_image>> Converting file \"%s\" --> \"%s\" via:\n", filename, temp); - MESG("pdf_image>> %s\n", distiller_template); - MESG("pdf_image>> ..."); - } - - if (stat(temp, &stat_t)==0 && stat(filename, &stat_o)==0 + if (keep_cache != -1 && stat(temp, &stat_t)==0 && stat(filename, &stat_o)==0 && stat_t.st_mtime > stat_o.st_mtime) { /* cache exist */ /*printf("\nLast file modification: %s", ctime(&stat_o.st_mtime)); printf("Last file modification: %s", ctime(&stat_t.st_mtime));*/ + ; } else { + if (_opts.verbose > 1) { + MESG("\n"); + MESG("pdf_image>> Converting file \"%s\" --> \"%s\" via:\n", filename, temp); + MESG("pdf_image>> %s\n", distiller_template); + MESG("pdf_image>> ..."); + } error = dpx_file_apply_filter(distiller_template, filename, temp, (unsigned char) pdf_get_version()); if (error) { |