Update to 0.26.0

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2017-07-08 18:38:46 +02:00
parent 75eb6da501
commit a481a7e251
4 changed files with 7 additions and 76 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@
/pygit2-0.24.2.tar.gz
/pygit2-0.25.0.tar.gz
/pygit2-0.25.1.tar.gz
/pygit2-0.26.0.tar.gz

View File

@ -1,71 +0,0 @@
From b88dc868423af2f760f649960112efd0e37e5335 Mon Sep 17 00:00:00 2001
From: Lukas Fleischer <lfleischer@lfos.de>
Date: Sat, 6 May 2017 21:39:33 +0200
Subject: [PATCH] Fix parameter passing of describe patterns
When ffi.new() is used to build a new pointer object, the returned
pointer object has ownership on the allocated memory. When it is
garbage-collected, then the memory is freed. Thus, we need to make sure
the original object survives its use, otherwise the casted pointer will
point to garbage.
This fixes one test which was failing with the latest CFFI version, see
issue #694. Thus, this commit also reverts 803b1cb (cffi 1.10 not yet
supported, 2017-03-22) where the latest CFFI version was marked as
unsupported.
Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>
---
.travis.yml | 2 +-
pygit2/repository.py | 6 +++++-
setup.py | 4 ++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 22aadd5..72f8f1b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,7 +14,7 @@ env: LIBGIT2=~/libgit2/_install/ LD_LIBRARY_PATH=~/libgit2/_install/lib
before_install:
- sudo apt-get install cmake
- - pip install cffi==1.9.1
+ - pip install cffi
- "./.travis.sh"
script:
diff --git a/pygit2/repository.py b/pygit2/repository.py
index 9377aa2..472f4ff 100644
--- a/pygit2/repository.py
+++ b/pygit2/repository.py
@@ -692,7 +692,11 @@ class BaseRepository(_Repository):
if describe_strategy is not None:
options.describe_strategy = describe_strategy
if pattern:
- options.pattern = ffi.new('char[]', to_bytes(pattern))
+ # The returned pointer object has ownership on the allocated
+ # memory. Make sure it is kept alive until git_describe_commit() or
+ # git_describe_workdir() are called below.
+ pattern_char = ffi.new('char[]', to_bytes(pattern))
+ options.pattern = pattern_char
if only_follow_first_parent is not None:
options.only_follow_first_parent = only_follow_first_parent
if show_commit_oid_as_fallback is not None:
diff --git a/setup.py b/setup.py
index f4a9f8c..18d3eb0 100644
--- a/setup.py
+++ b/setup.py
@@ -203,8 +203,8 @@ setup(name='pygit2',
long_description=long_description,
packages=['pygit2'],
package_data={'pygit2': ['decl.h']},
- setup_requires=['cffi<1.10'],
- install_requires=['cffi<1.10', 'six'],
+ setup_requires=['cffi'],
+ install_requires=['cffi', 'six'],
zip_safe=False,
cmdclass=cmdclass,
**extra_args)
--
2.12.2

View File

@ -1,8 +1,8 @@
%global pkgname pygit2
Name: python-%{pkgname}
Version: 0.25.1
Release: 2%{?dist}
Version: 0.26.0
Release: 1%{?dist}
Summary: Python bindings for libgit2
License: GPLv2 with linking exception
@ -10,8 +10,6 @@ URL: http://www.pygit2.org
Source0: https://github.com/libgit2/%{pkgname}/archive/v%{version}/%{pkgname}-%{version}.tar.gz
Patch0: 0001-Remove-remote-calling-unit-tests.patch
# Fix the build with cffi 1.10. Backported from upstream.
Patch1: 0001-Fix-parameter-passing-of-describe-patterns.patch
BuildRequires: libgit2-devel
BuildRequires: openssl-devel
@ -102,6 +100,9 @@ find %{buildroot} -name '*.so' -exec chmod 755 {} ';'
%doc docs/_build/html/*
%changelog
* Sat Jul 08 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.26.0-1
- Update to 0.26.0
* Sun May 07 2017 Pete Walter <pwalter@fedoraproject.org> - 0.25.1-2
- Fix the build with cffi 1.10

View File

@ -1 +1 @@
SHA512 (pygit2-0.25.1.tar.gz) = bb98786ee10d00822a9d61617052ee58dbd2ea5285a30cb13ea1c0ada5827ce11a66368f70ae2201c817f93fbbc596a781b74421b09735fbeaeb1a05f5bd5d4d
SHA512 (pygit2-0.26.0.tar.gz) = 97807c2128212b64c0f3482d50676e1ea2424c8e049d9904e547079df84e999ce3e29c7f512bf71b4e6fa5ff62965ac7fc0a34193c17f0b6b72d083102b236cf