# ex:ts=8 sw=4:
-# $OpenBSD: AddDelete.pm,v 1.81 2018/07/09 14:51:15 espie Exp $
+# $OpenBSD: AddDelete.pm,v 1.82 2018/07/10 10:37:59 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
if (defined $ENV{PKG_CHECKSUM}) {
$state->{subst}->add('checksum', 1);
}
+ my $base = $state->opt('B') // '';
+ if ($base ne '') {
+ $base.='/' unless $base =~ m/\/$/o;
+ }
+ $state->{destdir} = $base;
}
sub init
#! /usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgAdd.pm,v 1.103 2018/06/24 19:59:35 espie Exp $
+# $OpenBSD: PkgAdd.pm,v 1.104 2018/07/10 10:37:59 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
$state->usage("bad option: -P #1", $state->opt('P'));
}
}
- if (defined $state->opt('B')) {
- $state->{destdir} = $state->opt('B');
- }
- if (defined $state->{destdir}) {
- $state->{destdir}.='/';
- } else {
- $state->{destdir} = '';
- }
-
-
$state->{hard_replace} = $state->opt('r');
$state->{newupdates} = $state->opt('u') || $state->opt('U');
$state->{allow_replacing} = $state->{hard_replace} ||
#!/usr/bin/perl
# ex:ts=8 sw=4:
-# $OpenBSD: PkgDelete.pm,v 1.44 2018/07/10 10:18:34 espie Exp $
+# $OpenBSD: PkgDelete.pm,v 1.45 2018/07/10 10:37:59 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
$state->SUPER::handle_options('X',
'[-acimnqsVvXx] [-B pkg-destdir] [-D name[=value]] [pkg-name ...]');
- my $base = $state->opt('B') // '';
- if ($base ne '') {
- $base.='/' unless $base =~ m/\/$/o;
- }
- $state->{destdir} = $base;
$state->{exclude} = $state->opt('X');
}