summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-04-30 10:30:51 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-04-30 10:30:51 +0000
commitb8fbfbbc7a40e0f644230728c273af43ea326bfd (patch)
tree981affee6424347d1e7cb4fa6593f5d6539fa844
parentc36cd4ba729f1d0b6b88ad5b6bbc94f7a57b62eb (diff)
allow pkg_create to regen on a dirname, supply +CONTENTS automatically
-rw-r--r--usr.sbin/pkg_add/pkg_create10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_create b/usr.sbin/pkg_add/pkg_create
index 0dc12bfdc0d..c4a788559dd 100644
--- a/usr.sbin/pkg_add/pkg_create
+++ b/usr.sbin/pkg_add/pkg_create
@@ -1,6 +1,6 @@
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: pkg_create,v 1.73 2007/04/30 10:26:43 espie Exp $
+# $OpenBSD: pkg_create,v 1.74 2007/04/30 10:30:50 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -470,7 +470,12 @@ if ($regen_package) {
if ($v != 1 or @contents != 1) {
Usage "Exactly one single packing list is required";
}
- $infodir = dirname($contents[0]);
+ if (-d $contents[0] && -f $contents[0].'/'.CONTENTS) {
+ $infodir = $contents[0];
+ $contents[0] .= '/'.CONTENTS;
+ } else {
+ $infodir = dirname($contents[0]);
+ }
} else {
print "Creating package $ARGV[0]\n" if !(defined $opt_q) && $opt_v;
$infodir = OpenBSD::Temp::dir() unless $opt_q;
@@ -557,7 +562,6 @@ for my $contentsfile (@contents) {
) or Fatal "Can't open packing list $contentsfile";
}
-
my $base = '/';
if (defined $opt_B) {
$base = $opt_B;