Source-Changes-HG archive

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

[src/PKGSRC]: src/external/bsd/pkg_install/dist Import pkg_install-20191008.



details:   https://anonhg.NetBSD.org/src/rev/5c9d460d1ebe
branches:  PKGSRC
changeset: 455306:5c9d460d1ebe
user:      joerg <joerg%NetBSD.org@localhost>
date:      Sun Oct 13 21:52:26 2019 +0000

description:
Import pkg_install-20191008.

Sync license list with pkgsrc. Add support for "pkg_admin digest".

diffstat:

 external/bsd/pkg_install/dist/admin/main.c      |  31 ++++++++++++++++++++++--
 external/bsd/pkg_install/dist/admin/pkg_admin.1 |  22 ++++++++++-------
 external/bsd/pkg_install/dist/create/util.c     |   4 +-
 external/bsd/pkg_install/dist/lib/license.c     |   3 +-
 external/bsd/pkg_install/dist/lib/version.h     |   4 +-
 5 files changed, 47 insertions(+), 17 deletions(-)

diffs (183 lines):

diff -r 04c8ed974c85 -r 5c9d460d1ebe external/bsd/pkg_install/dist/admin/main.c
--- a/external/bsd/pkg_install/dist/admin/main.c        Fri Apr 05 23:41:57 2019 +0000
+++ b/external/bsd/pkg_install/dist/admin/main.c        Sun Oct 13 21:52:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1.1.17 2018/03/27 23:08:43 joerg Exp $      */
+/*     $NetBSD: main.c,v 1.1.1.18 2019/10/13 21:52:26 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,10 +7,10 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.1.1.17 2018/03/27 23:08:43 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.18 2019/10/13 21:52:26 joerg Exp $");
 
 /*-
- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -59,8 +59,10 @@
 #endif
 #ifndef NETBSD
 #include <nbcompat/md5.h>
+#include <nbcompat/sha2.h>
 #else
 #include <md5.h>
+#include <sha2.h>
 #endif
 #if HAVE_LIMITS_H
 #include <limits.h>
@@ -93,6 +95,7 @@
 int    quiet, verbose;
 
 static void set_unset_variable(char **, Boolean);
+static void digest_input(char **);
 
 /* print usage message and exit */
 void 
@@ -521,6 +524,9 @@
        } else if (strcasecmp(argv[0], "unset") == 0) {
                argv++;         /* "unset" */
                set_unset_variable(argv, TRUE);
+       } else if (strcasecmp(argv[0], "digest") == 0) {
+               argv++;         /* "digest" */
+               digest_input(argv);
        } else if (strcasecmp(argv[0], "config-var") == 0) {
                argv++;
                if (argv == NULL || argv[1] != NULL)
@@ -736,3 +742,22 @@
 
        return;
 }
+
+static void
+digest_input(char **argv)
+{
+       char digest[SHA256_DIGEST_STRING_LENGTH];
+       int failures = 0;
+
+       while (*argv != NULL) {
+               if (SHA256_File(*argv, digest)) {
+                       puts(digest);
+               } else {
+                       warn("cannot process %s", *argv);
+                       ++failures;
+               }
+               argv++;
+       }
+       if (failures)
+               exit(EXIT_FAILURE);
+}
diff -r 04c8ed974c85 -r 5c9d460d1ebe external/bsd/pkg_install/dist/admin/pkg_admin.1
--- a/external/bsd/pkg_install/dist/admin/pkg_admin.1   Fri Apr 05 23:41:57 2019 +0000
+++ b/external/bsd/pkg_install/dist/admin/pkg_admin.1   Sun Oct 13 21:52:26 2019 +0000
@@ -1,10 +1,11 @@
-.\"    $NetBSD: pkg_admin.1,v 1.1.1.15 2019/04/05 23:41:57 sevan Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.1.1.16 2019/10/13 21:52:26 joerg Exp $
 .\"
-.\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
+.\" Copyright (c) 1999-2019 The NetBSD Foundation, Inc.
 .\" All rights reserved.
 .\"
 .\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Hubert Feyrer <hubert%feyrer.de@localhost>.
+.\" by Hubert Feyrer <hubert%feyrer.de@localhost> and
+.\" by Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -27,7 +28,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd February 25, 2018
+.Dd October 8, 2019
 .Dt PKG_ADMIN 1
 .Os
 .Sh NAME
@@ -182,6 +183,9 @@
 Print the current value of
 .Ar variable
 as used after parsing the configuration file.
+.It Cm digest Ar file ...
+Compute a SHA256 message digest of
+.Ar file .
 .It Cm dump
 Dump the contents of the package database, similar to
 .Cm pkg_info -F .
@@ -204,6 +208,11 @@
 Print the URL of the best matching package to stdout for each pattern.
 If a pattern is not matched, it is skipped and the command will return
 a failure.
+.It Cm gpg-sign-package pkg spkg
+Sign the binary package
+.Ar pkg
+using GPG and write the result to
+.Ar spkg .
 .It Cm lsall Ar /dir/pkgpattern
 .It Cm lsbest Ar /dir/pkgpattern
 List all/best package matching pattern in the given directory
@@ -268,11 +277,6 @@
 Packages that are not installed directly by the user but pulled in as
 dependencies are marked by setting
 .Dq automatic=YES .
-.It Cm gpg-sign-package pkg spkg
-Sign the binary package
-.Ar pkg
-using GPG and write the result to
-.Ar spkg .
 .It Cm x509-sign-package pkg spkg key cert
 Sign the binary package
 .Ar pkg
diff -r 04c8ed974c85 -r 5c9d460d1ebe external/bsd/pkg_install/dist/create/util.c
--- a/external/bsd/pkg_install/dist/create/util.c       Fri Apr 05 23:41:57 2019 +0000
+++ b/external/bsd/pkg_install/dist/create/util.c       Sun Oct 13 21:52:26 2019 +0000
@@ -147,8 +147,8 @@
 free_memory_file(struct memory_file *file)
 {
        if (file != NULL) {
-               free((char *)file->owner);
-               free((char *)file->group);
+               free(__UNCONST(file->owner));
+               free(__UNCONST(file->group));
                free(file->data);
                free(file);
        }
diff -r 04c8ed974c85 -r 5c9d460d1ebe external/bsd/pkg_install/dist/lib/license.c
--- a/external/bsd/pkg_install/dist/lib/license.c       Fri Apr 05 23:41:57 2019 +0000
+++ b/external/bsd/pkg_install/dist/lib/license.c       Sun Oct 13 21:52:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: license.c,v 1.1.1.16 2019/04/05 23:42:00 sevan Exp $   */
+/*     $NetBSD: license.c,v 1.1.1.17 2019/10/13 21:52:26 joerg Exp $   */
 
 /*-
  * Copyright (c) 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -56,6 +56,7 @@
     "cc0-1.0-universal "
     "cddl-1.0 "
     "cecill-2.1 "
+    "cecill-b-v1 "
     "cpl-1.0 "
     "epl-v1.0 "
     "eupl-v1.1 "
diff -r 04c8ed974c85 -r 5c9d460d1ebe external/bsd/pkg_install/dist/lib/version.h
--- a/external/bsd/pkg_install/dist/lib/version.h       Fri Apr 05 23:41:57 2019 +0000
+++ b/external/bsd/pkg_install/dist/lib/version.h       Sun Oct 13 21:52:26 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.1.1.37 2019/04/05 23:42:02 sevan Exp $   */
+/*     $NetBSD: version.h,v 1.1.1.38 2019/10/13 21:52:26 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 20190405
+#define PKGTOOLS_VERSION 20191008
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index