pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/pkgtools/pkg_install/files



Module Name:    pkgsrc
Committed By:   wiz
Date:           Fri Dec 11 15:55:35 UTC 2020

Modified Files:
        pkgsrc/pkgtools/pkg_install/files/add: perform.c
        pkgsrc/pkgtools/pkg_install/files/lib: version.h

Log Message:
pkg_install-20201212: handle error case better

When pkg_delete fails, report it and error out.


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 pkgsrc/pkgtools/pkg_install/files/add/perform.c
cvs rdiff -u -r1.183 -r1.184 pkgsrc/pkgtools/pkg_install/files/lib/version.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/pkg_install/files/add/perform.c
diff -u pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.115 pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.116
--- pkgsrc/pkgtools/pkg_install/files/add/perform.c:1.115       Fri Dec 11 10:06:53 2020
+++ pkgsrc/pkgtools/pkg_install/files/add/perform.c     Fri Dec 11 15:55:35 2020
@@ -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@localhost>
@@ -1238,7 +1238,9 @@ preserve_meta_data_file(struct pkg_task 
 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)

Index: pkgsrc/pkgtools/pkg_install/files/lib/version.h
diff -u pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.183 pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.184
--- pkgsrc/pkgtools/pkg_install/files/lib/version.h:1.183       Fri Dec 11 10:06:53 2020
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h     Fri Dec 11 15:55:35 2020
@@ -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_ */



Home | Main Index | Thread Index | Old Index