summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/pkg_install/add/perform.c6
-rw-r--r--usr.sbin/pkg_install/delete/delete.h3
-rw-r--r--usr.sbin/pkg_install/delete/main.c13
-rw-r--r--usr.sbin/pkg_install/delete/perform.c6
-rw-r--r--usr.sbin/pkg_install/delete/pkg_delete.16
-rw-r--r--usr.sbin/pkg_install/lib/lib.h4
-rw-r--r--usr.sbin/pkg_install/lib/plist.c9
7 files changed, 28 insertions, 19 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index dcb8994b4f4..0cc3a52dd98 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.28 2003/07/09 20:01:43 otto Exp $ */
+/* $OpenBSD: perform.c,v 1.29 2003/08/01 08:56:01 espie Exp $ */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: perform.c,v 1.28 2003/07/09 20:01:43 otto Exp $";
+static const char rcsid[] = "$OpenBSD: perform.c,v 1.29 2003/08/01 08:56:01 espie Exp $";
#endif
/*
@@ -556,7 +556,7 @@ pkg_do(char *pkg)
fail:
/* Nuke the whole (installed) show, XXX but don't clean directories */
if (!Fake)
- delete_package(FALSE, FALSE, &Plist);
+ delete_package(FALSE, FALSE, FALSE, &Plist);
success:
/* delete the packing list contents */
diff --git a/usr.sbin/pkg_install/delete/delete.h b/usr.sbin/pkg_install/delete/delete.h
index e952ad1b453..ff3f7f151ac 100644
--- a/usr.sbin/pkg_install/delete/delete.h
+++ b/usr.sbin/pkg_install/delete/delete.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: delete.h,v 1.1 1996/06/04 07:56:07 niklas Exp $ */
+/* $OpenBSD: delete.h,v 1.2 2003/08/01 08:56:01 espie Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -26,6 +26,7 @@
extern char *Prefix;
extern Boolean NoDeInstall;
extern Boolean CleanDirs;
+extern Boolean CheckMD5;
extern Boolean Force;
extern char *Directory;
extern char *PkgName;
diff --git a/usr.sbin/pkg_install/delete/main.c b/usr.sbin/pkg_install/delete/main.c
index 34c1b9973c7..e587f5f5069 100644
--- a/usr.sbin/pkg_install/delete/main.c
+++ b/usr.sbin/pkg_install/delete/main.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: main.c,v 1.10 2003/07/04 17:31:19 avsm Exp $ */
+/* $OpenBSD: main.c,v 1.11 2003/08/01 08:56:01 espie Exp $ */
#include <sys/cdefs.h>
#ifndef lint
-static const char rcsid[] = "$OpenBSD: main.c,v 1.10 2003/07/04 17:31:19 avsm Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.11 2003/08/01 08:56:01 espie Exp $";
#endif
/*
@@ -30,11 +30,12 @@ static const char rcsid[] = "$OpenBSD: main.c,v 1.10 2003/07/04 17:31:19 avsm Ex
#include "lib.h"
#include "delete.h"
-static char Options[] = "hvDdnfp:";
+static char Options[] = "hvDdnfp:q";
char *Prefix = NULL;
Boolean NoDeInstall = FALSE;
Boolean CleanDirs = FALSE;
+Boolean CheckMD5 = TRUE;
static void usage(void);
@@ -72,6 +73,10 @@ main(int argc, char **argv)
Verbose = TRUE;
break;
+ case 'q':
+ CheckMD5 = FALSE;
+ break;
+
case 'h':
case '?':
default:
@@ -105,6 +110,6 @@ main(int argc, char **argv)
static void
usage()
{
- fprintf(stderr, "usage: pkg_delete [-vDdnf] [-p prefix] pkg-name ...\n");
+ fprintf(stderr, "usage: pkg_delete [-vDdhnfq] [-p prefix] pkg-name ...\n");
exit(1);
}
diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c
index 483f338d192..802e5c99ed3 100644
--- a/usr.sbin/pkg_install/delete/perform.c
+++ b/usr.sbin/pkg_install/delete/perform.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: perform.c,v 1.14 2003/07/04 17:31:19 avsm Exp $ */
+/* $OpenBSD: perform.c,v 1.15 2003/08/01 08:56:01 espie Exp $ */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: perform.c,v 1.14 2003/07/04 17:31:19 avsm Exp $";
+static const char rcsid[] = "$OpenBSD: perform.c,v 1.15 2003/08/01 08:56:01 espie Exp $";
#endif
/*
@@ -221,7 +221,7 @@ try_again:
}
if (!Fake) {
/* Some packages aren't packed right, so we need to just ignore delete_package()'s status. Ugh! :-( */
- if (delete_package(FALSE, CleanDirs, &Plist) == FAIL)
+ if (delete_package(FALSE, CleanDirs, CheckMD5, &Plist) == FAIL)
pwarnx(
"couldn't entirely delete package (perhaps the packing list is\n"
"incorrectly specified?)");
diff --git a/usr.sbin/pkg_install/delete/pkg_delete.1 b/usr.sbin/pkg_install/delete/pkg_delete.1
index 80012de9afe..10582b52afa 100644
--- a/usr.sbin/pkg_install/delete/pkg_delete.1
+++ b/usr.sbin/pkg_install/delete/pkg_delete.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pkg_delete.1,v 1.15 2003/03/07 06:30:38 david Exp $
+.\" $OpenBSD: pkg_delete.1,v 1.16 2003/08/01 08:56:01 espie Exp $
.\"
.\" FreeBSD install - a package for the installation and maintenance
.\" of non-core utilities.
@@ -25,7 +25,7 @@
.Nd a utility for deleting previously installed software package distributions
.Sh SYNOPSIS
.Nm pkg_delete
-.Op Fl vDdnf
+.Op Fl vDdnfq
.Op Fl p Ar prefix
.Ar pkg-name Op Ar ...
.Sh DESCRIPTION
@@ -77,6 +77,8 @@ the package.
.It Fl f
Force removal of the package, even if a dependency is recorded or the
deinstall or require script fails.
+.It Fl q
+Delete package quickly, do not bother checking md5s before removing files.
.El
.Sh TECHNICAL DETAILS
.Nm
diff --git a/usr.sbin/pkg_install/lib/lib.h b/usr.sbin/pkg_install/lib/lib.h
index d3d65bb2692..215489a7298 100644
--- a/usr.sbin/pkg_install/lib/lib.h
+++ b/usr.sbin/pkg_install/lib/lib.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.h,v 1.12 2003/04/04 08:56:01 avsm Exp $ */
+/* $OpenBSD: lib.h,v 1.13 2003/08/01 08:56:01 espie Exp $ */
/*
* FreeBSD install - a package for the installation and maintainance
@@ -200,7 +200,7 @@ void delete_plist(package_t *pkg, Boolean all, pl_ent_t type, char *name);
void write_plist(package_t *, FILE *);
void read_plist(package_t *, FILE *);
int plist_cmd(char *, char **);
-int delete_package(Boolean, Boolean, package_t *);
+int delete_package(Boolean, Boolean, Boolean, package_t *);
/* For all */
int pkg_perform(char **);
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c
index 55a24e6c7ae..d0f74efa6f6 100644
--- a/usr.sbin/pkg_install/lib/plist.c
+++ b/usr.sbin/pkg_install/lib/plist.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: plist.c,v 1.15 2003/07/04 17:31:19 avsm Exp $ */
+/* $OpenBSD: plist.c,v 1.16 2003/08/01 08:56:01 espie Exp $ */
#ifndef lint
-static const char rcsid[] = "$OpenBSD: plist.c,v 1.15 2003/07/04 17:31:19 avsm Exp $";
+static const char rcsid[] = "$OpenBSD: plist.c,v 1.16 2003/08/01 08:56:01 espie Exp $";
#endif
/*
@@ -290,7 +290,8 @@ write_plist(package_t *pkg, FILE *fp)
* run it too in cases of failure.
*/
int
-delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg)
+delete_package(Boolean ign_err, Boolean nukedirs,
+ Boolean check_md5, package_t *pkg)
{
plist_t *p;
char *Where = ".", *last_file = "";
@@ -335,7 +336,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, package_t *pkg)
"this packing list is incorrect - ignoring delete request", tmp);
}
else {
- if (p->next && p->next->type == PLIST_COMMENT && !strncmp(p->next->name, "MD5:", 4)) {
+ if (check_md5 && p->next && p->next->type == PLIST_COMMENT && !strncmp(p->next->name, "MD5:", 4)) {
char *cp, buf[LegibleChecksumLen];
if ((cp = MD5File(tmp, buf)) != NULL) {