From owner-ports-jp@jp.freebsd.org  Tue Dec  5 22:20:00 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id WAA24242;
	Tue, 5 Dec 2000 22:20:00 +0900 (JST)
	(envelope-from owner-ports-jp@jp.FreeBSD.org)
Received: from pixy.netlab.is.tsukuba.ac.jp (qmailr@netlab-83.netlab.is.tsukuba.ac.jp [130.158.83.243])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with SMTP id WAA24237
	for <ports-jp@jp.freebsd.org>; Tue, 5 Dec 2000 22:19:59 +0900 (JST)
	(envelope-from one@netlab.is.tsukuba.ac.jp)
Received: (qmail 2394 invoked from network); 5 Dec 2000 13:19:55 -0000
Received: from unknown (HELO LOUIE.netlab.is.tsukuba.ac.jp) (130.158.85.22)
  by netlab-83.netlab.is.tsukuba.ac.jp with SMTP; 5 Dec 2000 13:19:55 -0000
Date: Tue, 05 Dec 2000 22:21:03 +0900
Message-ID: <ulmtv80n4.wl@LOUIE.netlab.is.tsukuba.ac.jp>
From: TANNO Hajime <one@netlab.is.tsukuba.ac.jp>
To: ports-jp@jp.freebsd.org
In-Reply-To: <200012040804.RAA05062@shark.math.cst.nihon-u.ac.jp>
References: <200012040804.RAA05062@shark.math.cst.nihon-u.ac.jp>
User-Agent: Wanderlust/2.5.4 (Smooth) EMIKO/1.14.0 (Zoomastigophora) FLIM/1.14.0 (Ninokuchi) APEL/10.2 Emacs/20.7 (i386--freebsd) MULE/4.0 (HANANOEN)
Organization: Computer Networks Laboratory, Institute of Information Sciences and Electronics, University of Tsukuba, JAPAN
MIME-Version: 1.0 (generated by EMIKO 1.14.0 - "Zoomastigophora")
Content-Type: text/plain; charset=ISO-2022-JP
Reply-To: ports-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: ports-jp 10491
Subject: [ports-jp 10491] Re: tgif-nls does not work with -print -ps option
Errors-To: owner-ports-jp@jp.freebsd.org
Sender: owner-ports-jp@jp.freebsd.org
X-Originator: one@netlab.is.tsukuba.ac.jp

$B$3$s$K$A$O!#C0Ln$G$9!#(B

$B$3$s$K$A$O!#C0Ln$G$9!#(B

>> In <200012040804.RAA05062@shark.math.cst.nihon-u.ac.jp>
>> $B!H;VB<!I(B = SHIMURA Tatsuya <shimura@math.cst.nihon-u.ac.jp> wrote:

$B;VB<$5$s(B>
> FreeBSD 4.2R ports $B$N(B graphics/tgif-nls $B$O!"(Btgif -print -ps xxxx.obj $B$J$I$H$9$k$H!"(B
> $B4V0c$C$?(B directory $B$K:n6HMQ$N%U%!%$%k$r:n$j$K9T$C$F$$$k$h$&$G$9!#(B

> -D_DONT_USE_MKTEMP $B$K$D$$$F$N%3%a%s%H$d!"%3%s%Q%$%k;~$N(B warning $B$+$i9M(B
> $B$($k$H!"(B-D_DONT_USE_MKTEMP $B$r%3%a%s%H%"%&%H$9$k$H$$$&$N$O@5$7$$BP=hK!(B
> $B$G$O$J$$$H;W$&$N$G$9$,!"%W%m%0%i%`$,FI$a$J$$$N$G@5$7$$2r7hJ}K!$O$o$+$j(B
> $B$^$;$s!#(B

-print $B%*%W%7%g%s$r;XDj$7$?$H$-$K!":n6HMQ%G%#%l%/%H%j$r$"$i$o$9JQ?t$,(B
$B=i4|2=$5$l$:$KMxMQ$5$l$F$7$^$C$F$$$k$h$&$G$9!#(B

$B;d$b(B C $B$O$h$/$o$+$i$J$$$N$G$9$,!"0J2<$N%Q%C%A$NDI2C$G$I$&$G$7$g$&$+!#(B

$B$b$7$3$l$GLdBj$J$$$h$&$G$7$?$i!"(Btgif-nls $B$N(B port $B$NJ}$K(B commit $B$7$F(B
$B$$$?$@$1$k$H9,$$$G$9!d(B ports-commiter $B$N3'MM(B

file: tgif-nls/files/patch-ba
--- setup.c.orig	Tue Oct 31 00:09:01 2000
+++ setup.c	Tue Dec  5 19:35:39 2000
@@ -842,6 +842,46 @@
    return TRUE;
 }
 
+void SetupPr()
+{
+   char *c_ptr=NULL;
+   struct stat stat_buf;
+
+   *homeDir = *bootDir = *tgifDir = '\0';
+
+   if ((c_ptr=getenv("HOME")) == NULL) {
+      strcpy(homeDir, DIR_SEP_STR);
+   } else if (strlen(c_ptr) >= MAXPATHLENGTH-1) {
+      strcpy(homeDir, DIR_SEP_STR);
+   } else {
+      strcpy(homeDir, c_ptr);
+   }
+   sprintf(tgifDir, "%s%c.%s", homeDir, DIR_SEP, TOOL_NAME);
+   memset(&stat_buf, 0, sizeof(struct stat));
+   if (stat(tgifDir, &stat_buf) != 0) {
+      /* directory does not exist */
+      if (mkdir(tgifDir, 0755) != 0) {
+         fprintf(stderr, TgLoadString(STID_CANT_CREATE_NAMED_DIRECTORY),
+               tgifDir);
+         fprintf(stderr, "\n");
+         if (!PRTGIF) {
+            fprintf(stderr, "\t");
+            fprintf(stderr, TgLoadString(STID_OPR_USING_NAMED_DIR_WILL_FAIL),
+                  tgifDir);
+            fprintf(stderr, "\n");
+         }
+      }
+   }
+   if (*bootDir == '\0') {
+      GetWorkingDirectory(bootDir, sizeof(bootDir));
+   }
+#ifndef _TMP_DIR_IN_HOME_DIR
+      UtilStrCpyN(tmpDir, sizeof(tmpDir), TMP_DIR);
+#else /* _TMP_DIR_IN_HOME_DIR */
+      UtilStrCpyN(tmpDir, sizeof(tmpDir)-1, tgifDir);
+#endif /* ~_TMP_DIR_IN_HOME_DIR */
+}
+
 void Setup()
 {
    int bitmask=0, x_neg_in_def=FALSE, y_neg_in_def=FALSE;

--- tgif.c.orig	Tue Dec  5 19:04:42 2000
+++ tgif.c	Tue Dec  5 19:06:19 2000
@@ -334,6 +334,7 @@
    while (argc > argc_to_be) {
       argc--; argv++;
    }
+   SetupPr();
    InitPaperSize();
    if (PRTGIF && !cmdLineOpenDisplay) InitDontReencode(NULL);
    if (argc <= 0) {


--- Hajime Tanno / Computer Networks Lab., Univ. of Tsukuba
