Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 May 2012 13:59:13 -0400
From:      Jason Hellenthal <jhellenthal@dataix.net>
To:        Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no>
Cc:        stable@freebsd.org, ed@freebsd.org, rdivacky@freebsd.org, miwi@freebsd.org
Subject:   Re: /usr/bin/unzip not being installed on 8.3-STABLE
Message-ID:  <20120528175913.GC10333@DataIX.net>
In-Reply-To: <86r4u4b4u4.fsf@ds4.des.no>
References:  <20120526202432.GA265@DataIX.net> <20120528010146.GA40399@DataIX.net> <86r4u4b4u4.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help

--EeQfGwPcQSOJBaQU
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit


Here is the unzip diff from stable/8 -> head

On Mon, May 28, 2012 at 07:20:03PM +0200, Dag-Erling Smørgrav wrote:
> Jason Hellenthal <jhellenthal@dataix.net> writes:
> > Could someone MFC this to stable/8 please...
> 
> Is unzip in stable/8 identical to unzip in head and stable/9?  If not,
> this should be addressed first.  Otherwise, there is a good chance that
> many ports will fail to build.
> 
> DES
> -- 
> Dag-Erling Smørgrav - des@des.no

-- 

 - (2^(N-1))

--EeQfGwPcQSOJBaQU
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment; filename="unzip.diff"
Content-Transfer-Encoding: 8bit

Index: unzip.1
===================================================================
--- unzip.1	(.../stable/8/usr.bin/unzip)	(revision 236186)
+++ unzip.1	(.../head/usr.bin/unzip)	(revision 236186)
@@ -1,5 +1,5 @@
 .\"-
-.\" Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav
+.\" Copyright (c) 2007-2008 Dag-Erling Smørgrav
 .\" All rights reserved.
 .\"
 .\" Redistribution and use in source and binary forms, with or without
@@ -38,7 +38,6 @@
 .Ar zipfile
 .Sh DESCRIPTION
 .\" ...
-.Pp
 The following options are available:
 .Bl -tag -width Fl
 .It Fl a
@@ -121,6 +120,10 @@
 and
 .Fl u
 may be specified.
+If specified filename is
+.Qq - ,
+then data is read from
+.Va stdin .
 .Sh ENVIRONMENT
 If the
 .Ev UNZIP_DEBUG
Index: unzip.c
===================================================================
--- unzip.c	(.../stable/8/usr.bin/unzip)	(revision 236186)
+++ unzip.c	(.../head/usr.bin/unzip)	(revision 236186)
@@ -1,6 +1,6 @@
 /*-
  * Copyright (c) 2009 Joerg Sonnenberger <joerg@NetBSD.org>
- * Copyright (c) 2007-2008 Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 2007-2008 Dag-Erling Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -426,7 +426,7 @@
 		fprintf(stderr,
 		    "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ",
 		    *path);
-		if (fgets(buf, sizeof(buf), stdin) == 0) {
+		if (fgets(buf, sizeof(buf), stdin) == NULL) {
 			clearerr(stdin);
 			printf("NULL\n(EOF or read error, "
 			    "treating as \"[N]one\"...)\n");
@@ -868,10 +868,14 @@
 	int fd, ret;
 	uintmax_t total_size, file_count, error_count;
 
-	if ((fd = open(fn, O_RDONLY)) < 0)
+	if (strcmp(fn, "-") == 0)
+		fd = STDIN_FILENO;
+	else if ((fd = open(fn, O_RDONLY)) < 0)
 		error("%s", fn);
 
-	a = archive_read_new();
+	if ((a = archive_read_new()) == NULL)
+		error("archive_read_new failed");
+
 	ac(archive_read_support_format_zip(a));
 	ac(archive_read_open_fd(a, fd, 8192));
 
@@ -929,7 +933,7 @@
 	ac(archive_read_close(a));
 	(void)archive_read_finish(a);
 
-	if (close(fd) != 0)
+	if (fd != STDIN_FILENO && close(fd) != 0)
 		error("%s", fn);
 
 	if (t_opt) {
Index: Makefile
===================================================================
--- Makefile	(.../stable/8/usr.bin/unzip)	(revision 236186)
+++ Makefile	(.../head/usr.bin/unzip)	(revision 236186)
@@ -1,7 +1,6 @@
 # $FreeBSD$
 
 PROG = unzip
-WARNS ?= 6
 CSTD = c99
 DPADD = ${LIBARCHIVE} ${LIBZ}
 LDADD = -larchive -lz
Index: .
===================================================================
--- .	(.../stable/8/usr.bin/unzip)	(revision 236186)
+++ .	(.../head/usr.bin/unzip)	(revision 236186)

Property changes on: .
___________________________________________________________________
Deleted: svn:mergeinfo
   Reverse-merged /head/sys/usr.bin/unzip:r196863
   Reverse-merged /head/usr.bin/unzip:r196045-201385,201387-207627,207842,207844,208320,212770,213738,213814,216591,223132,223152,223947,224271,224641,227006,227755,228857,230555,234206,235252
   Reverse-merged /vendor/resolver/dist/usr.bin/unzip:r1540-186085
   Reverse-merged /user/luigi/ipfw3-r8/usr.bin/unzip:r204833-205419

--EeQfGwPcQSOJBaQU--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120528175913.GC10333>