Import pkg_install-20080208

This commit is contained in:
joerg 2008-02-07 23:42:16 +00:00
parent 80b711a35e
commit d32599e755
8 changed files with 33 additions and 65 deletions

View File

@ -4818,8 +4818,7 @@ done
for ac_header in sys/cdefs.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h \
for ac_header in sys/cdefs.h sys/file.h sys/ioctl.h sys/param.h \
sys/poll.h sys/queue.h sys/resource.h sys/signal.h sys/stat.h \
sys/statvfs.h sys/time.h sys/types.h sys/utsname.h sys/vfs.h \
sys/wait.h

View File

@ -78,7 +78,7 @@ AC_CHECK_HEADERS([assert.h ctype.h dirent.h err.h errno.h fnctl.h \
pwd.h regex.h signal.h stdarg.h stdio.h stdlib.h string.h \
termcap.h termios.h time.h unistd.h vis.h])
AC_CHECK_HEADERS([db1/db.h db_185.h db.h])
AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h \
AC_CHECK_HEADERS([sys/cdefs.h sys/file.h sys/ioctl.h sys/param.h \
sys/poll.h sys/queue.h sys/resource.h sys/signal.h sys/stat.h \
sys/statvfs.h sys/time.h sys/types.h sys/utsname.h sys/vfs.h \
sys/wait.h])

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.1.1.5 2008/01/27 14:11:31 joerg Exp $ */
/* $NetBSD: perform.c,v 1.1.1.6 2008/02/07 23:42:16 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.1.1.5 2008/01/27 14:11:31 joerg Exp $");
__RCSID("$NetBSD: perform.c,v 1.1.1.6 2008/02/07 23:42:16 joerg Exp $");
#endif
#endif
@ -839,19 +839,22 @@ pkg_do(char *pkg)
warnx("Oops - removed current working directory. Oh, well.");
if (!Fake) {
/* Finally nuke the +-files and the pkgdb-dir (/var/db/pkg/foo) */
if (is_depoted_pkg) {
(void) remove_files(LogDir, "+*");
if (isemptydir(LogDir))
(void)rmdir(LogDir);
else
warnx("%s is not empty", LogDir);
return 0;
} else {
if (fexec(REMOVE_CMD, "-rf", LogDir, NULL)) {
warnx("couldn't remove log entry in %s, deinstall failed", LogDir);
if (!Force)
return 1;
(void) remove_files(LogDir, "+*");
if (isemptydir(LogDir))
(void)rmdir(LogDir);
else if (is_depoted_pkg)
warnx("%s is not empty", LogDir);
else if (Force) {
if (fexec(REMOVE_CMD, "-rf", LogDir, NULL) != 0) {
warnx("couldn't remove log entry in %s", LogDir);
return 1;
} else {
warnx("log entry forcefully removed in %s", LogDir);
return 0;
}
} else {
warnx("couldn't remove log entry in %s", LogDir);
return 1;
}
}
return 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: perform.c,v 1.1.1.4 2008/02/03 21:21:33 joerg Exp $ */
/* $NetBSD: perform.c,v 1.1.1.5 2008/02/07 23:42:16 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -17,7 +17,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
#else
__RCSID("$NetBSD: perform.c,v 1.1.1.4 2008/02/03 21:21:33 joerg Exp $");
__RCSID("$NetBSD: perform.c,v 1.1.1.5 2008/02/07 23:42:16 joerg Exp $");
#endif
#endif
@ -90,6 +90,9 @@ __RCSID("$NetBSD: perform.c,v 1.1.1.4 2008/02/03 21:21:33 joerg Exp $");
#if HAVE_ERRNO_H
#include <errno.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#if HAVE_SIGNAL_H
#include <signal.h>
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: show.c,v 1.1.1.5 2008/02/03 21:21:34 joerg Exp $ */
/* $NetBSD: show.c,v 1.1.1.6 2008/02/07 23:42:17 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: show.c,v 1.11 1997/10/08 07:47:38 charnier Exp";
#else
__RCSID("$NetBSD: show.c,v 1.1.1.5 2008/02/03 21:21:34 joerg Exp $");
__RCSID("$NetBSD: show.c,v 1.1.1.6 2008/02/07 23:42:17 joerg Exp $");
#endif
#endif
@ -138,6 +138,9 @@ show_var(const char *buf, const char *variable)
{
char *value;
if (buf == NULL)
return;
if ((value = var_get_memory(buf, variable)) != NULL) {
(void) printf("%s\n", value);
free(value);

View File

@ -102,9 +102,6 @@
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H
/* Define to 1 if you have the <sys/mount.h> header file. */
#undef HAVE_SYS_MOUNT_H
/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H

View File

@ -1,4 +1,4 @@
/* $NetBSD: pen.c,v 1.1.1.2 2007/11/03 14:14:13 joerg Exp $ */
/* $NetBSD: pen.c,v 1.1.1.3 2008/02/07 23:42:17 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@ -11,7 +11,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: pen.c,v 1.25 1997/10/08 07:48:12 charnier Exp";
#else
__RCSID("$NetBSD: pen.c,v 1.1.1.2 2007/11/03 14:14:13 joerg Exp $");
__RCSID("$NetBSD: pen.c,v 1.1.1.3 2008/02/07 23:42:17 joerg Exp $");
#endif
#endif
@ -42,12 +42,6 @@ __RCSID("$NetBSD: pen.c,v 1.1.1.2 2007/11/03 14:14:13 joerg Exp $");
#if HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#if HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#if HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
/* For keeping track of where we are */
static char Current[MaxPathSize];
@ -57,37 +51,6 @@ static int CurrentSet; /* rm -fr Current only if it's really set! */
* to prevent rm'ing of a partial string
* when interrupted by ^C */
#if 0
/*
* Backup Current and Previous into temp. strings that are later
* restored & freed by restore_dirs
* This is to make nested calls to make_playpen/leave_playpen work
*/
void
save_dirs(char **c, char **p)
{
*c = strdup(Current); /* XXX */
*p = strdup(Previous);
}
/*
* Restore Current and Previous from temp strings that were created
* by safe_dirs.
* This is to make nested calls to make_playpen/leave_playpen work
*/
void
restore_dirs(char *c, char *p)
{
CurrentSet = 0; /* prevent from deleting */
strlcpy(Current, c, sizeof(Current));
CurrentSet = 1; /* rm -fr Current is safe now */
free(c);
strlcpy(Previous, p, sizeof(Previous));
free(p);
}
#endif
char *
where_playpen(void)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.1.1.9 2008/02/03 21:21:37 joerg Exp $ */
/* $NetBSD: version.h,v 1.1.1.10 2008/02/07 23:42:17 joerg Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@ -33,6 +33,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
#define PKGTOOLS_VERSION "20080202"
#define PKGTOOLS_VERSION "20080208"
#endif /* _INST_LIB_VERSION_H_ */