summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2020-12-11 15:55:35 +0000
committerwiz <wiz@pkgsrc.org>2020-12-11 15:55:35 +0000
commitb9fa3f58e1e646e931c1c517d0c6ff31810f82f5 (patch)
tree91be599f54ef06f5d3efbaae6fc20aec2f42cecd /pkgtools/pkg_install
parent4fbece1552cc3dc7c7eed710f234e7895343175f (diff)
downloadpkgsrc-b9fa3f58e1e646e931c1c517d0c6ff31810f82f5.tar.gz
pkg_install-20201212: handle error case better
When pkg_delete fails, report it and error out.
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/add/perform.c21
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
2 files changed, 16 insertions, 9 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 9501072a377..6556dd4fd19 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.115 2020/12/11 10:06:53 jperkin Exp $ */
+/* $NetBSD: perform.c,v 1.116 2020/12/11 15:55:35 wiz Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.115 2020/12/11 10:06:53 jperkin Exp $");
+__RCSID("$NetBSD: perform.c,v 1.116 2020/12/11 15:55:35 wiz Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -1238,7 +1238,9 @@ preserve_meta_data_file(struct pkg_task *pkg, const char *name)
static int
start_replacing(struct pkg_task *pkg)
{
- if (preserve_meta_data_file(pkg, REQUIRED_BY_FNAME))
+ int result = -1;
+
+ if (preserve_meta_data_file(pkg, REQUIRED_BY_FNAME))
return -1;
if (preserve_meta_data_file(pkg, PRESERVE_FNAME))
@@ -1254,14 +1256,19 @@ start_replacing(struct pkg_task *pkg)
Destdir ? " -P ": "", Destdir ? Destdir : "",
pkg->other_version);
}
- if (!Fake)
- fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
+ if (!Fake) {
+ result = fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
"-p", pkg->prefix,
Destdir ? "-P": "", Destdir ? Destdir : "",
pkg->other_version, NULL);
+ if (result != 0) {
+ warnx("command failed: %s/pkg_delete -K %s -p %s %s%s%s",
+ BINDIR, pkgdb_get_dir(), pkg->prefix, Destdir ? "-P" : " ",
+ Destdir ? Destdir : "", pkg->other_version);
+ }
+ }
- /* XXX Check return value and do what? */
- return 0;
+ return result;
}
static int check_input(const char *line, size_t len)
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index c7506b790bc..e1fdef9ade7 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.183 2020/12/11 10:06:53 jperkin Exp $ */
+/* $NetBSD: version.h,v 1.184 2020/12/11 15:55:35 wiz Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -27,6 +27,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION 20201211
+#define PKGTOOLS_VERSION 20201212
#endif /* _INST_LIB_VERSION_H_ */