From d885abbcc7cc8875af669798ca0d6c6f6a0d1c90 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 14 Jun 2007 09:29:33 +0000 Subject: I don't know what we will do with system packages yet, but prevent them from getting deleted. --- usr.sbin/pkg_add/OpenBSD/Delete.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.sbin/pkg_add/OpenBSD') 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 # @@ -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); } -- cgit v1.2.3