Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/pkg/pkg.c
Show All 37 Lines | |||||
#include <archive.h> | #include <archive.h> | ||||
#include <archive_entry.h> | #include <archive_entry.h> | ||||
#include <dirent.h> | #include <dirent.h> | ||||
#include <err.h> | #include <err.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <fetch.h> | #include <fetch.h> | ||||
#include <libutil.h> | |||||
#include <paths.h> | #include <paths.h> | ||||
#include <stdbool.h> | #include <stdbool.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include <unistd.h> | |||||
#include <ucl.h> | #include <ucl.h> | ||||
#include <openssl/err.h> | #include <openssl/err.h> | ||||
#include <openssl/ssl.h> | #include <openssl/ssl.h> | ||||
#include "dns_utils.h" | #include "dns_utils.h" | ||||
#include "config.h" | #include "config.h" | ||||
▲ Show 20 Lines • Show All 980 Lines • ▼ Show 20 Lines | main(int argc, char *argv[]) | ||||
int i; | int i; | ||||
bool bootstrap_only, force, yes; | bool bootstrap_only, force, yes; | ||||
bootstrap_only = false; | bootstrap_only = false; | ||||
force = false; | force = false; | ||||
pkgarg = NULL; | pkgarg = NULL; | ||||
yes = false; | yes = false; | ||||
snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", | snprintf(pkgpath, MAXPATHLEN, "%s/sbin/pkg", getlocalbase()); | ||||
getenv("LOCALBASE") ? getenv("LOCALBASE") : _PATH_LOCALBASE); | |||||
if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { | if (argc > 1 && strcmp(argv[1], "bootstrap") == 0) { | ||||
bootstrap_only = true; | bootstrap_only = true; | ||||
if (argc > 3) { | if (argc > 3) { | ||||
fprintf(stderr, "Too many arguments\nUsage: pkg bootstrap [-f]\n"); | fprintf(stderr, "Too many arguments\nUsage: pkg bootstrap [-f]\n"); | ||||
exit(EXIT_FAILURE); | exit(EXIT_FAILURE); | ||||
} | } | ||||
if (argc == 3 && strcmp(argv[2], "-f") == 0) { | if (argc == 3 && strcmp(argv[2], "-f") == 0) { | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |