#! /bin/sh /usr/share/dpatch/dpatch-run ## 04_displaywho.dpatch by Roland Rosenfeld ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Remove comment "For: @ ()" from PS files ## DP: (generated in genps.c and genpictex.c), because we won't ship personal ## DP: information in output files (Closes: #316382). @DPATCH@ --- transfig~/fig2dev/dev/genpictex.c +++ transfig/fig2dev/dev/genpictex.c @@ -125,7 +125,9 @@ { char host[256]; time_t when; +#ifdef DISPLAYWHO struct passwd *who; +#endif texfontsizes[0] = texfontsizes[1] = TEXFONTSIZE(font_size != 0.0? font_size : DEFAULT_FONT_SIZE); @@ -139,12 +141,16 @@ fprintf(tfp, "%%%%Created by: %s Version %s Patchlevel %s\n", prog, VERSION, PATCHLEVEL); fprintf(tfp, "%%%%CreationDate: %s", ctime(&when)); +#ifdef DISPLAYWHO who = getpwuid(getuid()); +#endif if (gethostname(host, sizeof(host)) == -1) (void)strcpy(host, "unknown-host!?!?"); +#ifdef DISPLAYWHO if (who) fprintf(tfp, "%%%%User: %s@%s (%s)\n", who->pw_name, host, who->pw_gecos); +#endif /* print any whole-figure comments prefixed with "% " */ if (objects->comments) { --- transfig~/fig2dev/dev/genps.c +++ transfig/fig2dev/dev/genps.c @@ -449,7 +449,9 @@ F_compound *objects; { char host[256]; +#ifdef DISPLAYWHO struct passwd *who; +#endif time_t when; int itmp, jtmp; int i; @@ -618,7 +620,9 @@ else fprintf(tfp, "%%!PS-Adobe-2.0\n"); /* PostScript magic strings */ +#ifdef DISPLAYWHO who = getpwuid(getuid()); +#endif if (gethostname(host, sizeof(host)) == -1) (void)strcpy(host, "unknown-host!?!?"); (void) time(&when); @@ -627,9 +631,11 @@ fprintf(tfp, "%%%%Creator: %s Version %s Patchlevel %s\n", prog, VERSION, PATCHLEVEL); fprintf(tfp, "%%%%CreationDate: %s", ctime(&when)); +#ifdef DISPLAYWHO if (who) fprintf(tfp, "%%%%For: %s@%s (%s)\n", who->pw_name, host, who->pw_gecos); +#endif DISPLAYWHO /* calc initial clipping area to size of the bounding box (this is needed for later clipping by arrowheads */