Deleted Added
full compact
main.c (241975) main.c (243553)
1/*
2 *
3 * FreeBSD install - a package for the installation and maintenance
4 * of non-core utilities.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 5 unchanged lines hidden (view full) ---

14 *
15 * Jordan K. Hubbard
16 * 18 July 1993
17 *
18 * This is the add module.
19 */
20
21#include <sys/cdefs.h>
1/*
2 *
3 * FreeBSD install - a package for the installation and maintenance
4 * of non-core utilities.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 5 unchanged lines hidden (view full) ---

14 *
15 * Jordan K. Hubbard
16 * 18 July 1993
17 *
18 * This is the add module.
19 */
20
21#include <sys/cdefs.h>
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/add/main.c 241975 2012-10-24 01:42:46Z kensmith $");
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/add/main.c 243553 2012-11-26 05:11:03Z eadler $");
23
24#include <sys/param.h>
25#include <sys/sysctl.h>
26#include <err.h>
27#include <getopt.h>
28
29#include "lib.h"
30#include "add.h"

--- 100 unchanged lines hidden (view full) ---

131main(int argc, char **argv)
132{
133 int ch, error;
134 char **start;
135 char *cp, *packagesite = NULL, *remotepkg = NULL, *ptr;
136 static char temppackageroot[MAXPATHLEN];
137 static char pkgaddpath[MAXPATHLEN];
138
23
24#include <sys/param.h>
25#include <sys/sysctl.h>
26#include <err.h>
27#include <getopt.h>
28
29#include "lib.h"
30#include "add.h"

--- 100 unchanged lines hidden (view full) ---

131main(int argc, char **argv)
132{
133 int ch, error;
134 char **start;
135 char *cp, *packagesite = NULL, *remotepkg = NULL, *ptr;
136 static char temppackageroot[MAXPATHLEN];
137 static char pkgaddpath[MAXPATHLEN];
138
139 warnpkgng();
140 if (*argv[0] != '/' && strchr(argv[0], '/') != NULL)
141 PkgAddCmd = realpath(argv[0], pkgaddpath);
142 else
143 PkgAddCmd = argv[0];
144
145 start = argv;
146 while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
147 switch(ch) {

--- 142 unchanged lines hidden (view full) ---

290 }
291 /* Perform chroot if requested */
292 if (Chroot != NULL) {
293 if (chdir(Chroot))
294 errx(1, "chdir to %s failed", Chroot);
295 if (chroot("."))
296 errx(1, "chroot to %s failed", Chroot);
297 }
139 if (*argv[0] != '/' && strchr(argv[0], '/') != NULL)
140 PkgAddCmd = realpath(argv[0], pkgaddpath);
141 else
142 PkgAddCmd = argv[0];
143
144 start = argv;
145 while ((ch = getopt_long(argc, argv, opts, longopts, NULL)) != -1) {
146 switch(ch) {

--- 142 unchanged lines hidden (view full) ---

289 }
290 /* Perform chroot if requested */
291 if (Chroot != NULL) {
292 if (chdir(Chroot))
293 errx(1, "chdir to %s failed", Chroot);
294 if (chroot("."))
295 errx(1, "chroot to %s failed", Chroot);
296 }
297 warnpkgng();
298 /* Make sure the sub-execs we invoke get found */
299 setenv("PATH",
300 "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin",
301 1);
302
303 /* Set a reasonable umask */
304 umask(022);
305

--- 70 unchanged lines hidden ---
298 /* Make sure the sub-execs we invoke get found */
299 setenv("PATH",
300 "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin",
301 1);
302
303 /* Set a reasonable umask */
304 umask(022);
305

--- 70 unchanged lines hidden ---