diff options
author | joerg <joerg@pkgsrc.org> | 2015-12-27 12:36:42 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2015-12-27 12:36:42 +0000 |
commit | d5386faf7a169acf97d0c3a35036a5b104cbdc45 (patch) | |
tree | 9c2c1a0a47c8f16295e614c27a2204d40b111063 /pkgtools | |
parent | 993b195ce0e82c25cae220225f103eee1d1b1abf (diff) | |
download | pkgsrc-d5386faf7a169acf97d0c3a35036a5b104cbdc45.tar.gz |
Include basic package creation logic in the bootstrap version of
pkg_install. Use this with PKG_COMPRESSION=none to convert all of the
bootstrap to USE_DESTDIR=yes.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_install/files/Makefile.in | 4 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/Makefile.in | 9 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/main.c | 9 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/add/perform.c | 29 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/create/Makefile.in | 7 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/create/perform.c | 9 |
6 files changed, 49 insertions, 18 deletions
diff --git a/pkgtools/pkg_install/files/Makefile.in b/pkgtools/pkg_install/files/Makefile.in index 3572d3e2a3c..10426801f4e 100644 --- a/pkgtools/pkg_install/files/Makefile.in +++ b/pkgtools/pkg_install/files/Makefile.in @@ -1,11 +1,11 @@ -# $NetBSD: Makefile.in,v 1.10 2013/09/11 14:39:21 wiz Exp $ +# $NetBSD: Makefile.in,v 1.11 2015/12/27 12:36:42 joerg Exp $ BOOTSTRAP= @bootstrap@ .if empty(BOOTSTRAP) SUBDIRS= lib add admin create delete info .else -SUBDIRS= lib admin create info +SUBDIRS= lib add admin create info .endif all: diff --git a/pkgtools/pkg_install/files/add/Makefile.in b/pkgtools/pkg_install/files/add/Makefile.in index c9078510536..524a18a2d04 100644 --- a/pkgtools/pkg_install/files/add/Makefile.in +++ b/pkgtools/pkg_install/files/add/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.32 2015/10/20 08:18:12 jperkin Exp $ +# $NetBSD: Makefile.in,v 1.33 2015/12/27 12:36:42 joerg Exp $ srcdir= @srcdir@ @@ -18,13 +18,20 @@ DEFS= @DEFS@ -DOPSYS_NAME=\"$(OPSYS)\" -DPKGSRC_MACHINE_ARCH=\"$(PKGSRC_MACHINE CFLAGS= @CFLAGS@ LDFLAGS= @LDFLAGS@ -L../lib +BOOTSTRAP= @bootstrap@ SSL_SUPPORT= @ssl_support@ +.if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch .if !empty(SSL_SUPPORT) LIBS+= -lssl -lcrypto +CPPFLAGS+= -DHAVE_SSL .endif LIBS+= @LIBS@ +.else +LIBS= -linstall ${STATIC_LIBARCHIVE} @LIBS@ +CPPFLAGS+= -DBOOTSTRAP +.endif INSTALL= @INSTALL@ diff --git a/pkgtools/pkg_install/files/add/main.c b/pkgtools/pkg_install/files/add/main.c index b80ae881fa6..bec60692332 100644 --- a/pkgtools/pkg_install/files/add/main.c +++ b/pkgtools/pkg_install/files/add/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.31 2015/10/15 13:31:27 sevan Exp $ */ +/* $NetBSD: main.c,v 1.32 2015/12/27 12:36:42 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: main.c,v 1.31 2015/10/15 13:31:27 sevan Exp $"); +__RCSID("$NetBSD: main.c,v 1.32 2015/12/27 12:36:42 joerg Exp $"); /* * @@ -159,7 +159,10 @@ main(int argc, char **argv) free(pkgdbdir); } +#ifndef BOOTSTRAP process_pkg_path(); +#endif + TAILQ_INIT(&pkgs); if (argc == 0) { @@ -168,6 +171,7 @@ main(int argc, char **argv) usage(); } +#ifndef BOOTSTRAP if (strcasecmp(do_license_check, "no") == 0) LicenseCheck = 0; else if (strcasecmp(do_license_check, "yes") == 0) @@ -180,6 +184,7 @@ main(int argc, char **argv) if (LicenseCheck) load_license_lists(); +#endif /* Get all the remaining package names, if any */ for (; argc > 0; --argc, ++argv) { diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c index c207a719848..feddef6bc47 100644 --- a/pkgtools/pkg_install/files/add/perform.c +++ b/pkgtools/pkg_install/files/add/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $ */ +/* $NetBSD: perform.c,v 1.108 2015/12/27 12:36:42 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" #endif @@ -6,7 +6,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: perform.c,v 1.107 2015/10/20 08:18:12 jperkin Exp $"); +__RCSID("$NetBSD: perform.c,v 1.108 2015/12/27 12:36:42 joerg Exp $"); /*- * Copyright (c) 2003 Grant Beattie <grant@NetBSD.org> @@ -1246,6 +1246,9 @@ static int check_input(const char *line, size_t len) static int check_signature(struct pkg_task *pkg, int invalid_sig) { +#ifdef BOOTSTRAP + return 0; +#else char *line; size_t len; @@ -1282,11 +1285,15 @@ check_signature(struct pkg_task *pkg, int invalid_sig) } warnx("Unknown value of configuration variable VERIFIED_INSTALLATION"); return 1; +#endif } static int check_vulnerable(struct pkg_task *pkg) { +#ifdef BOOTSTRAP + return 0; +#else static struct pkg_vulnerabilities *pv; int require_check; char *line; @@ -1325,11 +1332,15 @@ check_vulnerable(struct pkg_task *pkg) return 1; } return 0; +#endif } static int check_license(struct pkg_task *pkg) { +#ifdef BOOTSTRAP + return 0; +#else if (LicenseCheck == 0) return 0; @@ -1353,6 +1364,7 @@ check_license(struct pkg_task *pkg) warnx("Invalid LICENSE for package `%s'", pkg->pkgname); return 1; } +#endif } /* @@ -1361,7 +1373,9 @@ check_license(struct pkg_task *pkg) static int pkg_do(const char *pkgpath, int mark_automatic, int top_level) { +#ifndef BOOTSTRAP char *archive_name; +#endif int status, invalid_sig; struct pkg_task *pkg; @@ -1369,6 +1383,16 @@ pkg_do(const char *pkgpath, int mark_automatic, int top_level) status = -1; +#ifdef BOOTSTRAP + pkg->archive = archive_read_new(); + archive_read_support_compression_all(pkg->archive); + archive_read_support_format_all(pkg->archive); + if (archive_read_open_filename(pkg->archive, pkgpath, 1024)) { + warnx("no pkg found for '%s', sorry.", pkgpath); + archive_read_free(pkg->archive); + goto clean_find_archive; + } +#else pkg->archive = find_archive(pkgpath, top_level, &archive_name); if (pkg->archive == NULL) { warnx("no pkg found for '%s', sorry.", pkgpath); @@ -1378,6 +1402,7 @@ pkg_do(const char *pkgpath, int mark_automatic, int top_level) invalid_sig = pkg_verify_signature(archive_name, &pkg->archive, &pkg->entry, &pkg->pkgname); free(archive_name); +#endif if (pkg->archive == NULL) goto clean_memory; diff --git a/pkgtools/pkg_install/files/create/Makefile.in b/pkgtools/pkg_install/files/create/Makefile.in index 7b606bf2a3a..da87b40e251 100644 --- a/pkgtools/pkg_install/files/create/Makefile.in +++ b/pkgtools/pkg_install/files/create/Makefile.in @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.in,v 1.28 2015/12/27 12:18:20 joerg Exp $ +# $NetBSD: Makefile.in,v 1.29 2015/12/27 12:36:42 joerg Exp $ srcdir= @srcdir@ @@ -25,17 +25,16 @@ PROG= pkg_create SSL_SUPPORT= @ssl_support@ CPPFLAGS= @CPPFLAGS@ -I. -I$(srcdir) -I../lib +OBJS= main.o perform.o pl.o util.o build.o .if empty(BOOTSTRAP) LIBS= -linstall -lnetpgpverify -larchive -lbz2 -lz -lfetch @LIBS@ .if !empty(SSL_SUPPORT) LIBS+= -lssl -lcrypto .endif -OBJS= main.o perform.o pl.o util.o build.o .else -LIBS= -linstall @LIBS@ +LIBS= -linstall ${STATIC_LIBARCHIVE} @LIBS@ CPPFLAGS+= -DBOOTSTRAP -OBJS= main.o perform.o pl.o util.o .endif all: $(PROG) diff --git a/pkgtools/pkg_install/files/create/perform.c b/pkgtools/pkg_install/files/create/perform.c index 1d4b1585a67..2827c0e4b08 100644 --- a/pkgtools/pkg_install/files/create/perform.c +++ b/pkgtools/pkg_install/files/create/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.26 2009/11/05 16:22:32 joerg Exp $ */ +/* $NetBSD: perform.c,v 1.27 2015/12/27 12:36:42 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -7,7 +7,7 @@ #if HAVE_SYS_CDEFS_H #include <sys/cdefs.h> #endif -__RCSID("$NetBSD: perform.c,v 1.26 2009/11/05 16:22:32 joerg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.27 2015/12/27 12:36:42 joerg Exp $"); /* * FreeBSD install - a package for the installation and maintainance @@ -225,12 +225,7 @@ pkg_perform(const char *pkg) write_plist(&plist, stdout, realprefix); retval = TRUE; } else { -#ifdef BOOTSTRAP - warnx("Package building is not supported in bootstrap mode"); - retval = FALSE; -#else retval = pkg_build(pkg, full_pkg, suffix, &plist); -#endif } /* Cleanup */ |