pkgsrc-Changes-HG archive

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

[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install/files Nuke pkgdb...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2ae6c0c35986
branches:  pkg_install-renovation
changeset: 541598:2ae6c0c35986
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Mon Aug 25 18:31:14 2008 +0000

description:
Nuke pkgdb debugging code, it hasn't been used for ages.

diffstat:

 pkgtools/pkg_install/files/admin/check.c |   8 +---
 pkgtools/pkg_install/files/admin/main.c  |  50 +------------------------------
 pkgtools/pkg_install/files/create/pl.c   |  10 +-----
 pkgtools/pkg_install/files/lib/plist.c   |  18 ++--------
 4 files changed, 10 insertions(+), 76 deletions(-)

diffs (183 lines):

diff -r 0a978a65ec88 -r 2ae6c0c35986 pkgtools/pkg_install/files/admin/check.c
--- a/pkgtools/pkg_install/files/admin/check.c  Thu Aug 21 16:10:01 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/check.c  Mon Aug 25 18:31:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: check.c,v 1.2.4.4 2008/08/10 22:08:16 joerg Exp $      */
+/*     $NetBSD: check.c,v 1.2.4.5 2008/08/25 18:31:14 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: check.c,v 1.2.4.4 2008/08/10 22:08:16 joerg Exp $");
+__RCSID("$NetBSD: check.c,v 1.2.4.5 2008/08/25 18:31:14 joerg Exp $");
 #endif
 
 /*-
@@ -119,10 +119,6 @@
                                        if (strncmp(p->next->name, CHECKSUM_HEADER, ChecksumHeaderLen) == 0) {
                                                if ((md5file = MD5File(file, NULL)) != NULL) {
                                                        /* Mismatch? */
-#ifdef PKGDB_DEBUG
-                                                       printf("%s: md5 should=<%s>, is=<%s>\n",
-                                                           file, p->next->name + ChecksumHeaderLen, md5file);
-#endif
                                                        if (strcmp(md5file, p->next->name + ChecksumHeaderLen) != 0)
                                                                printf("%s fails MD5 checksum\n", file);
 
diff -r 0a978a65ec88 -r 2ae6c0c35986 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Thu Aug 21 16:10:01 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Mon Aug 25 18:31:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.42.2.7 2008/08/10 22:08:16 joerg Exp $      */
+/*     $NetBSD: main.c,v 1.42.2.8 2008/08/25 18:31:14 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.42.2.7 2008/08/10 22:08:16 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.42.2.8 2008/08/25 18:31:14 joerg Exp $");
 #endif
 
 /*-
@@ -98,10 +98,6 @@
            " delete pkg ...              - delete file entries for pkg in database\n"
            " set variable=value pkg ...  - set installation variable for package\n"
            " unset variable pkg ...      - unset installation variable for package\n"
-#ifdef PKGDB_DEBUG
-           " addkey key value            - add key and value\n"
-           " delkey key                  - delete reference to key\n"
-#endif
            " lsall /path/to/pkgpattern   - list all pkgs matching the pattern\n"
            " lsbest /path/to/pkgpattern  - list pkgs matching the pattern best\n"
            " dump                        - dump database\n"
@@ -566,48 +562,6 @@
 #endif
        }
 #endif
-#ifdef PKGDB_DEBUG
-       else if (strcasecmp(argv[0], "delkey") == 0) {
-               int     rc;
-
-               if (!pkgdb_open(ReadWrite))
-                       err(EXIT_FAILURE, "cannot open pkgdb");
-
-               rc = pkgdb_remove(argv[2]);
-               if (rc) {
-                       if (errno)
-                               perror("pkgdb_remove");
-                       else
-                               printf("Key not present in pkgdb.\n");
-               }
-               
-               pkgdb_close();
-
-       } else if (strcasecmp(argv[0], "addkey") == 0) {
-
-               int     rc;
-
-               if (!pkgdb_open(ReadWrite)) {
-                       err(EXIT_FAILURE, "cannot open pkgdb");
-               }
-
-               rc = pkgdb_store(argv[2], argv[3]);
-               switch (rc) {
-               case -1:
-                       perror("pkgdb_store");
-                       break;
-               case 1:
-                       printf("Key already present.\n");
-                       break;
-               default:
-                       /* 0: everything ok */
-                       break;
-               }
-
-               pkgdb_close();
-
-       }
-#endif
        else {
                usage();
        }
diff -r 0a978a65ec88 -r 2ae6c0c35986 pkgtools/pkg_install/files/create/pl.c
--- a/pkgtools/pkg_install/files/create/pl.c    Thu Aug 21 16:10:01 2008 +0000
+++ b/pkgtools/pkg_install/files/create/pl.c    Mon Aug 25 18:31:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pl.c,v 1.10.8.2 2008/08/02 20:33:50 joerg Exp $        */
+/*     $NetBSD: pl.c,v 1.10.8.3 2008/08/25 18:31:14 joerg Exp $        */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp";
 #else
-__RCSID("$NetBSD: pl.c,v 1.10.8.2 2008/08/02 20:33:50 joerg Exp $");
+__RCSID("$NetBSD: pl.c,v 1.10.8.3 2008/08/25 18:31:14 joerg Exp $");
 #endif
 #endif
 
@@ -165,17 +165,11 @@
                                        p->name);
 
                                s = pkgdb_retrieve(t);
-#ifdef PKGDB_DEBUG
-                               fprintf(stderr, "pkgdb_retrieve(\"%s\")=\"%s\"\n", t, s);       /* pkgdb-debug - HF */
-#endif
                                if (s && PlistOnly)
                                        warnx("Overwriting %s - "
                                            "pkg %s bogus/conflicting?", t, s);
                                else {
                                        pkgdb_store(t, PkgName);
-#ifdef PKGDB_DEBUG
-                                       fprintf(stderr, "pkgdb_store(\"%s\", \"%s\")\n", t, PkgName);   /* pkgdb-debug - HF */
-#endif
                                }
                        }
 
diff -r 0a978a65ec88 -r 2ae6c0c35986 pkgtools/pkg_install/files/lib/plist.c
--- a/pkgtools/pkg_install/files/lib/plist.c    Thu Aug 21 16:10:01 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/plist.c    Mon Aug 25 18:31:14 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $    */
+/*     $NetBSD: plist.c,v 1.17.4.11 2008/08/25 18:31:14 joerg Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp";
 #else
-__RCSID("$NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.17.4.11 2008/08/25 18:31:14 joerg Exp $");
 #endif
 #endif
 
@@ -634,19 +634,9 @@
 
                                if (!Fake) {
                                        if (!restored) {
-#ifdef PKGDB_DEBUG
-                                               printf("pkgdb_remove(\"%s\")\n", tmp);  /* HF */
-#endif
                                                errno = 0;
-                                               if (pkgdb_remove(tmp)) {
-                                                       if (errno) {
-                                                               perror("pkgdb_remove");
-                                                       }
-                                               } else {
-#ifdef PKGDB_DEBUG
-                                                       printf("pkgdb_remove: ok\n");
-#endif
-                                               }
+                                               if (pkgdb_remove(tmp) && errno)
+                                                       perror("pkgdb_remove");
                                        }
                                }
                        }



Home | Main Index | Thread Index | Old Index