NetBSD Problem Report #26235

Received: (qmail 21799 invoked by uid 605); 10 Jul 2004 19:50:51 -0000
Message-Id: <20040710195043.AD20C11173@narn.netbsd.org>
Date: Sat, 10 Jul 2004 19:50:43 +0000 (UTC)
From: geos@epost.de
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: georg.schwarz@freenet.de
To: gnats-bugs@gnats.NetBSD.org
Subject: pkgsrc makes use of test -e (or [ -e), which does not work on some platforms
X-Send-Pr-Version: www-1.0

>Number:         26235
>Category:       pkg
>Synopsis:       pkgsrc makes use of test -e (or [ -e), which does not work on some platforms
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    schwarz
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 10 19:51:00 +0000 2004
>Closed-Date:    Tue Jan 01 21:54:23 +0000 2008
>Last-Modified:  Tue Jan 01 21:54:23 +0000 2008
>Originator:     Georg Schwarz
>Release:        current pkgsrc
>Organization:
>Environment:
IRIX lorenz 5.3 08031225 IP20 mips
>Description:
Pkgsrc makes use of TEST -e in various files. Some shells´ test on certain platforms does not understand -e. The following files are affected:

pkgsrc/mk/install/install
pkgsrc/mk/install/deinstall

as well as

pkgsrc/audio/rio/files/find-lpt-port
pkgsrc/comms/conserver/files/conserver.sh
pkgsrc/comms/minicom/scripts/create-dev-link
pkgsrc/emulators/*/INSTALL
pkgsrc/graphics/fxtv/Makefile
pkgsrc/net/ja-samba/INSTALL
pkgsrc/net/samba/INSTALL
pkgsrc/net/samba2/INSTALL
pkgsrc/pkgtools/pkg_install/files/view/linkfarm.sh.in
pkgsrc/www/opera6/files/opera.sh
pkgsrc/www/wwwoffle/INSTALL
pkgsrc/www/opera7/files/opera.sh
pkgsrc/textproc/nbsed/files/TEST/sed.test

furthermore, some of the following patchsets also contain TEST -e:

pkgsrc/audio/abcde
pkgsrc/audio/cdparanoia
pkgsrc/audio/kdemultimedia2
pkgsrc/ham/dpbox
pkgsrc/lang/sather
pkgsrc/misc/heyu
pkgsrc/misc/pdmenu
pkgsrc/misc/vfu
pkgsrc/sysutils/xentools12
pkgsrc/www/asp2php
pkgsrc/www/gtkasp2php
pkgsrc/www/ap-jserv

(some of them are most likely for NetBSD only, so it does not matter there)


Similarly, some pkgsrc scripts use -ef to check for hardlinks. This suffers from similar portability problems. (here however I unfortunately do not know how to overcome this)
>How-To-Repeat:

>Fix:
Replace -e by -f, -d, -b, or -c, as appropriate. -r or -s might also be an option.
The following two patches should do that for the mk files affected:

--- pkgsrc/mk/install/install.orig      2004-07-10 15:34:52.000000000 +0200
+++ pkgsrc/mk/install/install   2004-07-10 15:46:07.000000000 +0200
@@ -117,7 +117,7 @@
                                print;                                  \
                        }'                                              \
                `
-               if [ -d $sysconfdir -a ! -e ${PKG_SYSCONFDIR} ]; then
+               if [ -d $sysconfdir -a ! -d ${PKG_SYSCONFDIR} ]; then
                        ${MKDIR} -p `${DIRNAME} ${PKG_SYSCONFDIR}`
                        ${LN} -sf $sysconfdir ${PKG_SYSCONFDIR}
                fi
@@ -241,13 +241,13 @@
                                msgadd ""
                        fi
                        msgadd "#${file} (m=@CONF_FILES_MODE@)"
-               elif [ -e "${file}" ]; then
+               elif [ -f "${file}" ]; then
                        if [ ! "${file}" -ef "${samplefile}" ]; then
                                ${ECHO} "       ${file} already exists, example file is"
                                ${ECHO} "           ${samplefile}"
                        fi
                else
-                       if [ -e "${samplefile}" ]; then
+                       if [ -f "${samplefile}" ]; then
                                ${ECHO} "       ${file}"
                                ${CP} "${samplefile}" "${file}"
                                ${CHMOD} @CONF_FILES_MODE@ "${file}"
@@ -267,13 +267,13 @@
                                msgadd ""
                        fi
                        msgadd "#${file} (m=@SUPPORT_FILES_MODE@)"
-               elif [ -e "${file}" ]; then
+               elif [ -f "${file}" ]; then
                        if [ ! "${file}" -ef "${samplefile}" ]; then
                                ${ECHO} "       ${file} already exists, example file is"
                                ${ECHO} "           ${samplefile}"
                        fi
                else
-                       if [ -e "${samplefile}" ]; then
+                       if [ -f "${samplefile}" ]; then
                                ${ECHO} "       ${file}"
                                ${CP} "${samplefile}" "${file}"
                                ${CHMOD} @SUPPORT_FILES_MODE@ "${file}"
@@ -294,13 +294,13 @@
                                msgadd ""
                        fi
                        msgadd "#${file} (o=${owner}, g=${group}, m=${mode})"
-               elif [ -e ${file} ]; then
+               elif [ -f ${file} ]; then
                        if [ ! "${file}" -ef "${samplefile}" ]; then
                                ${ECHO} "       ${file} already exists, example file is"
                                ${ECHO} "           ${samplefile}"
                        fi
                else
-                       if [ -e "${samplefile}" ]; then
+                       if [ -f "${samplefile}" ]; then
                                ${ECHO} "       ${file}"
                                ${CP} "${samplefile}" "${file}"
                                ${CHOWN} "${owner}" "${file}"
@@ -323,13 +323,13 @@
                                msgadd ""
                        fi
                        msgadd "#${file} (m=@RCD_SCRIPTS_MODE@)"
-               elif [ -e "${file}" ]; then
+               elif [ -f "${file}" ]; then
                        if [ ! "${file}" -ef "${samplefile}" ]; then
                                ${ECHO} "       ${file} already exists, example file is"
                                ${ECHO} "           ${samplefile}"
                        fi
                else
-                       if [ -e "${samplefile}" ]; then
+                       if [ -f "${samplefile}" ]; then
                                ${ECHO} "       ${file}"
                                ${CP} "${samplefile}" "${file}"
                                ${CHMOD} @RCD_SCRIPTS_MODE@ "${file}"



--- pkgsrc/mk/install/deinstall.orig    2004-07-10 15:35:00.000000000 +0200
+++ pkgsrc/mk/install/deinstall 2004-07-10 15:46:55.000000000 +0200
@@ -111,7 +111,7 @@
                        shift; shift

                        if [ ! "${file}" -ef "${samplefile}" -a         \
-                            -e "${file}" -a -e "${samplefile}" ]; then
+                            -f "${file}" -a -f "${samplefile}" ]; then
                                if ${CMP} -s "${file}" "${samplefile}"; then
                                        ${RM} -f "${file}"
                                fi
@@ -127,7 +127,7 @@
                samplefile="$1"; file="$2"
                shift; shift

-               if [ -e "${file}" ]; then
+               if [ -f "${file}" ]; then
                        modified_files="${modified_files} \"${file}\""
                fi
        done


(sorry for the lost tabs; nevertheless the above changes should be easy to read)




>Release-Note:
>Audit-Trail:

From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/mk/install
Date: Sat, 10 Jul 2004 20:42:37 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 20:42:37 UTC 2004

 Modified Files:
 	pkgsrc/mk/install: deinstall install

 Log Message:
 Replace test -e with -d and -f respectively.
 Fixes part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.27 -r1.28 pkgsrc/mk/install/deinstall
 cvs rdiff -r1.30 -r1.31 pkgsrc/mk/install/install

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/comms/conserver
Date: Sat, 10 Jul 2004 22:35:32 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 22:35:32 UTC 2004

 Modified Files:
 	pkgsrc/comms/conserver: Makefile PLIST distinfo
 	pkgsrc/comms/conserver/files: conserver.sh
 	pkgsrc/comms/conserver/patches: patch-ab

 Log Message:
 PKGREVISION++

 - use CONSERVER_DEFAULTPORT and CONSERVER_DEFAULTHOST from
   bsd.pkg.defaults.mk, instead of using obscure local variables
 - obey VARBASE
 - whitespace and delint
 - example configuration files were never installed to PKG_SYSCONFDIR, make it
   happen now (hi jlam!)
 - replace test -e with -f in rc script, addresses part of PR pkg/26235


 To generate a diff of this commit:
 cvs rdiff -r1.12 -r1.13 pkgsrc/comms/conserver/Makefile
 cvs rdiff -r1.4 -r1.5 pkgsrc/comms/conserver/PLIST
 cvs rdiff -r1.3 -r1.4 pkgsrc/comms/conserver/distinfo
 cvs rdiff -r1.3 -r1.4 pkgsrc/comms/conserver/files/conserver.sh
 cvs rdiff -r1.2 -r1.3 pkgsrc/comms/conserver/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/comms/minicom/scripts
Date: Sat, 10 Jul 2004 22:41:39 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 22:41:39 UTC 2004

 Modified Files:
 	pkgsrc/comms/minicom/scripts: create-dev-link

 Log Message:
 Replace test -e with -h and -c respectively.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 pkgsrc/comms/minicom/scripts/create-dev-link

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/net/ja-samba
Date: Sat, 10 Jul 2004 23:13:01 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:13:01 UTC 2004

 Modified Files:
 	pkgsrc/net/ja-samba: INSTALL

 Log Message:
 Replace test -e with -d.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/net/ja-samba/INSTALL

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/net/samba2
Date: Sat, 10 Jul 2004 23:15:32 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:15:32 UTC 2004

 Modified Files:
 	pkgsrc/net/samba2: INSTALL

 Log Message:
 Replace test -e with -d.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/net/samba2/INSTALL

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/www/wwwoffle
Date: Sat, 10 Jul 2004 23:23:45 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:23:45 UTC 2004

 Modified Files:
 	pkgsrc/www/wwwoffle: INSTALL

 Log Message:
 Replace test -e with -f.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.4 -r1.5 pkgsrc/www/wwwoffle/INSTALL

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/www/opera7/files
Date: Sat, 10 Jul 2004 23:24:41 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:24:41 UTC 2004

 Modified Files:
 	pkgsrc/www/opera7/files: opera.sh

 Log Message:
 Replace test -e with -f.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/www/opera7/files/opera.sh

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/multimedia/kdemultimedia2
Date: Sat, 10 Jul 2004 23:34:39 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:34:39 UTC 2004

 Modified Files:
 	pkgsrc/multimedia/kdemultimedia2: distinfo
 	pkgsrc/multimedia/kdemultimedia2/patches: patch-aa

 Log Message:
 Replace test -e with -f.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/multimedia/kdemultimedia2/distinfo
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/multimedia/kdemultimedia2/patches/patch-aa

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/26235 CVS commit: pkgsrc/misc/heyu
Date: Sat, 10 Jul 2004 23:45:59 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	salo
 Date:		Sat Jul 10 23:45:59 UTC 2004

 Modified Files:
 	pkgsrc/misc/heyu: distinfo
 	pkgsrc/misc/heyu/patches: patch-ag

 Log Message:
 Replace test -e with -f and -h respectively.
 Addresses part of PR pkg/26235 by Georg Schwarz.


 To generate a diff of this commit:
 cvs rdiff -r1.6 -r1.7 pkgsrc/misc/heyu/distinfo
 cvs rdiff -r1.4 -r1.5 pkgsrc/misc/heyu/patches/patch-ag

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Lubomir Sedlacik <salo@Xtrmntr.org>
To: geos@epost.de
Cc: gnats-bugs@gnats.NetBSD.org
Subject: Re: pkg/26235: pkgsrc makes use of test -e (or [ -e), which does not work on some platforms
Date: Sun, 11 Jul 2004 02:37:39 +0200

 --RwGu8mu1E+uYXPWP
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On Sat, Jul 10, 2004 at 07:50:43PM +0000, geos@epost.de wrote:
 > pkgsrc/mk/install/install
 > pkgsrc/mk/install/deinstall

 fixed

 > pkgsrc/audio/rio/files/find-lpt-port

 NetBSD specific

 > pkgsrc/comms/conserver/files/conserver.sh

 fixed

 > pkgsrc/comms/minicom/scripts/create-dev-link

 fixed

 > pkgsrc/emulators/*/INSTALL

 NetBSD specific

 > pkgsrc/graphics/fxtv/Makefile

 fxtv is in multimedia and the only -e there are sed flags

 > pkgsrc/net/ja-samba/INSTALL

 fixed

 > pkgsrc/net/samba/INSTALL

 there is no such file for some time now

 > pkgsrc/net/samba2/INSTALL

 fixed

 > pkgsrc/pkgtools/pkg_install/files/view/linkfarm.sh.in

 i'll consult this with jlam, the fix is not that trivial, it seems.

 > pkgsrc/www/opera6/files/opera.sh

 the package was removed few months ago

 > pkgsrc/www/wwwoffle/INSTALL

 fixed

 > pkgsrc/www/opera7/files/opera.sh

 fixed

 > pkgsrc/textproc/nbsed/files/TEST/sed.test

 the tests are not run

 > furthermore, some of the following patchsets also contain TEST -e:
 >=20
 > pkgsrc/audio/abcde

 i would suggest you to file a PR against audio/abcde separately, it
 has _lots_ of test -e instances in itself

 > pkgsrc/audio/cdparanoia

 not a test argument

 > pkgsrc/audio/kdemultimedia2

 fixed, it has moved to multimedia meanwhite, though

 > pkgsrc/ham/dpbox

 it actually removes these lines

 > pkgsrc/lang/sather

 the same as above

 > pkgsrc/misc/heyu

 fixed

 > pkgsrc/misc/pdmenu

 the same as dpbox and sather

 > pkgsrc/misc/vfu

 in NetBSD specific file, i suppose this package will need more work
 to build on other platforms

 > pkgsrc/sysutils/xentools12

 only for i386

 > pkgsrc/www/asp2php

 i completely reworked the install target

 > pkgsrc/www/gtkasp2php

 synced with the above

 > pkgsrc/www/ap-jserv

 i don't have java and don't really want to go deeper into this package,
 please file a PR specific for www/ap-jserv after actually verifying you
 can go as far as install this package.. which i somehow doubt.


 regards,

 --=20
 -- Lubomir Sedlacik <salo@{NetBSD,Xtrmntr,silcnet}.org>   --

 --RwGu8mu1E+uYXPWP
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (NetBSD)

 iD8DBQFA8IvTiwjDDlS8cmMRAh7NAJ4v6z1twypPuB8njQfvRTdiebKlwACeKcnW
 zwv87qkHiaPSVdqKtXLjGRA=
 =M+R7
 -----END PGP SIGNATURE-----

 --RwGu8mu1E+uYXPWP--
State-Changed-From-To: open->feedback 
State-Changed-By: salo 
State-Changed-When: Sun Jul 11 00:38:14 UTC 2004 
State-Changed-Why:  
all reasonable looking packages fixed, some need more work and 
i suggest you to file PRs specific to the packages. 
ok to close? 


Responsible-Changed-From-To: pkg-manager->salo 
Responsible-Changed-By: salo 
Responsible-Changed-When: Sun Jul 11 00:38:14 UTC 2004 
Responsible-Changed-Why:  
i'll take care of this 

From: geos@epost.de (Georg Schwarz)
To: gnats-bugs@NetBSD.org
Cc:  
Subject: Re: pkg/26235
Date: Sat, 24 Jul 2004 12:11:46 +0200

 The problem seem still present in
 pkgsrc/pkgtools/pkg_install/files/view/linkfarm.sh.in

 -- 
 Georg Schwarz    http://home.pages.de/~schwarz/
  geos@epost.de     +49 177 8811442
State-Changed-From-To: feedback->open 
State-Changed-By: wiz 
State-Changed-When: Tue Jul 27 16:07:35 UTC 2004 
State-Changed-Why:  
Feedback supplied. 
Responsible-Changed-From-To: salo->schwarz
Responsible-Changed-By: salo@netbsd.org
Responsible-Changed-When: Thu, 20 Apr 2006 05:17:30 +0000
Responsible-Changed-Why:
over to Georg, he can now correct the remaining issues (if any)
himself.


State-Changed-From-To: open->feedback
State-Changed-By: joerg@netbsd.org
State-Changed-When: Thu, 28 Dec 2006 16:12:52 +0000
State-Changed-Why:
What is the state of this bug?


State-Changed-From-To: feedback->closed
State-Changed-By: rillig@netbsd.org
State-Changed-When: Tue, 01 Jan 2008 21:54:23 +0000
State-Changed-Why:
Feedback timeout.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.