Source-Changes-HG archive

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

[src/netbsd-1-5]: src/usr.sbin/pkg_install/lib Pull up revision 1.29 (request...



details:   https://anonhg.NetBSD.org/src/rev/5ca8a0acaf65
branches:  netbsd-1-5
changeset: 491491:5ca8a0acaf65
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 11:01:09 2001 +0000

description:
Pull up revision 1.29 (requested by hubertf):
  Fix pkg_add so that it works via ftp for >= dependencies.

diffstat:

 usr.sbin/pkg_install/lib/str.c |  25 +++++++++++++++++++++++--
 1 files changed, 23 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 3a31cd784b52 -r 5ca8a0acaf65 usr.sbin/pkg_install/lib/str.c
--- a/usr.sbin/pkg_install/lib/str.c    Tue May 01 10:56:33 2001 +0000
+++ b/usr.sbin/pkg_install/lib/str.c    Tue May 01 11:01:09 2001 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: str.c,v 1.23.2.2 2001/03/20 18:14:44 he Exp $  */
+/*     $NetBSD: str.c,v 1.23.2.3 2001/05/01 11:01:09 he Exp $  */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "Id: str.c,v 1.5 1997/10/08 07:48:21 charnier Exp";
 #else
-__RCSID("$NetBSD: str.c,v 1.23.2.2 2001/03/20 18:14:44 he Exp $");
+__RCSID("$NetBSD: str.c,v 1.23.2.3 2001/05/01 11:01:09 he Exp $");
 #endif
 #endif
 
@@ -511,3 +511,24 @@
        to[len] = 0;
        return to;
 }
+
+/*
+ * Strip off any .tgz, .tbz or .t[bg]z suffix from fname,
+ * and copy into buffer "buf"
+ */
+void
+strip_txz(char *buf, char *fname)
+{
+       char *s;
+
+       strcpy(buf, fname);
+       
+       s = strstr(buf, ".tgz");
+       if (s) { *s = '\0'; }           /* strip off any ".tgz" */
+       
+       s = strstr(buf, ".tbz");
+       if (s) { *s = '\0'; }           /* strip off any ".tbz" */
+       
+       s = strstr(buf, ".t[bg]z");
+       if (s) { *s = '\0'; }           /* strip off any ".t[bg]z" */
+}



Home | Main Index | Thread Index | Old Index