perform.c (113594) | perform.c (131277) |
---|---|
1/* 2 * FreeBSD install - a package for the installation and maintainance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jordan K. Hubbard 15 * 18 July 1993 16 * 17 * This is the main body of the create module. 18 * 19 */ 20 21#include <sys/cdefs.h> | 1/* 2 * FreeBSD install - a package for the installation and maintainance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jordan K. Hubbard 15 * 18 July 1993 16 * 17 * This is the main body of the create module. 18 * 19 */ 20 21#include <sys/cdefs.h> |
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/create/perform.c 113594 2003-04-17 09:56:05Z kris $"); | 22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/create/perform.c 131277 2004-06-29 18:56:59Z eik $"); |
23 24#include "lib.h" 25#include "create.h" 26 27#include <err.h> 28#include <libgen.h> 29#include <signal.h> 30#include <stdlib.h> --- 186 unchanged lines hidden (view full) --- 217 /* copy_plist(home, &plist); */ 218 /* mark_plist(&plist); */ 219 220 /* Now put the release specific items in */ 221 add_plist(&plist, PLIST_CWD, "."); 222 write_file(COMMENT_FNAME, Comment); 223 add_plist(&plist, PLIST_IGNORE, NULL); 224 add_plist(&plist, PLIST_FILE, COMMENT_FNAME); | 23 24#include "lib.h" 25#include "create.h" 26 27#include <err.h> 28#include <libgen.h> 29#include <signal.h> 30#include <stdlib.h> --- 186 unchanged lines hidden (view full) --- 217 /* copy_plist(home, &plist); */ 218 /* mark_plist(&plist); */ 219 220 /* Now put the release specific items in */ 221 add_plist(&plist, PLIST_CWD, "."); 222 write_file(COMMENT_FNAME, Comment); 223 add_plist(&plist, PLIST_IGNORE, NULL); 224 add_plist(&plist, PLIST_FILE, COMMENT_FNAME); |
225 add_cksum(&plist, plist.tail, COMMENT_FNAME); |
|
225 write_file(DESC_FNAME, Desc); 226 add_plist(&plist, PLIST_IGNORE, NULL); 227 add_plist(&plist, PLIST_FILE, DESC_FNAME); | 226 write_file(DESC_FNAME, Desc); 227 add_plist(&plist, PLIST_IGNORE, NULL); 228 add_plist(&plist, PLIST_FILE, DESC_FNAME); |
229 add_cksum(&plist, plist.tail, DESC_FNAME); |
|
228 229 if (Install) { 230 copy_file(home, Install, INSTALL_FNAME); 231 add_plist(&plist, PLIST_IGNORE, NULL); 232 add_plist(&plist, PLIST_FILE, INSTALL_FNAME); | 230 231 if (Install) { 232 copy_file(home, Install, INSTALL_FNAME); 233 add_plist(&plist, PLIST_IGNORE, NULL); 234 add_plist(&plist, PLIST_FILE, INSTALL_FNAME); |
235 add_cksum(&plist, plist.tail, INSTALL_FNAME); |
|
233 } 234 if (PostInstall) { 235 copy_file(home, PostInstall, POST_INSTALL_FNAME); 236 add_plist(&plist, PLIST_IGNORE, NULL); 237 add_plist(&plist, PLIST_FILE, POST_INSTALL_FNAME); | 236 } 237 if (PostInstall) { 238 copy_file(home, PostInstall, POST_INSTALL_FNAME); 239 add_plist(&plist, PLIST_IGNORE, NULL); 240 add_plist(&plist, PLIST_FILE, POST_INSTALL_FNAME); |
241 add_cksum(&plist, plist.tail, POST_INSTALL_FNAME); |
|
238 } 239 if (DeInstall) { 240 copy_file(home, DeInstall, DEINSTALL_FNAME); 241 add_plist(&plist, PLIST_IGNORE, NULL); 242 add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME); | 242 } 243 if (DeInstall) { 244 copy_file(home, DeInstall, DEINSTALL_FNAME); 245 add_plist(&plist, PLIST_IGNORE, NULL); 246 add_plist(&plist, PLIST_FILE, DEINSTALL_FNAME); |
247 add_cksum(&plist, plist.tail, DEINSTALL_FNAME); |
|
243 } 244 if (PostDeInstall) { 245 copy_file(home, PostDeInstall, POST_DEINSTALL_FNAME); 246 add_plist(&plist, PLIST_IGNORE, NULL); 247 add_plist(&plist, PLIST_FILE, POST_DEINSTALL_FNAME); | 248 } 249 if (PostDeInstall) { 250 copy_file(home, PostDeInstall, POST_DEINSTALL_FNAME); 251 add_plist(&plist, PLIST_IGNORE, NULL); 252 add_plist(&plist, PLIST_FILE, POST_DEINSTALL_FNAME); |
253 add_cksum(&plist, plist.tail, POST_DEINSTALL_FNAME); |
|
248 } 249 if (Require) { 250 copy_file(home, Require, REQUIRE_FNAME); 251 add_plist(&plist, PLIST_IGNORE, NULL); 252 add_plist(&plist, PLIST_FILE, REQUIRE_FNAME); | 254 } 255 if (Require) { 256 copy_file(home, Require, REQUIRE_FNAME); 257 add_plist(&plist, PLIST_IGNORE, NULL); 258 add_plist(&plist, PLIST_FILE, REQUIRE_FNAME); |
259 add_cksum(&plist, plist.tail, REQUIRE_FNAME); |
|
253 } 254 if (Display) { 255 copy_file(home, Display, DISPLAY_FNAME); 256 add_plist(&plist, PLIST_IGNORE, NULL); 257 add_plist(&plist, PLIST_FILE, DISPLAY_FNAME); | 260 } 261 if (Display) { 262 copy_file(home, Display, DISPLAY_FNAME); 263 add_plist(&plist, PLIST_IGNORE, NULL); 264 add_plist(&plist, PLIST_FILE, DISPLAY_FNAME); |
265 add_cksum(&plist, plist.tail, DISPLAY_FNAME); |
|
258 add_plist(&plist, PLIST_DISPLAY, DISPLAY_FNAME); 259 } 260 if (Mtree) { 261 copy_file(home, Mtree, MTREE_FNAME); 262 add_plist(&plist, PLIST_IGNORE, NULL); 263 add_plist(&plist, PLIST_FILE, MTREE_FNAME); | 266 add_plist(&plist, PLIST_DISPLAY, DISPLAY_FNAME); 267 } 268 if (Mtree) { 269 copy_file(home, Mtree, MTREE_FNAME); 270 add_plist(&plist, PLIST_IGNORE, NULL); 271 add_plist(&plist, PLIST_FILE, MTREE_FNAME); |
272 add_cksum(&plist, plist.tail, MTREE_FNAME); |
|
264 add_plist(&plist, PLIST_MTREE, MTREE_FNAME); 265 } 266 267 /* Finally, write out the packing list */ 268 fp = fopen(CONTENTS_FNAME, "w"); 269 if (!fp) { 270 cleanup(0); 271 errx(2, "%s: can't open file %s for writing", --- 107 unchanged lines hidden (view full) --- 379 if (Display) 380 fprintf(totar, "%s\n", DISPLAY_FNAME); 381 if (Mtree) 382 fprintf(totar, "%s\n", MTREE_FNAME); 383 384 for (p = plist->head; p; p = p->next) { 385 if (p->type == PLIST_FILE) 386 fprintf(totar, "%s\n", p->name); | 273 add_plist(&plist, PLIST_MTREE, MTREE_FNAME); 274 } 275 276 /* Finally, write out the packing list */ 277 fp = fopen(CONTENTS_FNAME, "w"); 278 if (!fp) { 279 cleanup(0); 280 errx(2, "%s: can't open file %s for writing", --- 107 unchanged lines hidden (view full) --- 388 if (Display) 389 fprintf(totar, "%s\n", DISPLAY_FNAME); 390 if (Mtree) 391 fprintf(totar, "%s\n", MTREE_FNAME); 392 393 for (p = plist->head; p; p = p->next) { 394 if (p->type == PLIST_FILE) 395 fprintf(totar, "%s\n", p->name); |
396 else if (p->type == PLIST_CWD && BaseDir && p->name && p->name[0] == '/') 397 fprintf(totar, "-C\n%s%s\n", BaseDir, p->name); |
|
387 else if (p->type == PLIST_CWD || p->type == PLIST_SRC) 388 fprintf(totar, "-C\n%s\n", p->name); 389 else if (p->type == PLIST_IGNORE) 390 p = p->next; 391 } 392 393 fclose(totar); 394 wait(&ret); --- 82 unchanged lines hidden --- | 398 else if (p->type == PLIST_CWD || p->type == PLIST_SRC) 399 fprintf(totar, "-C\n%s\n", p->name); 400 else if (p->type == PLIST_IGNORE) 401 p = p->next; 402 } 403 404 fclose(totar); 405 wait(&ret); --- 82 unchanged lines hidden --- |