summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-06-14 09:29:33 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-06-14 09:29:33 +0000
commitd885abbcc7cc8875af669798ca0d6c6f6a0d1c90 (patch)
treecc64cf1d281eb6facb969e7e4f19f003c77c4429 /usr.sbin
parent9d8c567d7f78629b1271c36d40fa93b0ec5ab840 (diff)
I don't know what we will do with system packages yet, but prevent
them from getting deleted.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 653199bb734..940df2f95f4 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.65 2007/06/06 15:35:20 espie Exp $
+# $OpenBSD: Delete.pm,v 1.66 2007/06/14 09:29:32 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -84,6 +84,11 @@ sub validate_plist
{
my ($plist, $state) = @_;
+ if ($plist->has('system-package')) {
+ $state->{problems}++;
+ print STDERR "Error: can't delete system packages\n";
+ return;
+ }
$plist->prepare_for_deletion($state, $plist->pkgname);
}