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/lib pass -j to tar to read bzip2 binary...



details:   https://anonhg.NetBSD.org/src/rev/465aa938c5eb
branches:  trunk
changeset: 545520:465aa938c5eb
user:      grant <grant%NetBSD.org@localhost>
date:      Thu Apr 10 05:08:55 2003 +0000

description:
pass -j to tar to read bzip2 binary pkgs.

bump PKGTOOLS_VERSION to 20030410.

diffstat:

 usr.sbin/pkg_install/lib/file.c    |  21 ++++++++-------------
 usr.sbin/pkg_install/lib/version.h |   4 ++--
 2 files changed, 10 insertions(+), 15 deletions(-)

diffs (60 lines):

diff -r 4d0066343cf6 -r 465aa938c5eb usr.sbin/pkg_install/lib/file.c
--- a/usr.sbin/pkg_install/lib/file.c   Thu Apr 10 04:40:38 2003 +0000
+++ b/usr.sbin/pkg_install/lib/file.c   Thu Apr 10 05:08:55 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: file.c,v 1.58 2003/02/02 12:59:54 abs Exp $    */
+/*     $NetBSD: file.c,v 1.59 2003/04/10 05:08:55 grant Exp $  */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
 #else
-__RCSID("$NetBSD: file.c,v 1.58 2003/02/02 12:59:54 abs Exp $");
+__RCSID("$NetBSD: file.c,v 1.59 2003/04/10 05:08:55 grant Exp $");
 #endif
 #endif
 
@@ -526,19 +526,14 @@
 unpack(const char *pkg, const char *flist)
 {
        char    args[10] = "-";
-       char   *cp;
+       const char *suffix;
 
-       /*
-         * Figure out by a crude heuristic whether this or not this is probably
-         * compressed.
-         */
        if (!IS_STDIN(pkg)) {
-               cp = strrchr(pkg, '.');
-               if (cp) {
-                       cp++;
-                       if (strchr(cp, 'z') || strchr(cp, 'Z'))
-                               strcat(args, "z");
-               }
+               suffix = suffix_of(pkg);
+               if (!strcmp(suffix, "tbz"))
+                       strcat(args, "j");
+               else if (!strcmp(suffix, "tgz"))
+                       strcat(args, "z");
        } else
                strcat(args, "z");
        strcat(args, "xpf");
diff -r 4d0066343cf6 -r 465aa938c5eb usr.sbin/pkg_install/lib/version.h
--- a/usr.sbin/pkg_install/lib/version.h        Thu Apr 10 04:40:38 2003 +0000
+++ b/usr.sbin/pkg_install/lib/version.h        Thu Apr 10 05:08:55 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.23 2003/03/24 23:33:44 hubertf Exp $     */
+/*     $NetBSD: version.h,v 1.24 2003/04/10 05:08:55 grant Exp $       */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -33,6 +33,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20030325"
+#define PKGTOOLS_VERSION "20030410"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index