Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Merge branch 'master' of github.com:freebsd/pkg
Matthew Seaman committed 11 years ago
commit 2573d8b1f99387664b47f53d62a32d9bbebe2788
parent 6a258e3
8 files changed +36 -147
modified AUTHORS
@@ -22,3 +22,4 @@ Vsevolod Stakhov <vsevolod@FreeBSD.org>
Alexandre Perrin <alex@kaworu.ch>
Google Inc.
Landon Fuller <landon@landonf.org>
+
Andrej Zverev <az@FreeBSD.org>
modified COPYING
@@ -1,6 +1,6 @@
See the AUTHORS file to get the list of authors

-
Copyright (c) 2010-2014 <author(s)>
+
Copyright (c) 2010-2015 <author(s)>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modified README.md
@@ -29,7 +29,10 @@ Table of Contents:
* [Creating a package repository](#pkgcreate)
* [Additional resources](#resources)

+
OSX:
[<img src="https://travis-ci.org/freebsd/pkg.svg" />](https://travis-ci.org/freebsd/pkg)
+

+
FreeBSD:
[![Build Status](http://jenkins.mouf.net/view/auto/job/pkg/badge/icon)](http://jenkins.mouf.net/view/auto/job/pkg/)
<a name="libpkg"></a>
### libpkg
@@ -56,7 +59,6 @@ pkg uses several files for metadata:

* +COMPACT\_MANIFEST
* +MANIFEST
-
* +MTREE\_DIRS (optional)

##### COMPACT\_MANIFEST

@@ -66,7 +68,7 @@ It contains the information used to build the repository catalogue.

##### MANIFEST

-
The manifest is in [YAML](http://yaml.org) format, it contains all the
+
The manifest is in [UCL](https://github.com/vstakhov/libucl) format, it contains all the
information about the package:

	name: foo
@@ -96,7 +98,7 @@ information about the package:
	}
	files: {
	  /usr/local/bin/foo: 'sha256sum',
-
	  /usr/local/bin/i_am_a_link: '-';
+
	  /usr/local/bin/i_am_a_link: 'sha256sum';
	  /usr/local/share/foo-1.0/foo.txt: 'sha256sum;
	}
	directories: {
@@ -132,12 +134,14 @@ The shebang is not required.
When the manifest is read by pkg\_create files and dirs can use an
alternate format:

-
	files:
-
	  /usr/local/bin/foo, 'sha256sum'
+
	files: {
+
	  /usr/local/bin/foo: 'sha256sum',
	  /usr/local/bin/bar: {sum: 'sha256sum', uname: baruser, gname: foogroup, perm: 0644 }
-
	dirs:
-
	- /usr/local/share/foo-1.0
-
	- /path/to/directory: {uname: foouser, gname: foogroup, perm: 0755}
+
	}
+
	directories: {
+
	  /usr/local/share/foo-1.0: 'y',
+
	  /path/to/directory: {uname: foouser, gname: foogroup, perm: 0755}
+
	}


This allows overriding the users, groups and mode of files and
@@ -145,17 +149,6 @@ directories during package creation.
So, for example, this allows to creation of a package containing
root-owned files without being packaged by the root user.

-
##### MTREE\_DIRS
-

-
This is optional.  It is used by the package the same way as done by
-
the legacy tools. The MTREE is extracted in prefix before each
-
installation.
-

-
In the future we hope that mtree will be deprecated in favour of a
-
hier package or a single MTREE that won't be customisable in per
-
package basis. Since pkg supports packing of empty directories, per
-
package MTREE is superfluous.
-

<a name="localdb"></a>
### Local database

modified dev_version.m4
@@ -1 +1 @@
-
4
+
6
modified docs/pkg-updating.8
@@ -15,7 +15,7 @@
.\"     @(#)pkg.8
.\" $FreeBSD$
.\"
-
.Dd October 30, 2014
+
.Dd January 17, 2015
.Dt PKG-UPDATING 8
.Os
.Sh NAME
@@ -23,11 +23,13 @@
.Nd display UPDATING entries of software packages
.Sh SYNOPSIS
.Nm
+
.Op Fl i
.Op Fl d Ar date
.Op Fl f Ar file
.Op Ar pkg-name ...
.Pp
.Nm
+
.Op Cm --case-insensitive
.Op Cm --date Ar date
.Op Cm --file Ar file
.Op Ar pkg-name ...
@@ -43,6 +45,8 @@ The following options are supported by
.Bl -tag -width file
.It Ar pkg-name ...
UPDATING entries for the named packages are displayed.
+
.It Fl i, Cm --case-insensitive
+
Matching against pkg-name case insensitive.
.It Fl d Ar date , Cm --date Ar date
Only entries newer than
.Ar date
modified libpkg/pkg_add.c
@@ -176,11 +176,11 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
		);
		strlcpy(rpath, pathname, sizeof(rpath));

+
		aest = archive_entry_stat(ae);
		if (lstat(rpath, &st) != -1) {
			/*
			 * We have an existing file on the path, so handle it
			 */
-
			aest = archive_entry_stat(ae);
			if (!S_ISDIR(aest->st_mode)) {
				pkg_debug(2, "Old version found, renaming");
				pkg_add_file_random_suffix(rpath, sizeof(rpath), 12);
deleted newvers.sh
@@ -1,120 +0,0 @@
-
#!/bin/sh -
-
# Copyright (c) 2012 Matthew Seaman <matthew@freebsd.org>
-
# All rights reserved.
-
# 
-
# Redistribution and use in source and binary forms, with or without
-
# modification, are permitted provided that the following conditions
-
# are met:
-
# 1. Redistributions of source code must retain the above copyright
-
#    notice, this list of conditions and the following disclaimer
-
#    in this position and unchanged.
-
# 2. Redistributions in binary form must reproduce the above copyright
-
#    notice, this list of conditions and the following disclaimer in the
-
#    documentation and/or other materials provided with the distribution.
-
# 
-
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
-
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-
# IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
-
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-

-
# This file contains the authoritative version number for the last
-
# release from this branch, and for the corresponding port..  The
-
# version number is edited into ../Doxyfile and pkg.h.
-

-
# ------------------------------------------------------------------
-

-
# The version of the pkgng software itself. See
-
# http://wiki.freebsd.org/pkgng/CharterAndRoadMap#Code_Releases for
-
# details.  Setting PKG_PATCH_LEVEL to 0 is special
-
#
-
# For testing purposes you can override these by setting any of the
-
# variables or PKGVERSION or PORTVERSION in the environment, but this
-
# should not be done routinely:
-

-
: ${PKG_MAJOR_VERSION:="1"}
-
: ${PKG_MINOR_VERSION="3"}
-
: ${PKG_PATCH_LEVEL="0"}
-

-
: ${PORTREVISION:=}
-
: ${PORTEPOCH:=}
-

-
# ------------------------------------------------------------------
-

-
# Define this to a true value in the environment if creating a
-
# snapshot
-
: ${CREATE_SNAPSHOT:="NO"}
-

-
case $PKG_PATCH_LEVEL in
-
    ''|0)
-
	case $CREATE_SNAPSHOT in
-
	    [yY][eE][sS])
-
		_patch=".0"
-
		;;
-
	    *)
-
		_patch=
-
		;;
-
	esac
-
	;;
-
    *)
-
	_patch=".${PKG_PATCH_LEVEL}"
-
	;;
-
esac
-

-
case $CREATE_SNAPSHOT in
-
    [yY][eE][sS])
-
	_snapshot=".$( date +%Y%m%d )"
-
	;;
-
    *)
-
	_snapshot=
-
	;;
-
esac
-

-
case $PORTREVISION in
-
     ''|0)
-
	 _portrevision=
-
	 ;;
-
     *)
-
	 _portrevision="_${PORTREVISION}"
-
	 ;;
-
esac
-

-
case $PORTEPOCH in
-
    ''|0)
-
	_portepoch=
-
	;;
-
    *)
-
	_portepoch=";${PORTEPOCH}"
-
	;;
-
esac
-

-
_pkgversion=${PKG_MAJOR_VERSION}.${PKG_MINOR_VERSION}${_patch}${_snapshot}
-
_portversion=${_pkgversion}${_portrevision}${_portepoch}
-

-
: ${PKGVERSION:=${_pkgversion}}
-
: ${PORTVERSION:=${_portversion}}
-

-

-
# Printout the result according to command line args
-
case $1 in
-
    pkg)
-
	echo $PKGVERSION
-
	;;
-
    port)
-
	echo $PORTVERSION
-
	;;
-
    *)
-
        # Print the results in a form suitable for eval by /bin/sh
-
	echo "PKGVERSION=\"$PKGVERSION\""
-
	echo "PORTVERSION=\"$PORTVERSION\""
-
	;;
-
esac
-

-
#
-
# That's All Folks!
-
#
modified src/updating.c
@@ -55,7 +55,7 @@ struct installed_ports {
void
usage_updating(void)
{
-
	fprintf(stderr, "Usage: pkg updating [-d YYYYMMDD] [-f file] [portname ...]\n");
+
	fprintf(stderr, "Usage: pkg updating [-i] [-d YYYYMMDD] [-f file] [portname ...]\n");
	fprintf(stderr, "For more information see 'pkg help updating'.\n");

}
@@ -66,6 +66,7 @@ exec_updating(int argc, char **argv)
	char			*date = NULL;
	char			*dateline = NULL;
	char			*updatingfile = NULL;
+
	bool			caseinsensitive = false;
	struct installed_ports	*port;
	SLIST_HEAD(,installed_ports) origins;
	int			 ch;
@@ -87,10 +88,11 @@ exec_updating(int argc, char **argv)
	struct option longopts[] = {
		{ "date",	required_argument,	NULL,	'd' },
		{ "file",	required_argument,	NULL,	'f' },
+
		{ "case-insensitive",	no_argument,	NULL,	'i' },
		{ NULL,		0,			NULL,	0   },
	};

-
	while ((ch = getopt_long(argc, argv, "+d:f:", longopts, NULL)) != -1) {
+
	while ((ch = getopt_long(argc, argv, "+d:f:i", longopts, NULL)) != -1) {
		switch (ch) {
		case 'd':
			date = optarg;
@@ -98,6 +100,9 @@ exec_updating(int argc, char **argv)
		case 'f':
			updatingfile = optarg;
			break;
+
		case 'i':
+
			caseinsensitive = true;
+
			break;
		default:
			usage_updating();
			return (EX_USAGE);
@@ -182,8 +187,14 @@ exec_updating(int argc, char **argv)
		if (found == 0) {
			if (strstr(line, "AFFECTS") != NULL) {
				SLIST_FOREACH(port, &origins, next) {
-
					if ((tmp = strstr(line, port->origin)) != NULL) {
-
						break;
+
					if (caseinsensitive) {
+
						if ((tmp = strcasestr(line, port->origin)) != NULL) {
+
							break;
+
						}
+
					} else {
+
						if ((tmp = strstr(line, port->origin)) != NULL) {
+
							break;
+
						}
					}
				}
				if (tmp != NULL) {