unzip: update to latest beta and fix attributes extraction.

The same problem seems to be present in the patches to unzip 6.0.

The fix to the attribute writing is trivial (see the patchset for
details).

Really fixes #2075.
This commit is contained in:
Adrien Destugues
2018-01-07 11:11:22 +01:00
parent c006e6ddf2
commit 4a6698c36b
2 changed files with 101 additions and 5 deletions

View File

@@ -0,0 +1,96 @@
From 94b89957e5960a284dba79386f39fb64df61c849 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 7 Jan 2018 10:40:16 +0100
Subject: Fix BeOS makefile (not really maintained by upstream)
* Fix installation dir for binaries and docs
* Define UNICODE_SUPPORT
* Fix source dir for docs and manpages
diff --git a/beos/Makefile b/beos/Makefile
index 9e86a3d..102d847 100644
--- a/beos/Makefile
+++ b/beos/Makefile
@@ -91,18 +91,18 @@ UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
INSTALL = install
# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
manext = 1
-prefix = /boot/home/config
-BINDIR = $(prefix)/bin# where to install executables
-MANDIR = $(prefix)/man/man$(manext)# where to install man pages
+prefix ?= /boot/home/config
+BINDIR ?= $(prefix)/bin# where to install executables
+MANDIR ?= $(prefix)/man# where to install man pages
INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/zipinfo$E $(BINDIR)/unzipsfx$E \
$(BINDIR)/unzip$E
-INSTALLEDMAN = $(MANDIR)/unzip.$(manext) $(MANDIR)/funzip.$(manext) \
- $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipinfo.$(manext)
+INSTALLEDMAN = $(MANDIR)/man1/unzip.$(manext) $(MANDIR)/man1/funzip.$(manext) \
+ $(MANDIR)/man1/unzipsfx.$(manext) $(MANDIR)/man1/zipinfo.$(manext)
#
UNZIPS = unzip$E funzip$E unzipsfx$E zipinfo$E
# this is a little ugly...well, no, it's a lot ugly:
-MANS = man/unzip.1 man/unzipsfx.1 man/zipinfo.1 man/funzip.1 man/zipgrep.1
-DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt zipgrep.txt
+MANS = man/man1/unzip.1 man/man1/unzipsfx.1 man/man1/zipinfo.1 man/man1/funzip.1 man/man1/zipgrep.1
+DOCS = docs/unzip.txt docs/unzipsfx.txt docs/zipinfo.txt docs/funzip.txt docs/zipgrep.txt
######################################################################
# Things that change:
@@ -371,11 +371,11 @@ install: all
$(LN) unzip$E $(BINDIR)/zipinfo$E
$(RM) $(BINDIR)/zipgrep$E
$(INSTALL) -m 755 unix/zipgrep $(BINDIR)/zipgrep$E
- $(INSTALL) -m 644 man/unzip.1 $(MANDIR)/unzip.$(manext)
- $(INSTALL) -m 644 man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
- $(INSTALL) -m 644 man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
- $(INSTALL) -m 644 man/funzip.1 $(MANDIR)/funzip.$(manext)
- $(INSTALL) -m 644 man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)
+ $(INSTALL) -m 644 man/man1/unzip.1 $(MANDIR)/man1/unzip.$(manext)
+ $(INSTALL) -m 644 man/man1/unzipsfx.1 $(MANDIR)/man1/unzipsfx.$(manext)
+ $(INSTALL) -m 644 man/man1/zipinfo.1 $(MANDIR)/man1/zipinfo.$(manext)
+ $(INSTALL) -m 644 man/man1/funzip.1 $(MANDIR)/man1/funzip.$(manext)
+ $(INSTALL) -m 644 man/man1/zipgrep.1 $(MANDIR)/man1/zipgrep.$(manext)
$(INSTALL) -m 644 $(DOCS) $(MANDIR)
# alternatively, could use zip method: -cd $(BINDIR); rm -f $(UNZIPS) [etc.]
diff --git a/beos/beocfg.h b/beos/beocfg.h
index b6b6cf9..73764e0 100644
--- a/beos/beocfg.h
+++ b/beos/beocfg.h
@@ -69,6 +69,7 @@
/* ISO/OEM (iconv) character conversion. */
+#define UNICODE_SUPPORT
#define ICONV_MAPPING /* part of vanilla Haiku distribution */
#ifdef ICONV_MAPPING
--
2.15.0
From 1e9782a77b2f5b070df6e89da2a21c272ffc72ea Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 7 Jan 2018 11:09:04 +0100
Subject: Fix writing directory attributes
It is not allowed to open a directory in write mode.
Fortunately, fs_write_attr accepts a read-only file descriptor.
diff --git a/beos/beos.c b/beos/beos.c
index ecdc2c8..1f03710 100644
--- a/beos/beos.c
+++ b/beos/beos.c
@@ -1349,7 +1349,7 @@ static int set_file_attrs( const char *name,
ptr = (unsigned char *)attr_buff;
guard = ptr + attr_size;
- fd = open(name, O_RDWR | O_NOTRAVERSE);
+ fd = open(name, O_RDONLY | O_NOTRAVERSE);
if (fd < 0) {
return errno; /* should it be -fd ? */
}
--
2.15.0

View File

@@ -6,12 +6,12 @@ HOMEPAGE="http://www.info-zip.org/UnZip.html"
COPYRIGHT="1995-2014 Greg Roelofs" COPYRIGHT="1995-2014 Greg Roelofs"
LICENSE="Info-ZIP" LICENSE="Info-ZIP"
REVISION="1" REVISION="1"
SOURCE_URI="http://antinode.info/ftp/info-zip/unzip610c11.zip" SOURCE_URI="http://antinode.info/ftp/info-zip/unzip610c23.zip"
CHECKSUM_SHA256="13d92580d89e7c4199ba9a883957cc3676f0235dcac6f701f8f951b015c8d4c8" SOURCE_DIR="unzip610c23"
SOURCE_DIR="unzip610c11" CHECKSUM_SHA256="a9c3f0b4377aa593a77574e2fb69aeab97e66e93d8b110797f7b329e09848b62"
PATCHES="unzip-$portVersion.patchset" PATCHES="unzip-6.10c23.patchset"
ARCHITECTURES="!x86_gcc2" ARCHITECTURES="x86_gcc2"
PROVIDES=" PROVIDES="
unzip = $portVersion unzip = $portVersion