From owner-freebsd-ports@FreeBSD.ORG Wed Mar 1 20:13:09 2006 Return-Path: X-Original-To: ports@FreeBSD.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EF3316A422 for ; Wed, 1 Mar 2006 20:13:09 +0000 (GMT) (envelope-from bsam@ipt.ru) Received: from mail.ipt.ru (mail.ipt.ru [80.253.10.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5CFB343D69 for ; Wed, 1 Mar 2006 20:13:03 +0000 (GMT) (envelope-from bsam@ipt.ru) Received: from srv.sem.ipt.ru ([192.168.12.1]) by mail.ipt.ru with esmtp (Exim 4.54 (FreeBSD)) id 1FEXh0-0000xi-Ai; Wed, 01 Mar 2006 23:13:02 +0300 Received: from bsam by srv.sem.ipt.ru with local (Exim 4.60 (FreeBSD)) (envelope-from ) id 1FEXiU-0000Vq-JL; Wed, 01 Mar 2006 23:14:34 +0300 To: Paul Schmehl References: <44050D77.2030503@j2d.lam.net.au> <84747890@srv.sem.ipt.ru> <18666752@srv.sem.ipt.ru> From: Boris Samorodov Date: Wed, 01 Mar 2006 23:14:34 +0300 In-Reply-To: (Paul Schmehl's message of "Wed, 01 Mar 2006 13:27:25 -0600") Message-ID: <25853573@srv.sem.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: ports@FreeBSD.org Subject: Re: FreeBSD Port: mpack-1.6 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Mar 2006 20:13:09 -0000 --=-=-= On Wed, 01 Mar 2006 13:27:25 -0600 Paul Schmehl wrote: > --On Wednesday, March 01, 2006 22:21:35 +0300 Boris Samorodov > wrote: > >> > > >> I've already incorporated that patch in to the other one and deleted > >> it, but that doesn't fix this bug. > > > > Hm: > > > > ----- > ># uname -a > > FreeBSD srv.sem.ipt.ru 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Tue Feb > > 28 22:21:02 MSK 2006 bsam@srv.sem.ipt.ru:/usr/obj/usr/src/sys/SRV > > i386 > > > ># cd /usr/ports/converters/mpack > ># rm files/patch-unixpk_c > > (Makefile,v 1.18) > ># make > > ... > ># cd work/mpack-1.6 > ># mkdir /usr/tmp > ># ./mpack -s "test" Makefile bsam@ipt.ru > ># > > ----- > > > > That's it. With that patch I've got "File exists" error. > > Double check you additional patches? > > > Again, all the patches do is change a hard-coded path for TMPDIR > from Again, did you try to do what I wrote? Did you get errors? > "/usr/tmp" to "/tmp". They don't change anything else. The program, > bulit from source, fails with a "File or directory not found" error > because the hard-coded path, "/usr/tmp", does not exist. When you fix > *that* problem (by applying my patches), you get a different error, > "File already exists", in the same place in the code. Yes. And I show you how to override that error. Just delete the patch file. BTW if you read README.unix at the sources you may see that one can change the hard-coded path. Just define environment variable TMPDIR=/tmp. No C-coding. Just simple. Test it! (I did) > There's a bug in the program that is not allowing the program to open > a file in "/tmp" and write to it, then complete its work and exit > successfully. The bug is introduced by the patch. Restore the port from cvs (cvsup) and just delete the patch. And define TMPDIR. > My problem is, I'm not a programmer, and my C skills are not that > good, so I'm having problems figuring out what's causing the error > (other than the fact that I know it creates the file, and then, when > it tries to write to it, complains that the file already exists (which > seems kind of silly to me.) > There's not a problem with my patches, AFAICT, there's a problem with > the program. If there's any programmers on this list, who have the There is no problem with the program. There is a problem with your patches. > time, I could use some help tracking this down. I emailed the > developers, but I don't know if they'll get back to me or not. I'm also not a C programmer. But here is the patch you asked for: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=mpack.patch Content-Description: mpack patch diff -ruN mpack.orig/files/patch-unixos_c mpack/files/patch-unixos_c --- mpack.orig/files/patch-unixos_c Thu Jan 1 03:00:00 1970 +++ mpack/files/patch-unixos_c Wed Mar 1 22:47:24 2006 @@ -0,0 +1,11 @@ +--- unixos.c.orig Wed Mar 1 22:45:13 2006 ++++ unixos.c Wed Mar 1 22:46:49 2006 +@@ -90,7 +90,7 @@ + strcpy(buf, getenv("TMPDIR")); + } + else { +- strcpy(buf, "/usr/tmp"); ++ strcpy(buf, "/tmp"); + } + strcat(buf, "/m-prts-"); + p = getenv("USER"); diff -ruN mpack.orig/files/patch-unixpk_c mpack/files/patch-unixpk_c --- mpack.orig/files/patch-unixpk_c Wed Mar 1 22:39:37 2006 +++ mpack/files/patch-unixpk_c Wed Mar 1 22:50:31 2006 @@ -1,12 +1,12 @@ $OpenBSD: patch-unixpk_c,v 1.1 2002/08/09 01:15:19 naddy Exp $ --- unixpk.c.orig Thu Feb 16 22:39:50 1995 +++ unixpk.c Mon Aug 5 12:30:30 2002 -@@ -165,7 +165,7 @@ char **argv; - strcpy(fnamebuf, "/tmp"); +@@ -164,7 +164,7 @@ + strcpy(fnamebuf, getenv("TMPDIR")); + } + else { +- strcpy(fnamebuf, "/usr/tmp"); ++ strcpy(fnamebuf, "/tmp"); } strcat(fnamebuf, "/mpackXXXXXX"); -- mktemp(fnamebuf); -+ close(mkstemp(fnamebuf)); - outfname = strsave(fnamebuf); - } - + close(mkstemp(fnamebuf)); --=-=-= What it does: 1. Rewrites "/usr/tmp" to "/tmp". 2. Deletes changes from previous files/patch-unixpk_c. Just what I told you to do. To use the patch: # cd /usr/ports/converters # patch -p0 < _the_patch_ (delete files/*.orig files) # make all install clean WBR -- Boris B. Samorodov, Research Engineer InPharmTech Co, http://www.ipt.ru Telephone & Internet Service Provider --=-=-=--