Source-Changes-HG archive

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

[src/netbsd-1-5]: src/usr.sbin/pkg_install/delete Pull up revisions 1.35-1.36...



details:   https://anonhg.NetBSD.org/src/rev/ee4fe3425336
branches:  netbsd-1-5
changeset: 493148:ee4fe3425336
user:      he <he%NetBSD.org@localhost>
date:      Wed Jun 26 16:53:57 2002 +0000

description:
Pull up revisions 1.35-1.36 (requested by taca):
  Synchronize with recent developments:
   o close a memory leak
   o clarify error message if running out of file descriptors
   o implement new packing list directive, @blddep
   o improve buffer size checks
   o improve error handling on installation of prerequisite packages
   o add optional file verification (none, gpg, pgp5)

diffstat:

 usr.sbin/pkg_install/delete/perform.c |  31 ++++++++++---------------------
 1 files changed, 10 insertions(+), 21 deletions(-)

diffs (95 lines):

diff -r 4a4deaa9dfb7 -r ee4fe3425336 usr.sbin/pkg_install/delete/perform.c
--- a/usr.sbin/pkg_install/delete/perform.c     Wed Jun 26 16:53:39 2002 +0000
+++ b/usr.sbin/pkg_install/delete/perform.c     Wed Jun 26 16:53:57 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.31.4.2 2002/02/23 18:07:21 he Exp $      */
+/*     $NetBSD: perform.c,v 1.31.4.3 2002/06/26 16:53:57 he Exp $      */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #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.31.4.2 2002/02/23 18:07:21 he Exp $");
+__RCSID("$NetBSD: perform.c,v 1.31.4.3 2002/06/26 16:53:57 he Exp $");
 #endif
 #endif
 
@@ -73,7 +73,7 @@
 static int require_find(char *, rec_find_t);
 static int require_delete(char *, int);
 static void require_print(void);
-static int undepend(const char *deppkgname, char *pkg2delname);
+static int undepend(const char *, void *);
 
 static char LogDir[FILENAME_MAX];
 static char linebuf[FILENAME_MAX];
@@ -84,17 +84,6 @@
 static lpkg_head_t lpfindq;
 static lpkg_head_t lpdelq;
 
-/*
- * Called to see if pkg is already installed as some other version, 
- * note found version in "note".
- */
-static int
-note_whats_installed(const char *found, char *note)
-{
-       (void) strcpy(note, found);
-       return 0;
-}
-
 static void
 sanity_check(char *pkg)
 {
@@ -118,9 +107,10 @@
  * about to remove pkg2delname. This function is called from
  * findmatchingname(), deppkgname is expanded from a (possible) pattern.
  */
-int
-undepend(const char *deppkgname, char *pkg2delname)
+static int
+undepend(const char *deppkgname, void *vp)
 {
+       char   *pkg2delname = vp;
        char    fname[FILENAME_MAX], ftmp[FILENAME_MAX];
        char    fbuf[FILENAME_MAX];
        FILE   *fp, *fpwr;
@@ -401,7 +391,6 @@
                FILE   *cfile;
                package_t rPlist;
                char   *tmp;
-               plist_t *p;
 
                /* remove a direct req from our queue */
                TAILQ_REMOVE(&reqq, lpp, lp_link);
@@ -541,7 +530,7 @@
                        char    try[FILENAME_MAX];
                        snprintf(try, FILENAME_MAX, "%s-[0-9]*", pkg);
                        if (findmatchingname(_pkgdb_getPKGDB_DIR(), try,
-                               find_fn, NULL) != 0) {
+                               add_to_list_fn, &pkgs) != 0) {
                                return 0;       /* we've just appended some names to the pkgs list,
                                                 * they will be processed after this package. */
                        }
@@ -675,7 +664,7 @@
 }
 
 int
-pkg_perform(lpkg_head_t *pkgs)
+pkg_perform(lpkg_head_t *pkghead)
 {
        int     err_cnt = 0;
        int     oldcwd;
@@ -686,9 +675,9 @@
        if (oldcwd == -1)
                err(1, "cannot open \".\"");
 
-       while ((lpp = TAILQ_FIRST(pkgs))) {
+       while ((lpp = TAILQ_FIRST(pkghead))) {
                err_cnt += pkg_do(lpp->lp_name);
-               TAILQ_REMOVE(pkgs, lpp, lp_link);
+               TAILQ_REMOVE(pkghead, lpp, lp_link);
                free_lpkg(lpp);
                if (fchdir(oldcwd) == FAIL)
                        err(1, "unable to change to previous directory");



Home | Main Index | Thread Index | Old Index