update to 0.11.1
This commit is contained in:
parent
ab6b327820
commit
3b35241c99
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
libzip-0.9.3.tar.bz2
|
||||
/libzip-0.10.tar.bz2
|
||||
/libzip-0.10.1.tar.bz2
|
||||
/libzip-0.11.1.tar.xz
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
diff -up libzip-0.10/lib/zip_close.c.php libzip-0.10/lib/zip_close.c
|
||||
--- libzip-0.10/lib/zip_close.c.php 2011-02-20 09:01:03.000000000 -0500
|
||||
+++ libzip-0.10/lib/zip_close.c 2012-01-25 18:37:04.188136374 -0500
|
||||
@@ -602,13 +602,15 @@ _zip_create_temp_output(struct zip *za,
|
||||
char *temp;
|
||||
int tfd;
|
||||
FILE *tfp;
|
||||
+
|
||||
+ int len = strlen(za->zn) + 8;
|
||||
|
||||
- if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) {
|
||||
+ if ((temp=(char *)malloc(len)) == NULL) {
|
||||
_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- sprintf(temp, "%s.XXXXXX", za->zn);
|
||||
+ snprintf(temp, len, "%s.XXXXXX", za->zn);
|
||||
|
||||
if ((tfd=mkstemp(temp)) == -1) {
|
||||
_zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno);
|
||||
diff -up libzip-0.10/lib/zip_fclose.c.php libzip-0.10/lib/zip_fclose.c
|
||||
--- libzip-0.10/lib/zip_fclose.c.php 2010-03-08 07:27:48.000000000 -0500
|
||||
+++ libzip-0.10/lib/zip_fclose.c 2012-01-25 18:36:22.389542215 -0500
|
||||
@@ -47,12 +47,14 @@ zip_fclose(struct zip_file *zf)
|
||||
if (zf->src)
|
||||
zip_source_free(zf->src);
|
||||
|
||||
- for (i=0; i<zf->za->nfile; i++) {
|
||||
- if (zf->za->file[i] == zf) {
|
||||
- zf->za->file[i] = zf->za->file[zf->za->nfile-1];
|
||||
- zf->za->nfile--;
|
||||
- break;
|
||||
- }
|
||||
+ if (zf->za) {
|
||||
+ for (i=0; i<zf->za->nfile; i++) {
|
||||
+ if (zf->za->file[i] == zf) {
|
||||
+ zf->za->file[i] = zf->za->file[zf->za->nfile-1];
|
||||
+ zf->za->nfile--;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
diff -up libzip-0.10/lib/zip.h.php libzip-0.10/lib/zip.h
|
||||
--- libzip-0.10/lib/zip.h.php 2011-03-04 12:17:43.000000000 -0500
|
||||
+++ libzip-0.10/lib/zip.h 2012-01-25 18:36:22.389542215 -0500
|
||||
@@ -59,7 +59,7 @@ extern "C" {
|
||||
#define ZIP_CREATE 1
|
||||
#define ZIP_EXCL 2
|
||||
#define ZIP_CHECKCONS 4
|
||||
-
|
||||
+#define ZIP_OVERWRITE 8
|
||||
|
||||
/* flags for zip_name_locate, zip_fopen, zip_stat, ... */
|
||||
|
||||
diff -up libzip-0.10/lib/zip_open.c.php libzip-0.10/lib/zip_open.c
|
||||
--- libzip-0.10/lib/zip_open.c.php 2011-03-16 07:18:44.000000000 -0400
|
||||
+++ libzip-0.10/lib/zip_open.c 2012-01-25 18:36:22.389542215 -0500
|
||||
@@ -61,10 +61,16 @@ ZIP_EXTERN struct zip *
|
||||
zip_open(const char *fn, int flags, int *zep)
|
||||
{
|
||||
FILE *fp;
|
||||
+
|
||||
+ if (flags & ZIP_OVERWRITE) {
|
||||
+ return _zip_allocate_new(fn, zep);
|
||||
+ }
|
||||
|
||||
switch (_zip_file_exists(fn, flags, zep)) {
|
||||
case -1:
|
||||
- return NULL;
|
||||
+ if (!(flags & ZIP_OVERWRITE)) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
case 0:
|
||||
return _zip_allocate_new(fn, zep);
|
||||
default:
|
||||
@@ -482,7 +488,7 @@ _zip_file_exists(const char *fn, int fla
|
||||
}
|
||||
|
||||
if (stat(fn, &st) != 0) {
|
||||
- if (flags & ZIP_CREATE)
|
||||
+ if (flags & ZIP_CREATE || flags & ZIP_OVERWRITE)
|
||||
return 0;
|
||||
else {
|
||||
set_error(zep, NULL, ZIP_ER_OPEN);
|
||||
67
libzip-0.11-php.patch
Normal file
67
libzip-0.11-php.patch
Normal file
@ -0,0 +1,67 @@
|
||||
diff -ru libzip-0.11.1.orig/lib/zip_close.c libzip-0.11.1/lib/zip_close.c
|
||||
--- libzip-0.11.1.orig/lib/zip_close.c 2013-08-08 11:01:26.000000000 +0200
|
||||
+++ libzip-0.11.1/lib/zip_close.c 2013-08-08 11:03:07.000000000 +0200
|
||||
@@ -596,18 +596,22 @@
|
||||
FILE *tfp;
|
||||
|
||||
if (za->tempdir) {
|
||||
- if ((temp=(char *)malloc(strlen(za->tempdir)+13)) == NULL) {
|
||||
+ int len = strlen(za->tempdir)+13;
|
||||
+
|
||||
+ if ((temp=(char *)malloc(len)) == NULL) {
|
||||
_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return NULL;
|
||||
}
|
||||
- sprintf(temp, "%s/.zip.XXXXXX", za->tempdir);
|
||||
+ snprintf(temp, len, "%s/.zip.XXXXXX", za->tempdir);
|
||||
}
|
||||
else {
|
||||
- if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) {
|
||||
+ int len = strlen(za->zn)+8;
|
||||
+
|
||||
+ if ((temp=(char *)malloc(len)) == NULL) {
|
||||
_zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return NULL;
|
||||
}
|
||||
- sprintf(temp, "%s.XXXXXX", za->zn);
|
||||
+ snprintf(temp, len, "%s.XXXXXX", za->zn);
|
||||
}
|
||||
|
||||
if ((tfd=mkstemp(temp)) == -1) {
|
||||
diff -ru libzip-0.11.1.orig/lib/zip_fclose.c libzip-0.11.1/lib/zip_fclose.c
|
||||
--- libzip-0.11.1.orig/lib/zip_fclose.c 2013-08-08 11:01:26.000000000 +0200
|
||||
+++ libzip-0.11.1/lib/zip_fclose.c 2013-08-08 11:06:46.000000000 +0200
|
||||
@@ -48,14 +48,15 @@
|
||||
if (zf->src)
|
||||
zip_source_free(zf->src);
|
||||
|
||||
- for (i=0; i<zf->za->nfile; i++) {
|
||||
- if (zf->za->file[i] == zf) {
|
||||
- zf->za->file[i] = zf->za->file[zf->za->nfile-1];
|
||||
- zf->za->nfile--;
|
||||
- break;
|
||||
+ if (zf->za) {
|
||||
+ for (i=0; i<zf->za->nfile; i++) {
|
||||
+ if (zf->za->file[i] == zf) {
|
||||
+ zf->za->file[i] = zf->za->file[zf->za->nfile-1];
|
||||
+ zf->za->nfile--;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
- }
|
||||
-
|
||||
ret = 0;
|
||||
if (zf->error.zip_err)
|
||||
ret = zf->error.zip_err;
|
||||
--- libzip-0.11.1.orig/lib/zip.h 2013-08-08 11:01:26.000000000 +0200
|
||||
+++ libzip-0.11.1/lib/zip.h 2013-08-08 11:19:57.000000000 +0200
|
||||
@@ -62,6 +62,8 @@
|
||||
#define ZIP_EXCL 2
|
||||
#define ZIP_CHECKCONS 4
|
||||
#define ZIP_TRUNCATE 8
|
||||
+/* PHP use this name, same behavior */
|
||||
+#define ZIP_OVERWRITE 8
|
||||
|
||||
|
||||
/* flags for zip_name_locate, zip_fopen, zip_stat, ... */
|
||||
13
libzip.spec
13
libzip.spec
@ -2,13 +2,13 @@
|
||||
%define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9
|
||||
|
||||
Name: libzip
|
||||
Version: 0.10.1
|
||||
Release: 7%{?dist}
|
||||
Version: 0.11.1
|
||||
Release: 1%{?dist}
|
||||
Summary: C library for reading, creating, and modifying zip archives
|
||||
|
||||
License: BSD
|
||||
URL: http://www.nih.at/libzip/index.html
|
||||
Source0: http://www.nih.at/libzip/libzip-%{version}.tar.bz2
|
||||
Source0: http://www.nih.at/libzip/libzip-%{version}.tar.xz
|
||||
|
||||
#BuildRequires: automake libtool
|
||||
BuildRequires: zlib-devel
|
||||
@ -17,7 +17,7 @@ BuildRequires: zlib-devel
|
||||
Source1: zipconf.h
|
||||
|
||||
# fonctionnal changes from php bundled library
|
||||
Patch0: libzip-0.10-php.patch
|
||||
Patch0: libzip-0.11-php.patch
|
||||
|
||||
|
||||
%description
|
||||
@ -94,6 +94,9 @@ ln -s ../%{_lib}/libzip/include/zipconf.h \
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Aug 21 2013 Remi Collet <remi@fedoraproject.org> - 0.11.1-1
|
||||
- update to 0.11.1
|
||||
|
||||
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
@ -154,7 +157,7 @@ ln -s ../%{_lib}/libzip/include/zipconf.h \
|
||||
* Fri Jan 11 2008 Rex Dieter <rdieter[AT]fedoraproject.org> 0.8-4
|
||||
- use better workaround for removing rpaths
|
||||
|
||||
* Wed Nov 20 2007 Sebastian Vahl <fedora@deadbabylon.de> 0.8-3
|
||||
* Tue Nov 20 2007 Sebastian Vahl <fedora@deadbabylon.de> 0.8-3
|
||||
- require pkgconfig in devel subpkg
|
||||
- move api description to devel subpkg
|
||||
- keep timestamps in %%install
|
||||
|
||||
Loading…
Reference in New Issue
Block a user