pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/49959: Cannot bootstrap due to pkg_install build errors on Linux



>Number:         49959
>Category:       pkg
>Synopsis:       Cannot bootstrap due to pkg_install build errors on Linux
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 10 07:35:00 +0000 2015
>Originator:     Kamil Rytarowski
>Release:        CentOS Linux 7 (Core)
>Organization:
>Environment:
Linux 3.10.0-229.1.2.el7.x86_64 #1 SMP Fri Mar 27 03:04:26 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
>Description:
pkg_install uses deprecated API functions from libarchive.
>How-To-Repeat:
1. Get CentOS 7
2. Get pkgsrc-current
3. Try to boostrap
>Fix:
Patch just tested for building the sources (boostrapping)

Index: pkg_install/files/add/perform.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.106
diff -u -r1.106 perform.c
--- pkg_install/files/add/perform.c	30 Dec 2014 15:13:20 -0000	1.106
+++ pkg_install/files/add/perform.c	8 Jun 2015 09:38:27 -0000
@@ -828,7 +828,7 @@
 	if (!NoRecord)
 		pkgdb_close();
 	archive_write_close(writer);
-	archive_write_finish(writer);
+	archive_write_close(writer);
 
 	return r;
 }
@@ -1547,7 +1547,7 @@
 	free_plist(&pkg->plist);
 	free_meta_data(pkg);
 	if (pkg->archive)
-		archive_read_finish(pkg->archive);
+		archive_read_close(pkg->archive);
 	free(pkg->other_version);
 	free(pkg->pkgname);
 clean_find_archive:
Index: pkg_install/files/admin/main.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/admin/main.c,v
retrieving revision 1.64
diff -u -r1.64 main.c
--- pkg_install/files/admin/main.c	2 Jan 2015 14:26:16 -0000	1.64
+++ pkg_install/files/admin/main.c	8 Jun 2015 09:38:27 -0000
@@ -609,7 +609,7 @@
 				rc = 1;
 			free(archive_name);
 			if (!pkg)
-				archive_read_finish(pkg);
+				archive_read_close(pkg);
 		}
 		return rc;
 	} else if (strcasecmp(argv[0], "x509-sign-package") == 0) {
Index: pkg_install/files/create/build.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/create/build.c,v
retrieving revision 1.16
diff -u -r1.16 build.c
--- pkg_install/files/create/build.c	30 Dec 2014 15:13:20 -0000	1.16
+++ pkg_install/files/create/build.c	8 Jun 2015 09:38:27 -0000
@@ -250,20 +250,20 @@
 	}
 
 	if (strcmp(CompressionType, "bzip2") == 0)
-		archive_write_set_compression_bzip2(archive);
+		archive_write_add_filter_bzip2(archive);
 	else if (strcmp(CompressionType, "gzip") == 0)
-		archive_write_set_compression_gzip(archive);
+		archive_write_add_filter_gzip(archive);
 	else if (strcmp(CompressionType, "xz") == 0)
-		archive_write_set_compression_xz(archive);
+		archive_write_add_filter_xz(archive);
 	else if (strcmp(CompressionType, "none") == 0)
-		archive_write_set_compression_none(archive);
+		archive_write_add_filter_none(archive);
 	else
 		errx(1, "Unspported compression type for -F: %s",
 		    CompressionType);
 
 	archive_name = xasprintf("%s.%s", pkg, suffix);
 
-	if (archive_write_open_file(archive, archive_name))
+	if (archive_write_open_filename(archive, archive_name))
 		errx(2, "cannot create archive: %s", archive_error_string(archive));
 
 	free(archive_name);
@@ -326,7 +326,7 @@
 
 	if (archive_write_close(archive))
 		errx(2, "cannot finish archive: %s", archive_error_string(archive));
-	archive_write_finish(archive);
+	archive_write_close(archive);
 
 	free(initial_cwd);
 }
Index: pkg_install/files/info/perform.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/info/perform.c,v
retrieving revision 1.62
diff -u -r1.62 perform.c
--- pkg_install/files/info/perform.c	30 Dec 2014 15:13:20 -0000	1.62
+++ pkg_install/files/info/perform.c	8 Jun 2015 09:38:27 -0000
@@ -358,7 +358,7 @@
 		free(pkgname);
 
 		meta = read_meta_data_from_archive(archive, entry);
-		archive_read_finish(archive);
+		archive_read_close(archive);
 		if (!IS_URL(pkg))
 			binpkgfile = pkg;
 #endif
Index: pkg_install/files/lib/pkg_io.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/lib/pkg_io.c,v
retrieving revision 1.11
diff -u -r1.11 pkg_io.c
--- pkg_install/files/lib/pkg_io.c	20 Apr 2010 00:39:13 -0000	1.11
+++ pkg_install/files/lib/pkg_io.c	8 Jun 2015 09:38:27 -0000
@@ -146,13 +146,13 @@
 	*archive_name = fetchStringifyURL(url);
 
 	a = archive_read_new();
-	archive_read_support_compression_all(a);
+	archive_read_support_filter_all(a);
 	archive_read_support_format_all(a);
 	if (archive_read_open(a, f, fetch_archive_open, fetch_archive_read,
 	    fetch_archive_close)) {
 		free(*archive_name);
 		*archive_name = NULL;
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 
@@ -169,7 +169,7 @@
 
 	if (!IS_URL(url)) {
 		a = archive_read_new();
-		archive_read_support_compression_all(a);
+		archive_read_support_filter_all(a);
 		archive_read_support_format_all(a);
 		if (archive_read_open_filename(a, url, 1024)) {
 			archive_read_close(a);
Index: pkg_install/files/lib/pkg_signature.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/lib/pkg_signature.c,v
retrieving revision 1.11
diff -u -r1.11 pkg_signature.c
--- pkg_install/files/lib/pkg_signature.c	11 Sep 2013 14:10:05 -0000	1.11
+++ pkg_install/files/lib/pkg_signature.c	8 Jun 2015 09:38:27 -0000
@@ -159,7 +159,7 @@
 {
 	struct signature_archive *state = cookie;
 
-	archive_read_finish(state->archive);
+	archive_read_close(state->archive);
 	free_signature_int(state);
 	return 0;
 }
@@ -330,7 +330,7 @@
 	r = read_file_from_archive(archive_name, *archive, entry, HASH_FNAME,
 	    &hash_file, &hash_len);
 	if (r == -1) {
-		archive_read_finish(*archive);
+		archive_read_close(*archive);
 		*archive = NULL;
 		free(state);
 		goto no_valid_signature;
@@ -345,7 +345,7 @@
 	r = read_file_from_archive(archive_name, *archive, entry, SIGNATURE_FNAME,
 	    &signature_file, &signature_len);
 	if (r == -1) {
-		archive_read_finish(*archive);
+		archive_read_close(*archive);
 		*archive = NULL;
 		free(state);
 		free(hash_file);
@@ -356,7 +356,7 @@
 			    entry, GPG_SIGNATURE_FNAME,
 			    &signature_file, &signature_len);
 		if (r == -1) {
-			archive_read_finish(*archive);
+			archive_read_close(*archive);
 			*archive = NULL;
 			free(state);
 			free(hash_file);
@@ -400,12 +400,12 @@
 	state->archive = *archive;
 
 	a = archive_read_new();
-	archive_read_support_compression_all(a);
+	archive_read_support_filter_all(a);
 	archive_read_support_format_all(a);
 	if (archive_read_open(a, state, NULL, verify_signature_read_cb,
 	    verify_signature_close_cb)) {
 		warnx("Can't open signed package file");
-		archive_read_finish(a);
+		archive_read_close(a);
 		goto no_valid_signature;
 	}
 	*archive = a;
@@ -449,12 +449,12 @@
 	int r;
 
 	a = archive_read_new();
-	archive_read_support_compression_all(a);
+	archive_read_support_filter_all(a);
 	archive_read_support_format_all(a);
 	if (archive_read_open_fd(a, fd, 1024)) {
 		warnx("Cannot open binary package: %s",
 		    archive_error_string(a));
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 
@@ -462,17 +462,17 @@
 	if (r != ARCHIVE_OK) {
 		warnx("Cannot extract package name: %s",
 		    r == ARCHIVE_EOF ? "EOF" : archive_error_string(a));
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 	if (strcmp(archive_entry_pathname(entry), "+CONTENTS") != 0) {
 		warnx("Invalid binary package, doesn't start with +CONTENTS");
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 	if (archive_entry_size(entry) > SSIZE_MAX - 1) {
 		warnx("+CONTENTS too large to process");
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 
@@ -482,12 +482,12 @@
 	if (archive_read_data(a, buf, len) != len) {
 		warnx("Short read when extracing +CONTENTS");
 		free(buf);
-		archive_read_finish(a);
+		archive_read_close(a);
 		return NULL;
 	}
 	buf[len] = '\0';
 
-	archive_read_finish(a);
+	archive_read_close(a);
 
 	parse_plist(&plist, buf);
 	free(buf);
@@ -579,7 +579,7 @@
 	archive_entry_set_size(sign_entry, signature_len);
 
 	pkg = archive_write_new();
-	archive_write_set_compression_none(pkg);
+	archive_write_add_filter_none(pkg);
 	archive_write_set_format_ar_bsd(pkg);
 	archive_write_open_filename(pkg, output);
 
@@ -608,7 +608,7 @@
 	archive_write_finish_entry(pkg);
 	archive_entry_free(entry);
 
-	archive_write_finish(pkg);
+	archive_write_close(pkg);
 
 	close(fd);
 
@@ -673,7 +673,7 @@
 	archive_entry_set_size(sign_entry, signature_len);
 
 	pkg = archive_write_new();
-	archive_write_set_compression_none(pkg);
+	archive_write_add_filter_none(pkg);
 	archive_write_set_format_ar_bsd(pkg);
 	archive_write_open_filename(pkg, output);
 
@@ -702,7 +702,7 @@
 	archive_write_finish_entry(pkg);
 	archive_entry_free(entry);
 
-	archive_write_finish(pkg);
+	archive_write_close(pkg);
 
 	close(fd);
 
Index: pkg_install/files/lib/vulnerabilities-file.c
===================================================================
RCS file: /home/kamil/netbsd-cvs/netbsd/pkgsrc/pkgtools/pkg_install/files/lib/vulnerabilities-file.c,v
retrieving revision 1.7
diff -u -r1.7 vulnerabilities-file.c
--- pkg_install/files/lib/vulnerabilities-file.c	16 Jun 2010 23:02:49 -0000	1.7
+++ pkg_install/files/lib/vulnerabilities-file.c	8 Jun 2015 09:38:27 -0000
@@ -353,7 +353,7 @@
 	if ((a = archive_read_new()) == NULL)
 		errx(EXIT_FAILURE, "memory allocation failed");
 	
-	if (archive_read_support_compression_all(a) != ARCHIVE_OK ||
+	if (archive_read_support_filter_all(a) != ARCHIVE_OK ||
 	    archive_read_support_format_raw(a) != ARCHIVE_OK ||
 	    archive_read_open_memory(a, buf, len) != ARCHIVE_OK)
 		errx(EXIT_FAILURE, "Cannot open pkg_vulnerabilies buffer: %s",
@@ -384,7 +384,7 @@
 	if ((a = archive_read_new()) == NULL)
 		errx(EXIT_FAILURE, "memory allocation failed");
 	
-	if (archive_read_support_compression_all(a) != ARCHIVE_OK ||
+	if (archive_read_support_filter_all(a) != ARCHIVE_OK ||
 	    archive_read_support_format_raw(a) != ARCHIVE_OK ||
 	    archive_read_open_fd(a, fd, 65536) != ARCHIVE_OK)
 		errx(EXIT_FAILURE, "Cannot open ``%s'': %s", path,



Home | Main Index | Thread Index | Old Index