Sat Jan 30 20:09:34 2010 UTC ()
pkg_install-20100130:
Add -U for pkg_add.  It works similar to -u, but replaces an already
installed version.


(joerg)
diff -r1.17 -r1.18 pkgsrc/pkgtools/pkg_install/files/add/add.h
diff -r1.23 -r1.24 pkgsrc/pkgtools/pkg_install/files/add/main.c
diff -r1.92 -r1.93 pkgsrc/pkgtools/pkg_install/files/add/perform.c
diff -r1.41 -r1.42 pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1
diff -r1.147 -r1.148 pkgsrc/pkgtools/pkg_install/files/lib/version.h

cvs diff -r1.17 -r1.18 pkgsrc/pkgtools/pkg_install/files/add/add.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/add.h 2010/01/22 13:30:41 1.17
+++ pkgsrc/pkgtools/pkg_install/files/add/add.h 2010/01/30 20:09:34 1.18
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: add.h,v 1.17 2010/01/22 13:30:41 joerg Exp $ */ 1/* $NetBSD: add.h,v 1.18 2010/01/30 20:09:34 joerg Exp $ */
2 2
3/* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */ 3/* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */
4 4
5/* 5/*
6 * FreeBSD install - a package for the installation and maintainance 6 * FreeBSD install - a package for the installation and maintainance
7 * of non-core utilities. 7 * of non-core utilities.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -27,22 +27,23 @@ @@ -27,22 +27,23 @@
27 27
28extern char *Destdir; 28extern char *Destdir;
29extern char *OverrideMachine; 29extern char *OverrideMachine;
30extern char *Prefix; 30extern char *Prefix;
31extern char *View; 31extern char *View;
32extern char *Viewbase; 32extern char *Viewbase;
33extern Boolean NoView; 33extern Boolean NoView;
34extern Boolean NoInstall; 34extern Boolean NoInstall;
35extern Boolean NoRecord; 35extern Boolean NoRecord;
36extern Boolean Force; 36extern Boolean Force;
37extern Boolean Automatic; 37extern Boolean Automatic;
38extern int LicenseCheck; 38extern int LicenseCheck;
39extern int Replace; 39extern int Replace;
 40extern int ReplaceSame;
40 41
41extern Boolean ForceDepends; 42extern Boolean ForceDepends;
42 43
43int make_hierarchy(char *); 44int make_hierarchy(char *);
44void apply_perms(char *, char **, int); 45void apply_perms(char *, char **, int);
45 46
46int pkg_perform(lpkg_head_t *); 47int pkg_perform(lpkg_head_t *);
47 48
48#endif /* _INST_ADD_H_INCLUDE */ 49#endif /* _INST_ADD_H_INCLUDE */

cvs diff -r1.23 -r1.24 pkgsrc/pkgtools/pkg_install/files/add/main.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/main.c 2010/01/22 13:30:41 1.23
+++ pkgsrc/pkgtools/pkg_install/files/add/main.c 2010/01/30 20:09:34 1.24
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: main.c,v 1.23 2010/01/22 13:30:41 joerg Exp $ */ 1/* $NetBSD: main.c,v 1.24 2010/01/30 20:09:34 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10__RCSID("$NetBSD: main.c,v 1.23 2010/01/22 13:30:41 joerg Exp $"); 10__RCSID("$NetBSD: main.c,v 1.24 2010/01/30 20:09:34 joerg Exp $");
11 11
12/* 12/*
13 * 13 *
14 * FreeBSD install - a package for the installation and maintainance 14 * FreeBSD install - a package for the installation and maintainance
15 * of non-core utilities. 15 * of non-core utilities.
16 * 16 *
17 * Redistribution and use in source and binary forms, with or without 17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions 18 * modification, are permitted provided that the following conditions
19 * are met: 19 * are met:
20 * 1. Redistributions of source code must retain the above copyright 20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer. 21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright 22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the 23 * notice, this list of conditions and the following disclaimer in the
@@ -29,41 +29,42 @@ __RCSID("$NetBSD: main.c,v 1.23 2010/01/ @@ -29,41 +29,42 @@ __RCSID("$NetBSD: main.c,v 1.23 2010/01/
29 * This is the add module. 29 * This is the add module.
30 * 30 *
31 */ 31 */
32 32
33#if HAVE_ERR_H 33#if HAVE_ERR_H
34#include <err.h> 34#include <err.h>
35#endif 35#endif
36#if HAVE_SYS_PARAM_H 36#if HAVE_SYS_PARAM_H
37#include <sys/param.h> 37#include <sys/param.h>
38#endif 38#endif
39#include "lib.h" 39#include "lib.h"
40#include "add.h" 40#include "add.h"
41 41
42static char Options[] = "AIK:LP:RVW:fhm:np:t:uvw:"; 42static char Options[] = "AIK:LP:RVW:fhm:np:t:Uuvw:";
43 43
44char *Destdir = NULL; 44char *Destdir = NULL;
45char *OverrideMachine = NULL; 45char *OverrideMachine = NULL;
46char *Prefix = NULL; 46char *Prefix = NULL;
47char *View = NULL; 47char *View = NULL;
48char *Viewbase = NULL; 48char *Viewbase = NULL;
49Boolean NoView = FALSE; 49Boolean NoView = FALSE;
50Boolean NoInstall = FALSE; 50Boolean NoInstall = FALSE;
51Boolean NoRecord = FALSE; 51Boolean NoRecord = FALSE;
52Boolean Automatic = FALSE; 52Boolean Automatic = FALSE;
53Boolean ForceDepends = FALSE; 53Boolean ForceDepends = FALSE;
54 54
55int LicenseCheck = 0; 55int LicenseCheck = 0;
56int Replace = 0; 56int Replace = 0;
 57int ReplaceSame = 0;
57 58
58static void 59static void
59usage(void) 60usage(void)
60{ 61{
61 (void) fprintf(stderr, "%s\n%s\n%s\n%s\n", 62 (void) fprintf(stderr, "%s\n%s\n%s\n%s\n",
62 "usage: pkg_add [-AfhILnRuVv] [-C config] [-P destdir] [-K pkg_dbdir]", 63 "usage: pkg_add [-AfhILnRuVv] [-C config] [-P destdir] [-K pkg_dbdir]",
63 " [-m machine] [-p prefix] [-s verification-type", 64 " [-m machine] [-p prefix] [-s verification-type",
64 " [-W viewbase] [-w view]\n", 65 " [-W viewbase] [-w view]\n",
65 " [[ftp|http]://[user[:password]@]host[:port]][/path/]pkg-name ..."); 66 " [[ftp|http]://[user[:password]@]host[:port]][/path/]pkg-name ...");
66 exit(1); 67 exit(1);
67} 68}
68 69
69int 70int
@@ -110,26 +111,32 @@ main(int argc, char **argv) @@ -110,26 +111,32 @@ main(int argc, char **argv)
110 case 'm': 111 case 'm':
111 OverrideMachine = optarg; 112 OverrideMachine = optarg;
112 break; 113 break;
113 114
114 case 'n': 115 case 'n':
115 Fake = TRUE; 116 Fake = TRUE;
116 Verbose = TRUE; 117 Verbose = TRUE;
117 break; 118 break;
118 119
119 case 'p': 120 case 'p':
120 Prefix = optarg; 121 Prefix = optarg;
121 break; 122 break;
122 123
 124 case 'U':
 125 ReplaceSame = 1;
 126 if (!Replace)
 127 Replace = 1;
 128 break;
 129
123 case 'u': 130 case 'u':
124 Replace++; 131 Replace++;
125 break; 132 break;
126 133
127 case 'V': 134 case 'V':
128 show_version(); 135 show_version();
129 /* NOTREACHED */ 136 /* NOTREACHED */
130 137
131 case 'v': 138 case 'v':
132 Verbose = TRUE; 139 Verbose = TRUE;
133 break; 140 break;
134 141
135 case 'W': 142 case 'W':

cvs diff -r1.92 -r1.93 pkgsrc/pkgtools/pkg_install/files/add/perform.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/perform.c 2010/01/22 13:30:41 1.92
+++ pkgsrc/pkgtools/pkg_install/files/add/perform.c 2010/01/30 20:09:34 1.93
@@ -1,22 +1,22 @@ @@ -1,22 +1,22 @@
1/* $NetBSD: perform.c,v 1.92 2010/01/22 13:30:41 joerg Exp $ */ 1/* $NetBSD: perform.c,v 1.93 2010/01/30 20:09:34 joerg Exp $ */
2#if HAVE_CONFIG_H 2#if HAVE_CONFIG_H
3#include "config.h" 3#include "config.h"
4#endif 4#endif
5#include <nbcompat.h> 5#include <nbcompat.h>
6#if HAVE_SYS_CDEFS_H 6#if HAVE_SYS_CDEFS_H
7#include <sys/cdefs.h> 7#include <sys/cdefs.h>
8#endif 8#endif
9__RCSID("$NetBSD: perform.c,v 1.92 2010/01/22 13:30:41 joerg Exp $"); 9__RCSID("$NetBSD: perform.c,v 1.93 2010/01/30 20:09:34 joerg Exp $");
10 10
11/*- 11/*-
12 * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> 12 * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
13 * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org> 13 * Copyright (c) 2005 Dieter Baron <dillo@NetBSD.org>
14 * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org> 14 * Copyright (c) 2007 Roland Illig <rillig@NetBSD.org>
15 * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org> 15 * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg@NetBSD.org>
16 * All rights reserved. 16 * All rights reserved.
17 * 17 *
18 * Redistribution and use in source and binary forms, with or without 18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions 19 * modification, are permitted provided that the following conditions
20 * are met: 20 * are met:
21 * 21 *
22 * 1. Redistributions of source code must retain the above copyright 22 * 1. Redistributions of source code must retain the above copyright
@@ -74,26 +74,27 @@ struct pkg_meta { @@ -74,26 +74,27 @@ struct pkg_meta {
74 char *meta_preserve; 74 char *meta_preserve;
75 char *meta_views; 75 char *meta_views;
76 char *meta_installed_info; 76 char *meta_installed_info;
77}; 77};
78 78
79struct pkg_task { 79struct pkg_task {
80 char *pkgname; 80 char *pkgname;
81 81
82 const char *prefix; 82 const char *prefix;
83 char *install_prefix; 83 char *install_prefix;
84 84
85 char *logdir; 85 char *logdir;
86 char *install_logdir; 86 char *install_logdir;
 87 char *install_logdir_real;
87 char *other_version; 88 char *other_version;
88 89
89 package_t plist; 90 package_t plist;
90 91
91 struct pkg_meta meta_data; 92 struct pkg_meta meta_data;
92 93
93 struct archive *archive; 94 struct archive *archive;
94 struct archive_entry *entry; 95 struct archive_entry *entry;
95 96
96 char *buildinfo[BI_ENUM_COUNT]; 97 char *buildinfo[BI_ENUM_COUNT];
97 98
98 size_t dep_length, dep_allocated; 99 size_t dep_length, dep_allocated;
99 char **dependencies; 100 char **dependencies;
@@ -328,33 +329,47 @@ dup_value(const char *line, const char * @@ -328,33 +329,47 @@ dup_value(const char *line, const char *
328 val = xmalloc(eol - key); 329 val = xmalloc(eol - key);
329 memcpy(val, key + 1, eol - key - 1); 330 memcpy(val, key + 1, eol - key - 1);
330 val[eol - key - 1] = '\0'; 331 val[eol - key - 1] = '\0';
331 return val; 332 return val;
332} 333}
333 334
334static int 335static int
335check_already_installed(struct pkg_task *pkg) 336check_already_installed(struct pkg_task *pkg)
336{ 337{
337 char *filename; 338 char *filename;
338 int fd; 339 int fd;
339 340
340 if (Force) 341 if (Force)
341 return -1; 342 return 1;
342 343
343 filename = pkgdb_pkg_file(pkg->pkgname, CONTENTS_FNAME); 344 filename = pkgdb_pkg_file(pkg->pkgname, CONTENTS_FNAME);
344 fd = open(filename, O_RDONLY); 345 fd = open(filename, O_RDONLY);
345 free(filename); 346 free(filename);
346 if (fd == -1) 347 if (fd == -1)
347 return -1; 348 return 1;
 349
 350 if (ReplaceSame) {
 351 struct stat sb;
 352
 353 pkg->install_logdir_real = pkg->install_logdir;
 354 pkg->install_logdir = xasprintf("%s.xxxxxx", pkg->install_logdir);
 355 if (stat(pkg->install_logdir, &sb) == 0) {
 356 warnx("package `%s' already has a temporary update "
 357 "directory `%s', remove it manually",
 358 pkg->pkgname, pkg->install_logdir);
 359 return -1;
 360 }
 361 return 1;
 362 }
348 363
349 /* We can only arrive here for explicitly requested packages. */ 364 /* We can only arrive here for explicitly requested packages. */
350 if (!Automatic && is_automatic_installed(pkg->pkgname)) { 365 if (!Automatic && is_automatic_installed(pkg->pkgname)) {
351 if (Fake || 366 if (Fake ||
352 mark_as_automatic_installed(pkg->pkgname, 0) == 0) 367 mark_as_automatic_installed(pkg->pkgname, 0) == 0)
353 warnx("package `%s' was already installed as " 368 warnx("package `%s' was already installed as "
354 "dependency, now marked as installed " 369 "dependency, now marked as installed "
355 "manually", pkg->pkgname); 370 "manually", pkg->pkgname);
356 } else { 371 } else {
357 warnx("package `%s' already recorded as installed", 372 warnx("package `%s' already recorded as installed",
358 pkg->pkgname); 373 pkg->pkgname);
359 } 374 }
360 close(fd); 375 close(fd);
@@ -362,26 +377,31 @@ check_already_installed(struct pkg_task  @@ -362,26 +377,31 @@ check_already_installed(struct pkg_task
362 377
363} 378}
364 379
365static int 380static int
366check_other_installed(struct pkg_task *pkg) 381check_other_installed(struct pkg_task *pkg)
367{ 382{
368 FILE *f, *f_pkg; 383 FILE *f, *f_pkg;
369 size_t len; 384 size_t len;
370 char *pkgbase, *iter, *filename; 385 char *pkgbase, *iter, *filename;
371 package_t plist; 386 package_t plist;
372 plist_t *p; 387 plist_t *p;
373 int status; 388 int status;
374 389
 390 if (pkg->install_logdir_real) {
 391 pkg->other_version = xstrdup(pkg->pkgname);
 392 return 0;
 393 }
 394
375 pkgbase = xstrdup(pkg->pkgname); 395 pkgbase = xstrdup(pkg->pkgname);
376 396
377 if ((iter = strrchr(pkgbase, '-')) == NULL) { 397 if ((iter = strrchr(pkgbase, '-')) == NULL) {
378 free(pkgbase); 398 free(pkgbase);
379 warnx("Invalid package name %s", pkg->pkgname); 399 warnx("Invalid package name %s", pkg->pkgname);
380 return -1; 400 return -1;
381 } 401 }
382 *iter = '\0'; 402 *iter = '\0';
383 pkg->other_version = find_best_matching_installed_pkg(pkgbase); 403 pkg->other_version = find_best_matching_installed_pkg(pkgbase);
384 free(pkgbase); 404 free(pkgbase);
385 if (pkg->other_version == NULL) 405 if (pkg->other_version == NULL)
386 return 0; 406 return 0;
387 407
@@ -1100,27 +1120,27 @@ pkg_register_views(struct pkg_task *pkg) @@ -1100,27 +1120,27 @@ pkg_register_views(struct pkg_task *pkg)
1100 (void *)NULL); 1120 (void *)NULL);
1101} 1121}
1102 1122
1103static int 1123static int
1104preserve_meta_data_file(struct pkg_task *pkg, const char *name) 1124preserve_meta_data_file(struct pkg_task *pkg, const char *name)
1105{ 1125{
1106 char *old_file, *new_file; 1126 char *old_file, *new_file;
1107 int rv; 1127 int rv;
1108 1128
1109 if (Fake) 1129 if (Fake)
1110 return 0; 1130 return 0;
1111 1131
1112 old_file = pkgdb_pkg_file(pkg->other_version, name); 1132 old_file = pkgdb_pkg_file(pkg->other_version, name);
1113 new_file = pkgdb_pkg_file(pkg->pkgname, name); 1133 new_file = xasprintf("%s/%s", pkg->install_logdir, name);
1114 rv = 0; 1134 rv = 0;
1115 if (rename(old_file, new_file) == -1 && errno != ENOENT) { 1135 if (rename(old_file, new_file) == -1 && errno != ENOENT) {
1116 warn("Can't move %s from %s to %s", name, old_file, new_file); 1136 warn("Can't move %s from %s to %s", name, old_file, new_file);
1117 rv = -1;  1137 rv = -1;
1118 } 1138 }
1119 free(old_file); 1139 free(old_file);
1120 free(new_file); 1140 free(new_file);
1121 return rv; 1141 return rv;
1122} 1142}
1123 1143
1124static int 1144static int
1125start_replacing(struct pkg_task *pkg) 1145start_replacing(struct pkg_task *pkg)
1126{ 1146{
@@ -1343,55 +1363,67 @@ pkg_do(const char *pkgpath, int mark_aut @@ -1343,55 +1363,67 @@ pkg_do(const char *pkgpath, int mark_aut
1343 tmpdir = getenv("TMPDIR"); 1363 tmpdir = getenv("TMPDIR");
1344 if (tmpdir == NULL) 1364 if (tmpdir == NULL)
1345 tmpdir = "/tmp"; 1365 tmpdir = "/tmp";
1346 1366
1347 free(pkg->install_logdir); 1367 free(pkg->install_logdir);
1348 pkg->install_logdir = xasprintf("%s/pkg_install.XXXXXX", tmpdir); 1368 pkg->install_logdir = xasprintf("%s/pkg_install.XXXXXX", tmpdir);
1349 /* XXX pkg_add -u... */ 1369 /* XXX pkg_add -u... */
1350 if (mkdtemp(pkg->install_logdir) == NULL) { 1370 if (mkdtemp(pkg->install_logdir) == NULL) {
1351 warn("mkdtemp failed"); 1371 warn("mkdtemp failed");
1352 goto clean_memory; 1372 goto clean_memory;
1353 } 1373 }
1354 } 1374 }
1355 1375
1356 if (check_already_installed(pkg) == 0) { 1376 switch (check_already_installed(pkg)) {
 1377 case 0:
1357 status = 0; 1378 status = 0;
1358 goto clean_memory; 1379 goto clean_memory;
 1380 case 1:
 1381 break;
 1382 case -1:
 1383 goto clean_memory;
1359 } 1384 }
1360 1385
1361 if (check_platform(pkg)) 1386 if (check_platform(pkg))
1362 goto clean_memory; 1387 goto clean_memory;
1363 1388
1364 if (check_other_installed(pkg)) 1389 if (check_other_installed(pkg))
1365 goto clean_memory;  1390 goto clean_memory;
1366 1391
1367 if (check_explicit_conflict(pkg)) 1392 if (check_explicit_conflict(pkg))
1368 goto clean_memory; 1393 goto clean_memory;
1369 1394
1370 if (check_implicit_conflict(pkg)) 1395 if (check_implicit_conflict(pkg))
1371 goto clean_memory; 1396 goto clean_memory;
1372 1397
1373 if (pkg->other_version != NULL) { 1398 if (pkg->other_version != NULL) {
1374 /* 1399 /*
1375 * Replacing an existing package. 1400 * Replacing an existing package.
1376 * Write meta-data, get rid of the old version, 1401 * Write meta-data, get rid of the old version,
1377 * install/update dependencies and finally extract. 1402 * install/update dependencies and finally extract.
1378 */ 1403 */
1379 if (write_meta_data(pkg)) 1404 if (write_meta_data(pkg))
1380 goto nuke_pkgdb; 1405 goto nuke_pkgdb;
1381 1406
1382 if (start_replacing(pkg)) 1407 if (start_replacing(pkg))
1383 goto nuke_pkgdb; 1408 goto nuke_pkgdb;
1384 1409
 1410 if (pkg->install_logdir_real) {
 1411 rename(pkg->install_logdir, pkg->install_logdir_real);
 1412 free(pkg->install_logdir);
 1413 pkg->install_logdir = pkg->install_logdir_real;
 1414 pkg->install_logdir_real = NULL;
 1415 }
 1416
1385 if (check_dependencies(pkg)) 1417 if (check_dependencies(pkg))
1386 goto nuke_pkgdb; 1418 goto nuke_pkgdb;
1387 } else { 1419 } else {
1388 /* 1420 /*
1389 * Normal installation. 1421 * Normal installation.
1390 * Install/update dependencies first and 1422 * Install/update dependencies first and
1391 * write the current package to disk afterwards. 1423 * write the current package to disk afterwards.
1392 */  1424 */
1393 if (check_dependencies(pkg)) 1425 if (check_dependencies(pkg))
1394 goto clean_memory; 1426 goto clean_memory;
1395 1427
1396 if (write_meta_data(pkg)) 1428 if (write_meta_data(pkg))
1397 goto nuke_pkgdb; 1429 goto nuke_pkgdb;
@@ -1428,38 +1460,41 @@ nuke_pkg: @@ -1428,38 +1460,41 @@ nuke_pkg:
1428 if (!Fake) { 1460 if (!Fake) {
1429 if (pkg->other_version) { 1461 if (pkg->other_version) {
1430 warnx("Updating of %s to %s failed.", 1462 warnx("Updating of %s to %s failed.",
1431 pkg->other_version, pkg->pkgname); 1463 pkg->other_version, pkg->pkgname);
1432 warnx("Remember to run pkg_admin rebuild-tree after fixing this."); 1464 warnx("Remember to run pkg_admin rebuild-tree after fixing this.");
1433 } 1465 }
1434 delete_package(FALSE, &pkg->plist, FALSE, Destdir); 1466 delete_package(FALSE, &pkg->plist, FALSE, Destdir);
1435 } 1467 }
1436 1468
1437nuke_pkgdb: 1469nuke_pkgdb:
1438 if (!Fake) { 1470 if (!Fake) {
1439 if (recursive_remove(pkg->install_logdir, 1)) 1471 if (recursive_remove(pkg->install_logdir, 1))
1440 warn("Couldn't remove %s", pkg->install_logdir); 1472 warn("Couldn't remove %s", pkg->install_logdir);
 1473 free(pkg->install_logdir_real);
1441 free(pkg->install_logdir); 1474 free(pkg->install_logdir);
1442 free(pkg->logdir); 1475 free(pkg->logdir);
 1476 pkg->install_logdir_real = NULL;
1443 pkg->install_logdir = NULL; 1477 pkg->install_logdir = NULL;
1444 pkg->logdir = NULL; 1478 pkg->logdir = NULL;
1445 } 1479 }
1446 1480
1447clean_memory: 1481clean_memory:
1448 if (pkg->logdir != NULL && NoRecord && !Fake) { 1482 if (pkg->logdir != NULL && NoRecord && !Fake) {
1449 if (recursive_remove(pkg->install_logdir, 1)) 1483 if (recursive_remove(pkg->install_logdir, 1))
1450 warn("Couldn't remove %s", pkg->install_logdir); 1484 warn("Couldn't remove %s", pkg->install_logdir);
1451 } 1485 }
1452 free(pkg->install_prefix); 1486 free(pkg->install_prefix);
 1487 free(pkg->install_logdir_real);
1453 free(pkg->install_logdir); 1488 free(pkg->install_logdir);
1454 free(pkg->logdir); 1489 free(pkg->logdir);
1455 free_buildinfo(pkg); 1490 free_buildinfo(pkg);
1456 free_plist(&pkg->plist); 1491 free_plist(&pkg->plist);
1457 free_meta_data(pkg); 1492 free_meta_data(pkg);
1458 if (pkg->archive) 1493 if (pkg->archive)
1459 archive_read_finish(pkg->archive); 1494 archive_read_finish(pkg->archive);
1460 free(pkg->other_version); 1495 free(pkg->other_version);
1461 free(pkg->pkgname); 1496 free(pkg->pkgname);
1462clean_find_archive: 1497clean_find_archive:
1463 free(pkg); 1498 free(pkg);
1464 return status; 1499 return status;
1465} 1500}

cvs diff -r1.41 -r1.42 pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1 (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1 2010/01/22 13:30:41 1.41
+++ pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1 2010/01/30 20:09:34 1.42
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1.\" $NetBSD: pkg_add.1,v 1.41 2010/01/22 13:30:41 joerg Exp $ 1.\" $NetBSD: pkg_add.1,v 1.42 2010/01/30 20:09:34 joerg Exp $
2.\" 2.\"
3.\" FreeBSD install - a package for the installation and maintenance 3.\" FreeBSD install - a package for the installation and maintenance
4.\" of non-core utilities. 4.\" of non-core utilities.
5.\" 5.\"
6.\" Redistribution and use in source and binary forms, with or without 6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions 7.\" modification, are permitted provided that the following conditions
8.\" are met: 8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright 9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer. 10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the 12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution. 13.\" documentation and/or other materials provided with the distribution.
14.\" 14.\"
15.\" Jordan K. Hubbard 15.\" Jordan K. Hubbard
16.\" 16.\"
17.\" 17.\"
18.\" @(#)pkg_add.1 18.\" @(#)pkg_add.1
19.\" 19.\"
20.Dd January 22, 2010 20.Dd January 30, 2010
21.Dt PKG_ADD 1 21.Dt PKG_ADD 1
22.Os 22.Os
23.Sh NAME 23.Sh NAME
24.Nm pkg_add 24.Nm pkg_add
25.Nd a utility for installing and upgrading software package distributions 25.Nd a utility for installing and upgrading software package distributions
26.Sh SYNOPSIS 26.Sh SYNOPSIS
27.Nm 27.Nm
28.Op Fl AfILnRuVv 28.Op Fl AfILnRUuVv
29.Op Fl K Ar pkg_dbdir 29.Op Fl K Ar pkg_dbdir
30.Op Fl m Ar machine 30.Op Fl m Ar machine
31.Op Fl P Ar destdir 31.Op Fl P Ar destdir
32.Op Fl p Ar prefix 32.Op Fl p Ar prefix
33.Op Fl W Ar viewbase 33.Op Fl W Ar viewbase
34.Op Fl w Ar view 34.Op Fl w Ar view
35.Ar Oo Oo Li ftp|http Oc Ns Li :// Ns Oo Ar user Oc Ns \ 35.Ar Oo Oo Li ftp|http Oc Ns Li :// Ns Oo Ar user Oc Ns \
36Oo Li \&: Ns Ar password Oc \ 36Oo Li \&: Ns Ar password Oc \
37Ns Li @ Oc Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns \ 37Ns Li @ Oc Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns \
38Oo Li / Ns Ar path/ Oc Ns Ar pkg-name ... 38Oo Li / Ns Ar path/ Oc Ns Ar pkg-name ...
39.Sh DESCRIPTION 39.Sh DESCRIPTION
40The 40The
41.Nm 41.Nm
@@ -145,30 +145,33 @@ Prefix all file and directory names with @@ -145,30 +145,33 @@ Prefix all file and directory names with
145.Ar destdir . 145.Ar destdir .
146For packages without install scripts this has the same behavior as 146For packages without install scripts this has the same behavior as
147using 147using
148.Xr chroot 8 . 148.Xr chroot 8 .
149.It Fl p Ar prefix 149.It Fl p Ar prefix
150Override the prefix stored in the package with 150Override the prefix stored in the package with
151.Ar prefix . 151.Ar prefix .
152.It Fl R 152.It Fl R
153Do not record the installation of a package. 153Do not record the installation of a package.
154This implies 154This implies
155.Fl I . 155.Fl I .
156This means that you cannot deinstall it later, so only use this option if 156This means that you cannot deinstall it later, so only use this option if
157you know what you are doing! 157you know what you are doing!
 158.It Fl U
 159Replace an already installed version from a package.
 160Implies
 161.Fl u .
158.It Fl u 162.It Fl u
159If the package that's being installed is already installed, 163If the package that's being installed is already installed,
160an update is performed. 164an update is performed.
161It is currently not possible to update to an identical version. 
162If this is specified twice, then any dependent packages that are 165If this is specified twice, then any dependent packages that are
163too old will also be updated to fulfill the dependency. 166too old will also be updated to fulfill the dependency.
164See below for a more detailed description of the process. 167See below for a more detailed description of the process.
165.It Fl V 168.It Fl V
166Print version number and exit. 169Print version number and exit.
167.It Fl v 170.It Fl v
168Turn on verbose output. 171Turn on verbose output.
169.It Fl W Ar viewbase 172.It Fl W Ar viewbase
170Passed down to 173Passed down to
171.Xr pkg_view 1 174.Xr pkg_view 1
172for managed views. 175for managed views.
173.It Fl w Ar view 176.It Fl w Ar view
174Passed down to 177Passed down to

cvs diff -r1.147 -r1.148 pkgsrc/pkgtools/pkg_install/files/lib/version.h (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/lib/version.h 2010/01/26 15:48:13 1.147
+++ pkgsrc/pkgtools/pkg_install/files/lib/version.h 2010/01/30 20:09:34 1.148
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: version.h,v 1.147 2010/01/26 15:48:13 joerg Exp $ */ 1/* $NetBSD: version.h,v 1.148 2010/01/30 20:09:34 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Thomas Klausner. All rights reserved. 4 * Copyright (c) 2001 Thomas Klausner. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
@@ -17,16 +17,16 @@ @@ -17,16 +17,16 @@
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#ifndef _INST_LIB_VERSION_H_ 27#ifndef _INST_LIB_VERSION_H_
28#define _INST_LIB_VERSION_H_ 28#define _INST_LIB_VERSION_H_
29 29
30#define PKGTOOLS_VERSION "20100126" 30#define PKGTOOLS_VERSION "20100130"
31 31
32#endif /* _INST_LIB_VERSION_H_ */ 32#endif /* _INST_LIB_VERSION_H_ */