pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files pkg_install-20090513:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/276a257b5fa2
branches:  trunk
changeset: 558724:276a257b5fa2
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed May 13 03:33:50 2009 +0000

description:
pkg_install-20090513:
Add pkg_create -F, which explicitly provides the compression type.

diffstat:

 pkgtools/pkg_install/files/create/build.c      |  24 +++++++++++++++++++-----
 pkgtools/pkg_install/files/create/create.h     |   3 ++-
 pkgtools/pkg_install/files/create/main.c       |  14 ++++++++++----
 pkgtools/pkg_install/files/create/pkg_create.1 |  14 ++++++++++++--
 pkgtools/pkg_install/files/lib/version.h       |   4 ++--
 5 files changed, 45 insertions(+), 14 deletions(-)

diffs (180 lines):

diff -r 997bbf56fa41 -r 276a257b5fa2 pkgtools/pkg_install/files/create/build.c
--- a/pkgtools/pkg_install/files/create/build.c Wed May 13 03:18:05 2009 +0000
+++ b/pkgtools/pkg_install/files/create/build.c Wed May 13 03:33:50 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: build.c,v 1.11 2009/03/08 17:26:23 joerg Exp $ */
+/*     $NetBSD: build.c,v 1.12 2009/05/13 03:33:50 joerg Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: build.c,v 1.11 2009/03/08 17:26:23 joerg Exp $");
+__RCSID("$NetBSD: build.c,v 1.12 2009/05/13 03:33:50 joerg Exp $");
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -239,12 +239,26 @@
        archive_entry_linkresolver_set_strategy(resolver,
            archive_format(archive));
 
-       if (strcmp(suffix, "tbz") == 0 || strcmp(suffix, "tar.bz2") == 0)
+       if (CompressionType == NULL) {
+               if (strcmp(suffix, "tbz") == 0 ||
+                   strcmp(suffix, "tar.bz2") == 0)
+                       CompressionType = "bzip2";
+               else if (strcmp(suffix, "tgz") == 0 ||
+                   strcmp(suffix, "tar.gz") == 0)
+                       CompressionType = "gzip";
+               else
+                       CompressionType = "none";
+       }
+
+       if (strcmp(CompressionType, "bzip2") == 0)
                archive_write_set_compression_bzip2(archive);
-       else if (strcmp(suffix, "tgz") == 0 || strcmp(suffix, "tar.gz") == 0)
+       else if (strcmp(CompressionType, "gzip") == 0)
                archive_write_set_compression_gzip(archive);
+       else if (strcmp(CompressionType, "none") == 0)
+               archive_write_set_compression_none(archive);
        else
-               archive_write_set_compression_none(archive);
+               errx(1, "Unspported compression type for -F: %s",
+                   CompressionType);
 
        archive_name = xasprintf("%s.%s", pkg, suffix);
 
diff -r 997bbf56fa41 -r 276a257b5fa2 pkgtools/pkg_install/files/create/create.h
--- a/pkgtools/pkg_install/files/create/create.h        Wed May 13 03:18:05 2009 +0000
+++ b/pkgtools/pkg_install/files/create/create.h        Wed May 13 03:33:50 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: create.h,v 1.11 2009/05/13 03:18:05 joerg Exp $ */
+/* $NetBSD: create.h,v 1.12 2009/05/13 03:33:50 joerg Exp $ */
 
 /* from FreeBSD Id: create.h,v 1.13 1997/10/08 07:46:19 charnier Exp */
 
@@ -55,6 +55,7 @@
 extern char *realprefix;
 extern char *DefaultOwner;
 extern char *DefaultGroup;
+extern char *CompressionType;
 extern int PlistOnly;
 extern int RelativeLinks;
 extern int update_pkgdb;
diff -r 997bbf56fa41 -r 276a257b5fa2 pkgtools/pkg_install/files/create/main.c
--- a/pkgtools/pkg_install/files/create/main.c  Wed May 13 03:18:05 2009 +0000
+++ b/pkgtools/pkg_install/files/create/main.c  Wed May 13 03:33:50 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.14 2009/05/13 03:18:05 joerg Exp $  */
+/*     $NetBSD: main.c,v 1.15 2009/05/13 03:33:50 joerg Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.14 2009/05/13 03:18:05 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.15 2009/05/13 03:33:50 joerg Exp $");
 
 /*
  * FreeBSD install - a package for the installation and maintainance
@@ -26,7 +26,7 @@
 #include "lib.h"
 #include "create.h"
 
-static const char Options[] = "B:C:D:EFI:K:L:OP:S:T:UVb:c:d:f:g:i:k:ln:p:r:s:u:v";
+static const char Options[] = "B:C:D:EF:I:K:L:OP:S:T:UVb:c:d:f:g:i:k:ln:p:r:s:u:v";
 
 char   *Prefix = NULL;
 char   *Comment = NULL;
@@ -47,6 +47,7 @@
 char   *DefaultOwner = NULL;
 char   *DefaultGroup = NULL;
 char   *realprefix = NULL;
+char   *CompressionType = NULL;
 int    update_pkgdb = 1;
 int    create_views = 0;
 int     PlistOnly = 0;
@@ -58,7 +59,8 @@
 {
        fprintf(stderr,
            "usage: pkg_create [-ElOUVv] [-B build-info-file] [-b build-version-file]\n"
-            "                  [-C cpkgs] [-D displayfile] [-I realprefix] [-i iscript]\n"
+            "                  [-C cpkgs] [-D displayfile] [-F compression] \n"
+           "                  [-I realprefix] [-i iscript]\n"
             "                  [-K pkg_dbdir] [-k dscript] [-L SrcDir]\n"
             "                  [-n preserve-file] [-P dpkgs] [-p prefix] [-r rscript]\n"
             "                  [-S size-all-file] [-s size-pkg-file]\n"
@@ -89,6 +91,10 @@
                        create_views = 1;
                        break;
 
+               case 'F':
+                       CompressionType = optarg;
+                       break;
+
                case 'I':
                        realprefix = optarg;
                        break;
diff -r 997bbf56fa41 -r 276a257b5fa2 pkgtools/pkg_install/files/create/pkg_create.1
--- a/pkgtools/pkg_install/files/create/pkg_create.1    Wed May 13 03:18:05 2009 +0000
+++ b/pkgtools/pkg_install/files/create/pkg_create.1    Wed May 13 03:33:50 2009 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_create.1,v 1.19 2009/04/24 14:00:25 joerg Exp $
+.\" $NetBSD: pkg_create.1,v 1.20 2009/05/13 03:33:50 joerg Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -24,7 +24,7 @@
 .\" [jkh] Took John's changes back and made some additional extensions for
 .\" better integration with FreeBSD's new ports collection.
 .\"
-.Dd April 24, 2009
+.Dd May 13, 2009
 .Dt PKG_CREATE 1
 .Os
 .Sh NAME
@@ -46,6 +46,9 @@
 .Op Fl D Ar displayfile
 .Ek
 .Bk -words
+.Op Fl F Ar compression
+.Ek
+.Bk -words
 .Op Fl g Ar group
 .Ek
 .Bk -words
@@ -160,6 +163,13 @@
 the argument itself.
 .It Fl E
 Add an empty views file to the package.
+.It Fl F Ar compression
+Use
+.Ar compression
+as compression algorithm.
+This overrides the heuristic to guess the compression type from the
+output name.
+Currently supported values are bzip2, gzip and none.
 .It Fl f Ar packlist
 Fetch
 .Pq packing list
diff -r 997bbf56fa41 -r 276a257b5fa2 pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Wed May 13 03:18:05 2009 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Wed May 13 03:33:50 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.126 2009/05/02 16:14:37 reed Exp $       */
+/*     $NetBSD: version.h,v 1.127 2009/05/13 03:33:50 joerg Exp $      */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION "20090502"
+#define PKGTOOLS_VERSION "20090513"
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index