Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/pkg_install Avoid hardcoding /usr/bin/ftp in the pk...



details:   https://anonhg.NetBSD.org/src/rev/bf5fe822e687
branches:  trunk
changeset: 533110:bf5fe822e687
user:      agc <agc%NetBSD.org@localhost>
date:      Fri Jun 21 14:49:40 2002 +0000

description:
Avoid hardcoding /usr/bin/ftp in the pkg_add binary.

Fixes provided by Stoned Elipot <seb%script.jussieu.fr@localhost> in PR 17323

diffstat:

 usr.sbin/pkg_install/Makefile.inc |   7 +++++--
 usr.sbin/pkg_install/lib/ftpio.c  |   6 +++---
 usr.sbin/pkg_install/lib/lib.h    |  12 +++++++++++-
 3 files changed, 19 insertions(+), 6 deletions(-)

diffs (74 lines):

diff -r 7a9ff54ba412 -r bf5fe822e687 usr.sbin/pkg_install/Makefile.inc
--- a/usr.sbin/pkg_install/Makefile.inc Fri Jun 21 14:38:36 2002 +0000
+++ b/usr.sbin/pkg_install/Makefile.inc Fri Jun 21 14:49:40 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.17 2002/06/10 09:14:26 yamt Exp $
+# $NetBSD: Makefile.inc,v 1.18 2002/06/21 14:49:40 agc Exp $
 # Original from FreeBSD, no rcs id.
 
 .include <bsd.own.mk>
@@ -22,11 +22,14 @@
 CHGRP?= /usr/bin/chgrp
 WARNS=2
 .elif ${OPSYS} == "SunOS"
-LOCALBASE?= /usr/local
+LOCALBASE?= /usr/pkg
 TAR_CMD?= tar
+FTP_CMD?= tar
 ZOULARISBASE?= ${LOCALBASE}/bsd
 TAR_FULLPATHNAME?= ${ZOULARISBASE}/bin/${TAR_CMD}
+FTP_FULLPATHNAME?= ${ZOULARISBASE}/bin/${FTP_CMD}
 CPPFLAGS+=-DTAR_CMD='"${TAR_CMD}"' -DTAR_FULLPATHNAME='"${TAR_FULLPATHNAME}"'
+CPPFLAGS+=-DFTP_CMD='"${FTP_CMD}"' -DFTP_FULLPATHNAME='"${FTP_FULLPATHNAME}"'
 BINDIR=${ZOULARISBASE}/bin
 CHMOD?= /usr/bin/chmod
 CHOWN?= /usr/bin/chown
diff -r 7a9ff54ba412 -r bf5fe822e687 usr.sbin/pkg_install/lib/ftpio.c
--- a/usr.sbin/pkg_install/lib/ftpio.c  Fri Jun 21 14:38:36 2002 +0000
+++ b/usr.sbin/pkg_install/lib/ftpio.c  Fri Jun 21 14:49:40 2002 +0000
@@ -1,8 +1,8 @@
-/*     $NetBSD: ftpio.c,v 1.37 2002/06/10 09:14:28 yamt Exp $  */
+/*     $NetBSD: ftpio.c,v 1.38 2002/06/21 14:49:41 agc Exp $   */
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.37 2002/06/10 09:14:28 yamt Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.38 2002/06/21 14:49:41 agc Exp $");
 #endif
 
 /*
@@ -297,7 +297,7 @@
            
            if (Verbose)
                    fprintf(stderr, "ftp -detv %s\n", base);
-           rc1 = execl("/usr/bin/ftp", "ftp", "-detv", base, NULL);
+           rc1 = execl(FTP_FULLPATHNAME, FTP_CMD, "-detv", base, NULL);
            warn("setupCoproc: execl() failed");
            exit(1);
            break;
diff -r 7a9ff54ba412 -r bf5fe822e687 usr.sbin/pkg_install/lib/lib.h
--- a/usr.sbin/pkg_install/lib/lib.h    Fri Jun 21 14:38:36 2002 +0000
+++ b/usr.sbin/pkg_install/lib/lib.h    Fri Jun 21 14:49:40 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.41 2002/06/10 09:14:28 yamt Exp $ */
+/* $NetBSD: lib.h,v 1.42 2002/06/21 14:49:41 agc Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -66,6 +66,16 @@
 #define TAR_FULLPATHNAME       "/usr/bin/tar"
 #endif
 
+/* Define ftp as a string, in case the ftp client is called something else */
+#ifndef FTP_CMD
+#define FTP_CMD "ftp"
+#endif
+
+/* Full path name of FTP_CMD */
+#ifndef FTP_FULLPATHNAME
+#define FTP_FULLPATHNAME       "/usr/bin/ftp"
+#endif
+
 /* Where we put logging information by default, else ${PKG_DBDIR} if set */
 #ifndef DEF_LOG_DIR
 #define DEF_LOG_DIR            "/var/db/pkg"



Home | Main Index | Thread Index | Old Index