SET(PACKAGE_NAME ${PACKAGE})
SET(PACKAGE_VERSION_MAJOR "1")
SET(PACKAGE_VERSION_MINOR "1")
-SET(PACKAGE_VERSION_PATCH "1")
-SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
-#SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
+SET(PACKAGE_VERSION_PATCH "2")
+#SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}")
+SET(VERSION "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}.${PACKAGE_VERSION_PATCH}")
SET(PACKAGE_VERSION ${VERSION})
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/libzip-uninstalled.pc.in $(srcdir)/libzip.pc.in \
- AUTHORS INSTALL NEWS README THANKS TODO compile config.guess \
- config.sub depcomp install-sh ltmain.sh missing
+ AUTHORS INSTALL NEWS THANKS compile config.guess config.sub \
+ depcomp install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
+1.1.2 [2016/02/19]
+
+* Improve support for 3MF files
+
1.1.1 [2016/02/07]
* Build fixes for Linux
+++ /dev/null
- This is libzip, a C library for reading, creating, and modifying zip
-archives. Files can be added from data buffers, files, or compressed
-data copied directly from other zip archives. Changes made without
-closing the archive can be reverted. The API is documented by man
-pages.
-
- For more information, take a look at the included man pages. You
-can start with libzip(3), which lists all others. Example source code
-is in the src/ subdirectory.
-
- If you have developed an application using libzip, you can find out
-about API changes and how to adapt your code for them in the included
-file API-CHANGES.
-
- For generic installation instructions, see file 'INSTALL', which
-describes the approach using autoconf; alternatively, you can
-use cmake to build.
-
- Additionally, you'll need zlib (at least version 1.1.2). It comes
-with most operating systems nowadays, or you can get it at
- http://www.zlib.net/
-
- When using a static Windows library, you need to define ZIP_STATIC
-when compiling packages using libzip.
-
- If you make a binary distribution, please include a pointer to the
-distribution site:
- http://www.nih.at/libzip/
- ftp.nih.at /pub/nih/libzip
-The latest version can always be found there.
-
- There is a mailing list for developers using libzip. You can
-subscribe to it by sending a mail with the subject "subscribe
-libzip-discuss" to minimalist at nih.at. List mail should be sent
-to libzip-discuss at nih.at. Use this for bug reports or questions.
-
- If you want to reach the authors in private, use <libzip@nih.at>.
Timo Warns <warns@pre-sense.de>
Tom Callaway <tcallawa@redhat.com>
Tomas Hoger <thoger@redhat.com>
+Torsten Paul <Torsten.Paul@gmx.de>
Vassili Courzakis <vcoxvco@googlemail.com>
Wojciech Michalski <wmichalski@quay.pl>
Wolfgang Glunz <Wolfgang.Glunz@gmx.de>
+++ /dev/null
-API Plans
-=========
-
-Encryption
-----------
-* struct zip *zip_open_encrypted(const char *path, int flags, const char *password, int *errorp);
-* int zip_set_encryption(struct zip *archive, zip_uint64_t idx, zip_uint16_t method, const char *password);
-* void zip_set_archive_encryption(struct zip *archive, zip_uint16_t method, const char *password);
-
-Prefixes
---------
-For example for adding extractors for self-extracting zip archives.
-* zip_set_archive_prefix(struct zip *za, const zip_uint8_t *data, zip_uint64_t length);
-* const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp);
-
-Progress Callback
------------------
-Register callback; will be called from zip_close() after each file has been processed.
-typedef void (*zip_progress_callback_t)(double);
-void zip_register_progress_callback(zip_t *, zip_progress_callback_t);
-
-API Issues
-==========
-! D zip_get_archive_comment has int *lenp argument. Cleaner would be zip_uint32_t *.
- rename and fix. which other functions for naming consistency?
-! D rename remaining zip_XXX_{file,archive}_* to zip_{file,archive}_XXX_*?
-* compression/crypt implementations: how to set error code on failure
-* compression/crypt error messages a la ZIP_ER_ZLIB (no detailed info passing)
-* check arguments for every entry point into libzip
-
-
-Features
-========
-* support setting extra fields from zip_source
- . introduce layers of extra fields:
- . original
- . from zip_source
- . manually set
- . when querying extra fields, search all of them in reverse order
- . add whiteout (deleted) flag
- . allow invalid data flag, used when computing extra field size before writing data
- . new command ZIP_SOURCE_EXTRA_FIELDS
- . no support for multiple copies of same extra field
-* delete all extra fields during zip_replace()
-* function to copy file from one archive to another
-* set O_CLOEXEC flag after fopen and mkstemp
-* configure: use windows backends on windows
-* add append-only mode writing file to disk incrementally to keep memory usage low
-* zip_file_set_mtime: support InfoZIP time stamps
-
-* support streaming output (creating new archive to e.g. stdout)
-* add functions to:
- . read/set ASCII file flag? (wiz: more general options?)
-* zip_commit (to finish changes without closing archive)
-* add custom compression function support
-* zip_fseek
-* zip_source_zip: allow rewinding
-* zipcmp: add option for file content comparison
-* zipcmp: compare bit flags if paranoid
-* zipcmp: compare external attributes/opsys if paranoid
-* zipcmp: compare last_mod if paranoid (or with separate flag?)
-* consistency
- . for stored files, test compressed = uncompressed
- . data descriptor
- . local headers come before central dir
-
-* support for old compression methods?????
-
-
-Bugs
-====
-* support InfoZIP encryption header extension (copy data descriptor for encrypted files)
-! ensure that nentries is small enough not to cause overflow (size_t for entry, uint64 for CD on disk)
-* fix OpenSUSE i686 regression failures
-* fix open_filename_duplicate_consistency.test to fail
-* check for limits imposed by format (central dir size, file size, extra fields, ...)
-* _zip_u2d_time: handle localtime(3) failure
-* POSIX: zip_open: check whether file can be created and fail if not
-* fix inconsistent usage of valid flags (not checked in many places)
-* cdr == NULL -> ER_NOENT vs. idx > cdir->nentry -> ER_INVAL inconsistent (still there?)
-
-
-Cleanup
-=======
-* use bool
-* use ZIP_SOURCE_SUPPORTS_{READABLE,SEEKABLE,WRITABLE}
-* use zip_source_seek_compute_offset
-* move compat refs from zipint.h to own file, and include that in zipint.h and src
-* get rid of zip_get_{compression,encryption}_implementation
-* use zip_*int*_t internally
-
-
-Analysis
-========
-* pass through coverity
-
-
-Infrastructure
-==============
-* create CMakefile.txt man page linking from links file
-
-
-Test Case Issues
-================
-* unchange on added file
-* test seek in zip_source_crc
-* test cases for set_extra*, delete_extra*, *extra_field*
-* test cases for in memory archives
- add
- delete
- delete all
- modify
-* use gcov output to increase test coverage
-* merge most tools into modify
-* add test case to change values for newly added files (name, compression method, comment, mtime, . . .)
-* zip_open file less than EOCDLEN bytes long
-* test calls against old API
-* run regression tests also from CMake framework
-* rename file to dir/ and vice versa (fails)
-* fix comment test to be newline insensitive
-* check if http://bugs.python.org/issue20078 provides ideas for new tests
-
-* (add, replace)
- add to empty zip
- add to existing zip
- add w/ existing file name [E]
- replace ok
- replace w/ illegal index [E]
- replace w/ deleted name [E]
- unchange added/replaced file
-* (close)
- copy zip file
- open copy
- rename, delete, replace, add w/ new name, add w/ deleted name
- close
- zipcmp copy expected
- remove copy
-* (error_get)
-* (error_get_sys_type)
-* (error_to_str)
-* (extra_fields)
-* (file_error_get)
-* (file_strerror)
-* (replace)
-* (source_buffer)
-* (source_file)
-* (source_filep)
-* (source_free)
-* (source_function)
-* (source_zip)
-* (strerror)
-* (unchange)
-* (unchange_all)
-* open(ZIP_RDONLY)
-* I/O abstraction layer
- zip_open_from_source
-* read two zip entries interleaved
-
-
-Unsorted
-========
-* zip_source_file: don't allow write if start/len specify a part of the file
-* script to check if all exported symbols are marked with ZIP_EXTERN, add to make distcheck
-
-D re-implement fix for OS X sandboxing (zip_archive_set_tempdir).
-
-* document: zip_source_write: length can't be > ZIP_INT64_MAX
-* document: ZIP_SOURCE_CLOSE implementation can't return error
-* keep error codes in man pages in sync
-* document error codes in new man pages
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libzip 1.1.1.
+# Generated by GNU Autoconf 2.69 for libzip 1.1.2.
#
# Report bugs to <libzip@nih.at>.
#
# Identity of this package.
PACKAGE_NAME='libzip'
PACKAGE_TARNAME='libzip'
-PACKAGE_VERSION='1.1.1'
-PACKAGE_STRING='libzip 1.1.1'
+PACKAGE_VERSION='1.1.2'
+PACKAGE_STRING='libzip 1.1.2'
PACKAGE_BUGREPORT='libzip@nih.at'
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libzip 1.1.1 to adapt to many kinds of systems.
+\`configure' configures libzip 1.1.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libzip 1.1.1:";;
+ short | recursive ) echo "Configuration of libzip 1.1.2:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libzip configure 1.1.1
+libzip configure 1.1.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libzip $as_me 1.1.1, which was
+It was created by libzip $as_me 1.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='libzip'
- VERSION='1.1.1'
+ VERSION='1.1.2'
cat >>confdefs.h <<_ACEOF
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libzip $as_me 1.1.1, which was
+This file was extended by libzip $as_me 1.1.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libzip config.status 1.1.1
+libzip config.status 1.1.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
AC_PREREQ([2.60])
-AC_INIT([libzip],[1.1.1],[libzip@nih.at])
+AC_INIT([libzip],[1.1.2],[libzip@nih.at])
AC_CONFIG_SRCDIR([lib/zip_add.c])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
return NULL;
}
- if (_zip_buffer_get_32(buffer) != 0) {
- zip_error_set(error, ZIP_ER_MULTIDISK, 0);
- return NULL;
- }
-
if (eocd_offset >= EOCD64LOCLEN && memcmp(_zip_buffer_data(buffer) + eocd_offset - EOCD64LOCLEN, EOCD64LOC_MAGIC, 4) == 0) {
_zip_buffer_set_offset(buffer, eocd_offset - EOCD64LOCLEN);
cd = _zip_read_eocd64(za->src, buffer, buf_offset, za->flags, error);
}
-static zip_cdir_t *_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error)
+static zip_cdir_t *
+_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error)
{
zip_cdir_t *cd;
zip_uint64_t i, nentry, size, offset, eocd_offset;
eocd_offset = _zip_buffer_offset(buffer);
- _zip_buffer_get(buffer, 8); /* magic and number of disks already verified */
+ _zip_buffer_get(buffer, 4); /* magic already verified */
+
+ if (_zip_buffer_get_32(buffer) != 0) {
+ zip_error_set(error, ZIP_ER_MULTIDISK, 0);
+ return NULL;
+ }
/* number of cdir-entries on this disk */
i = _zip_buffer_get_16(buffer);
zip_uint64_t eocd_offset;
zip_uint64_t size, nentry, i, eocdloc_offset;
bool free_buffer;
+ zip_uint32_t num_disks, num_disks64, eocd_disk, eocd_disk64;
eocdloc_offset = _zip_buffer_offset(buffer);
- _zip_buffer_get(buffer, 8); /* magic and single disk already verified */
+ _zip_buffer_get(buffer, 4); /* magic already verified */
+
+ num_disks = _zip_buffer_get_16(buffer);
+ eocd_disk = _zip_buffer_get_16(buffer);
eocd_offset = _zip_buffer_get_64(buffer);
if (eocd_offset > ZIP_INT64_MAX || eocd_offset + EOCD64LEN < eocd_offset) {
return NULL;
}
- _zip_buffer_get(buffer, 12); /* skip version made by/needed and num disks */
-
+ _zip_buffer_get(buffer, 4); /* skip version made by/needed */
+
+ num_disks64 = _zip_buffer_get_32(buffer);
+ eocd_disk64 = _zip_buffer_get_32(buffer);
+
+ /* if eocd values are 0xffff, we have to use eocd64 values.
+ otherwise, if the values are not the same, it's inconsistent;
+ in any case, if the value is not 0, we don't support it */
+ if (num_disks == 0xffff) {
+ num_disks = num_disks64;
+ }
+ if (eocd_disk == 0xffff) {
+ eocd_disk = eocd_disk64;
+ }
+ if ((flags & ZIP_CHECKCONS) && (eocd_disk != eocd_disk64 || num_disks != num_disks64)) {
+ zip_error_set(error, ZIP_ER_INCONS, 0);
+ return NULL;
+ }
+ if (num_disks != 0 || eocd_disk != 0) {
+ zip_error_set(error, ZIP_ER_MULTIDISK, 0);
+ return NULL;
+ }
+
nentry = _zip_buffer_get_64(buffer);
i = _zip_buffer_get_64(buffer);
open_filename_empty.test
open_incons.test
open_many_ok.test
+ open_multidisk.test
open_new_but_exists.test
open_new_ok.test
open_nonarchive.test
open_ok.test
open_too_short.test
open_truncate.test
+ open_zip64_3mf.test
open_zip64_ok.test
rename_ascii.test
rename_cp437.test
incons-local-size-larger.zip \
large-uncompressable \
manyfiles-zip.zip \
+ multidisk.zip \
rename_ok.zip \
streamed.zip \
streamed-zip64.zip \
utf-8-standardization-input.zip \
utf-8-standardization-output.zip \
zip-in-archive-comment.zip \
- zip64.zip
+ zip64.zip \
+ zip64-3mf.zip
TESTS_ENVIRONMENT= ZIPCMP=${top_builddir}/src/zipcmp
# ${srcdir}/runtest
open_filename_empty.test \
open_incons.test \
open_many_ok.test \
+ open_multidisk.test \
open_new_but_exists.test \
open_new_ok.test \
open_nonarchive.test \
open_ok.test \
open_too_short.test \
open_truncate.test \
+ open_zip64_3mf.test \
open_zip64_ok.test \
rename_ascii.test \
rename_cp437.test \
incons-local-size-larger.zip \
large-uncompressable \
manyfiles-zip.zip \
+ multidisk.zip \
rename_ok.zip \
streamed.zip \
streamed-zip64.zip \
utf-8-standardization-input.zip \
utf-8-standardization-output.zip \
zip-in-archive-comment.zip \
- zip64.zip
+ zip64.zip \
+ zip64-3mf.zip
TESTS_ENVIRONMENT = ZIPCMP=${top_builddir}/src/zipcmp
# ${srcdir}/runtest
open_filename_empty.test \
open_incons.test \
open_many_ok.test \
+ open_multidisk.test \
open_new_but_exists.test \
open_new_ok.test \
open_nonarchive.test \
open_ok.test \
open_too_short.test \
open_truncate.test \
+ open_zip64_3mf.test \
open_zip64_ok.test \
rename_ascii.test \
rename_cp437.test \
use Cwd;
use File::Copy;
use File::Path qw(mkpath remove_tree);
+use Getopt::Long qw(:config posix_default bundling no_ignore_case);
use IPC::Open3;
use Symbol 'gensym';
use UNIVERSAL;
use Data::Dumper qw(Dumper);
# NiHTest -- package to run regression tests
-# Copyright (C) 2002-2015 Dieter Baron and Thomas Klausner
+# Copyright (C) 2002-2016 Dieter Baron and Thomas Klausner
#
# This file is part of ckmame, a program to check rom sets for MAME.
# The authors can be contacted at <ckmame@nih.at>
sub setup {
my ($self, @argv) = @_;
-
- if (scalar(@argv) != 1) {
- print STDERR "Usage: $0 testcase\n";
+
+ my @save_argv = @ARGV;
+ @ARGV = @argv;
+ my $ok = GetOptions(
+ 'help|h' => \my $help,
+ 'keep-broken' => \$self->{keep_broken},
+ 'no-cleanup' => \$self->{no_cleanup},
+ # 'run-gdb' => \$self->{run_gdb},
+ 'setup-only' => \$self->{setup_only},
+ 'verbose|v' => \$self->{verbose}
+ );
+ @argv = @ARGV;
+ @ARGV = @save_argv;
+
+ if (!$ok || scalar(@argv) != 1 || $help) {
+ print STDERR "Usage: $0 [-hv] [--keep-broken] [--no-cleanup] [--setup-only] testcase\n";
exit(1);
}
-
+
my $testcase = shift @argv;
$testcase .= '.test' unless ($testcase =~ m/\.test$/);
$self->die("error in test case definition") unless $self->parse_case($testcase_file);
$self->check_features_requirement() if ($self->{test}->{features});
+
+ $self->end_test('SKIP') if ($self->{test}->{preload} && $^O eq 'darwin');
}
return $ok;
}
+
sub compare_files() {
my ($self) = @_;
}
my @types = split /\s+/, $type;
my @strs = split /\s+/, $str;
-
- if (!$ellipsis && scalar(@types) != scalar(@strs)) {
- $self->warn_file_line("expected " . (scalar(@types)) . " arguments, got " . (scalar(@strs)));
+ my $optional = 0;
+ for (my $i = scalar(@types) - 1; $i >= 0; $i--) {
+ last unless ($types[$i] =~ m/(.*)\?$/);
+ $types[$i] = $1;
+ $optional++;
+ }
+
+ if ($ellipsis && $optional > 0) {
+ # TODO: check this when registering a directive
+ $self->warn_file_line("can't use ellipsis together with optional arguments");
+ return undef;
+ }
+ if (!$ellipsis && (scalar(@strs) < scalar(@types) - $optional || scalar(@strs) > scalar(@types))) {
+ my $expected = scalar(@types);
+ if ($optional > 0) {
+ $expected = ($expected - $optional) . "-$expected";
+ }
+ $self->warn_file_line("expected $expected arguments, got " . (scalar(@strs)));
return undef;
}
}
my $args = $self->parse_args($def->{type}, $argstring);
-
- if (!defined($args)) {
+
+ unless (defined($args)) {
$ok = 0;
next;
}
return $ok;
}
+sub backslash_decode {
-sub backslash_decode {
my ($str) = @_;
if ($str =~ m/\\/) {
sub run_program {
my ($self) = @_;
-
goto &pipein_win32 if $^O eq 'MSWin32' && $self->{test}->{pipein};
-
my ($stdin, $stdout, $stderr);
$stderr = gensym;
--- /dev/null
+# zip_open: file is part of a multi-disk zip archive
+program tryopen
+args test.piz
+return 1
+file test.piz multidisk.zip multidisk.zip
+stdout opening 'test.piz' returned error 1
+stderr 1 errors
--- /dev/null
+# zip_open: ZIP64 file opens fine even when most eocd entries are 0xff (3MF format)
+program tryopen
+args test.zip
+return 0
+file test.zip zip64-3mf.zip zip64-3mf.zip
+stdout opening 'test.zip' succeeded, 1 entries