summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/create
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-05-05 21:03:25 +0000
committersobomax <sobomax@FreeBSD.org>2002-05-05 21:03:25 +0000
commit842eb4b30ab12533f948111da9947ebc3af975a3 (patch)
tree7c9f1e55ee95af60dec0886ffed805ea8d577125 /usr.sbin/pkg_install/create
parentc1ae331211aba15b32979855d8c599ba5e6ae4f3 (diff)
downloadFreeBSD-src-842eb4b30ab12533f948111da9947ebc3af975a3.zip
FreeBSD-src-842eb4b30ab12533f948111da9947ebc3af975a3.tar.gz
New feature: allow origins of all dependencies be recorded into package list
using new `@comment DEPORIGIN:...' directive. This would allow us to make many neat things including: - easier binary upgrades; - source upgrades without using external tools by simply extending bsd.port.mk and pkg_install tools; - mixed-mode upgrades (source + binary); - depreciate and deorbit silly +REQUIRED_BY files in the near future. This feature is no-op until appropriate bsd.port.mk patch is committed, and even when it is already committed packages generated will remain 100% compatible with old set of pkg_install tools (module all those neat features, of course). MFC after: 6 days
Diffstat (limited to 'usr.sbin/pkg_install/create')
-rw-r--r--usr.sbin/pkg_install/create/perform.c7
-rw-r--r--usr.sbin/pkg_install/create/pkg_create.112
2 files changed, 18 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/create/perform.c b/usr.sbin/pkg_install/create/perform.c
index 2c0b0ef..d27840e 100644
--- a/usr.sbin/pkg_install/create/perform.c
+++ b/usr.sbin/pkg_install/create/perform.c
@@ -101,7 +101,7 @@ pkg_perform(char **pkgs)
/* Stick the dependencies, if any, at the top */
if (Pkgdeps) {
- char **deps;
+ char **deps, *deporigin;
int i;
int ndeps = 0;
@@ -133,6 +133,11 @@ pkg_perform(char **pkgs)
sortdeps(deps);
for (i = 0; i < ndeps; i++) {
+ deporigin = strchr(deps[i], ':');
+ if (deporigin != NULL) {
+ *deporigin = '\0';
+ add_plist_top(&plist, PLIST_DEPORIGIN, ++deporigin);
+ }
add_plist_top(&plist, PLIST_PKGDEP, deps[i]);
if (Verbose && !PlistOnly)
printf(" %s", deps[i]);
diff --git a/usr.sbin/pkg_install/create/pkg_create.1 b/usr.sbin/pkg_install/create/pkg_create.1
index 15be28e..e556880 100644
--- a/usr.sbin/pkg_install/create/pkg_create.1
+++ b/usr.sbin/pkg_install/create/pkg_create.1
@@ -149,6 +149,18 @@ This is assumed to be a whitespace separated list of package names
and is meant as a convenient shorthand for specifying multiple
.Cm @pkgdep
directives in the packing list (see PACKING LIST DETAILS section below).
+Each argiment from the
+.Ar pkgs
+list could be in the form
+.Ar pkgname Ns Op Ar :pkgorigin ,
+where optional
+.Ar pkgorigin
+element denotes origin of each dependency from the list and it is
+recorded into the packing list along with the
+.Ar pkgname
+using
+.Cm @comment
+directive.
.It Fl p Ar prefix
Set
.Ar prefix
OpenPOWER on IntegriCloud