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/create Pull up revisions 1.29-1.32...



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

description:
Pull up revisions 1.29-1.32 (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/create/perform.c |  40 +++++++++++++++++++---------------
 1 files changed, 22 insertions(+), 18 deletions(-)

diffs (150 lines):

diff -r b56033ede2b7 -r 6db5505792f9 usr.sbin/pkg_install/create/perform.c
--- a/usr.sbin/pkg_install/create/perform.c     Wed Jun 26 16:52:51 2002 +0000
+++ b/usr.sbin/pkg_install/create/perform.c     Wed Jun 26 16:53:10 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.22.4.3 2002/02/23 18:05:01 he Exp $      */
+/*     $NetBSD: perform.c,v 1.22.4.4 2002/06/26 16:53:10 he Exp $      */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.22.4.3 2002/02/23 18:05:01 he Exp $");
+__RCSID("$NetBSD: perform.c,v 1.22.4.4 2002/06/26 16:53:10 he Exp $");
 #endif
 #endif
 
@@ -37,7 +37,7 @@
 #include <sys/wait.h>
 #include <unistd.h>
 
-static char *home;
+static char *Home;
 
 static void
 make_dist(char *home, char *pkg, char *suffix, package_t *plist)
@@ -196,7 +196,7 @@
                alreadyCleaning = 1;
                if (sig)
                        printf("Signal %d received, cleaning up.\n", sig);
-               leave_playpen(home);
+               leave_playpen(Home);
                if (sig)
                        exit(1);
        }
@@ -213,6 +213,7 @@
        package_t plist;
        char   *suffix;         /* What we tack on to the end of the finished package */
        lpkg_t *lpp;
+       char    installed[FILENAME_MAX];
 
        lpp = TAILQ_FIRST(pkgs);
        pkg = lpp->lp_name;     /* Only one arg to create */
@@ -255,6 +256,9 @@
                while (Pkgdeps) {
                        cp = strsep(&Pkgdeps, " \t\n");
                        if (*cp) {
+                               if (findmatchingname(_pkgdb_getPKGDB_DIR(), cp, note_whats_installed, installed) > 0) {
+                                       add_plist(&plist, PLIST_BLDDEP, installed);
+                               }
                                add_plist(&plist, PLIST_PKGDEP, cp);
                                if (Verbose && !PlistOnly)
                                        printf(" %s", cp);
@@ -304,18 +308,18 @@
          * hack.  It's not a real create in progress.
          */
        if (PlistOnly) {
-               check_list(home, &plist, basename_of(pkg));
+               check_list(Home, &plist, basename_of(pkg));
                write_plist(&plist, stdout, realprefix);
                exit(0);
        }
 
        /* Make a directory to stomp around in */
-       home = make_playpen(PlayPen, PlayPenSize, 0);
+       Home = make_playpen(PlayPen, PlayPenSize, 0);
        signal(SIGINT, cleanup);
        signal(SIGHUP, cleanup);
 
        /* Make first "real contents" pass over it */
-       check_list(home, &plist, basename_of(pkg));
+       check_list(Home, &plist, basename_of(pkg));
        (void) umask(022);      /* make sure gen'ed directories, files
                                 * don't have group or other write bits. */
 
@@ -329,49 +333,49 @@
        add_plist(&plist, PLIST_FILE, DESC_FNAME);
 
        if (Install) {
-               copy_file(home, Install, INSTALL_FNAME);
+               copy_file(Home, Install, INSTALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, INSTALL_FNAME);
        }
        if (DeInstall) {
-               copy_file(home, DeInstall, DEINSTALL_FNAME);
+               copy_file(Home, DeInstall, DEINSTALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME);
        }
        if (Require) {
-               copy_file(home, Require, REQUIRE_FNAME);
+               copy_file(Home, Require, REQUIRE_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, REQUIRE_FNAME);
        }
        if (Display) {
-               copy_file(home, Display, DISPLAY_FNAME);
+               copy_file(Home, Display, DISPLAY_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, DISPLAY_FNAME);
                add_plist(&plist, PLIST_DISPLAY, DISPLAY_FNAME);
        }
        if (Mtree) {
-               copy_file(home, Mtree, MTREE_FNAME);
+               copy_file(Home, Mtree, MTREE_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, MTREE_FNAME);
                add_plist(&plist, PLIST_MTREE, MTREE_FNAME);
        }
        if (BuildVersion) {
-               copy_file(home, BuildVersion, BUILD_VERSION_FNAME);
+               copy_file(Home, BuildVersion, BUILD_VERSION_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, BUILD_VERSION_FNAME);
        }
        if (BuildInfo) {
-               copy_file(home, BuildInfo, BUILD_INFO_FNAME);
+               copy_file(Home, BuildInfo, BUILD_INFO_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, BUILD_INFO_FNAME);
        }
        if (SizePkg) {
-               copy_file(home, SizePkg, SIZE_PKG_FNAME);
+               copy_file(Home, SizePkg, SIZE_PKG_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, SIZE_PKG_FNAME);
        }
        if (SizeAll) {
-               copy_file(home, SizeAll, SIZE_ALL_FNAME);
+               copy_file(Home, SizeAll, SIZE_ALL_FNAME);
                add_plist(&plist, PLIST_IGNORE, NULL);
                add_plist(&plist, PLIST_FILE, SIZE_ALL_FNAME);
        }
@@ -389,13 +393,13 @@
        }
 
        /* And stick it into a tar ball */
-       make_dist(home, pkg, suffix, &plist);
+       make_dist(Home, pkg, suffix, &plist);
 
        /* Cleanup */
        free(Comment);
        free(Desc);
        free_plist(&plist);
-       leave_playpen(home);
+       leave_playpen(Home);
        
        return TRUE;            /* Success */
 }



Home | Main Index | Thread Index | Old Index