Fix traceback on corrupt zipfile
- Resolves: rhbz#1481005
This commit is contained in:
parent
1e5a20b553
commit
01b45a6147
35
0001-Fix-traceback-on-corrupt-zipfile.patch
Normal file
35
0001-Fix-traceback-on-corrupt-zipfile.patch
Normal file
@ -0,0 +1,35 @@
|
||||
From 0a6c462323557dbd2f2b04dc0a96412643244e35 Mon Sep 17 00:00:00 2001
|
||||
From: Mikolaj Izdebski <mizdebsk@redhat.com>
|
||||
Date: Wed, 16 Aug 2017 15:20:29 +0200
|
||||
Subject: [PATCH] Fix traceback on corrupt zipfile
|
||||
|
||||
Resolves: rhbz#1481005
|
||||
---
|
||||
python/javapackages/common/manifest.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/python/javapackages/common/manifest.py b/python/javapackages/common/manifest.py
|
||||
index 9a27ff87..5a6245b9 100644
|
||||
--- a/python/javapackages/common/manifest.py
|
||||
+++ b/python/javapackages/common/manifest.py
|
||||
@@ -33,7 +33,7 @@
|
||||
# Michal Srb <msrb@redhat.com>
|
||||
|
||||
import zipfile
|
||||
-from zipfile import ZipFile
|
||||
+from zipfile import ZipFile, BadZipfile
|
||||
from javapackages.common.exception import JavaPackagesToolsException
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ class Manifest(object):
|
||||
jarfile = ZipFile(self._path)
|
||||
if "META-INF/MANIFEST.MF" in jarfile.namelist():
|
||||
mf = jarfile.open("META-INF/MANIFEST.MF", "r")
|
||||
- except IOError:
|
||||
+ except (IOError, BadZipfile):
|
||||
pass
|
||||
if mf is None:
|
||||
return None
|
||||
--
|
||||
2.13.5
|
||||
|
@ -20,13 +20,14 @@
|
||||
|
||||
Name: javapackages-tools
|
||||
Version: 5.0.0
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
|
||||
Summary: Macros and scripts for Java packaging support
|
||||
|
||||
License: BSD
|
||||
URL: https://github.com/fedora-java/javapackages
|
||||
Source0: https://github.com/fedora-java/javapackages/archive/%{version}.tar.gz
|
||||
Patch0: 0001-Fix-traceback-on-corrupt-zipfile.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
@ -135,6 +136,8 @@ This package provides non-essential macros and scripts to support Java packaging
|
||||
%prep
|
||||
%setup -q -n javapackages-%{version}
|
||||
|
||||
%patch0 -p1
|
||||
|
||||
%build
|
||||
%configure --pyinterpreter=%{python_interpreter} \
|
||||
--default_jdk=%{default_jdk} --default_jre=%{default_jre} \
|
||||
@ -176,6 +179,10 @@ rm -rf %{buildroot}%{_mandir}/man7/gradle_build.7
|
||||
%license LICENSE
|
||||
|
||||
%changelog
|
||||
* Thu Aug 17 2017 Michael Simacek <msimacek@redhat.com> - 5.0.0-7
|
||||
- Fix traceback on corrupt zipfile
|
||||
- Resolves: rhbz#1481005
|
||||
|
||||
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user