[gtk-gnutella] update to 0.97.1
Dmitry Butskoy
buc at fedoraproject.org
Fri Dec 2 13:10:41 UTC 2011
commit cf726a40ae3dc7d51240d11d0fddddba9f9a5187
Author: Dmitry Butskoy <Dmitry at Butskoy.name>
Date: Fri Dec 2 17:10:24 2011 +0400
update to 0.97.1
gtk-gnutella-0.97.1-fileindex.patch | 53 +++++++++++++++++++++++++++++++++++
gtk-gnutella.spec | 24 ++++++++--------
2 files changed, 65 insertions(+), 12 deletions(-)
---
diff --git a/gtk-gnutella-0.97.1-fileindex.patch b/gtk-gnutella-0.97.1-fileindex.patch
new file mode 100644
index 0000000..d52cdd1
--- /dev/null
+++ b/gtk-gnutella-0.97.1-fileindex.patch
@@ -0,0 +1,53 @@
+diff -Nrbu gtk-gnutella-0.97.1/src/core/matching.c gtk-gnutella-0.97.1-OK/src/core/matching.c
+--- gtk-gnutella-0.97.1/src/core/matching.c 2011-09-11 18:28:24.000000000 +0400
++++ gtk-gnutella-0.97.1-OK/src/core/matching.c 2011-12-02 16:32:30.000000000 +0400
+@@ -700,6 +700,9 @@
+
+ sf = e->sf;
+
++ if (!shared_file_is_shareable(sf))
++ continue; /* Cannot be shared */
++
+ canonic_len = shared_file_name_canonic_len(sf);
+ if (canonic_len < minlen)
+ continue; /* Can't match */
+diff -Nrbu gtk-gnutella-0.97.1/src/core/share.c gtk-gnutella-0.97.1-OK/src/core/share.c
+--- gtk-gnutella-0.97.1/src/core/share.c 2011-09-11 18:28:26.000000000 +0400
++++ gtk-gnutella-0.97.1-OK/src/core/share.c 2011-12-02 16:36:47.000000000 +0400
+@@ -2460,6 +2460,25 @@
+ return NULL != sf->fi;
+ }
+
++gboolean
++shared_file_is_shareable(const shared_file_t *sf)
++{
++ shared_file_check(sf);
++
++ /*
++ * A zeroed file_index indicates we called shared_file_deindex(),
++ * most probably through shared_file_remove().
++ *
++ * We don't want to include this file in query hits even though the
++ * file entry happens to be still listed in search bins (for instance
++ * because it was removed dynamically as we discovered it was spam).
++ *
++ * Thanks to Dmitry Butskoy for investigating this corner case.
++ */
++
++ return sf->file_index != 0;
++}
++
+ filesize_t
+ shared_file_size(const shared_file_t *sf)
+ {
+diff -Nrbu gtk-gnutella-0.97.1/src/core/share.h gtk-gnutella-0.97.1-OK/src/core/share.h
+--- gtk-gnutella-0.97.1/src/core/share.h 2011-09-11 18:28:26.000000000 +0400
++++ gtk-gnutella-0.97.1-OK/src/core/share.h 2011-12-02 16:37:42.000000000 +0400
+@@ -112,6 +112,7 @@
+ gboolean sha1_hash_is_uptodate(shared_file_t *sf);
+ gboolean shared_file_is_partial(const shared_file_t *sf);
+ gboolean shared_file_is_finished(const shared_file_t *sf);
++gboolean shared_file_is_shareable(const shared_file_t *sf);
+ filesize_t shared_file_size(const shared_file_t *sf);
+ guint32 shared_file_index(const shared_file_t *sf);
+ time_t shared_file_modification_time(const shared_file_t *sf);
diff --git a/gtk-gnutella.spec b/gtk-gnutella.spec
index 7326b22..f7f143a 100644
--- a/gtk-gnutella.spec
+++ b/gtk-gnutella.spec
@@ -5,8 +5,9 @@ Release: 1%{?dist}
Group: Applications/Internet
License: GPLv2+
URL: http://gtk-gnutella.sourceforge.net
-Source0: http://dl.sourceforge.net/sourceforge/gtk-gnutella/gtk-gnutella-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0: http://dl.sourceforge.net/sourceforge/gtk-gnutella/gtk-gnutella-%{version}.tar.bz2
+Patch0: gtk-gnutella-0.97.1-fileindex.patch
%if 0%{!?_with_gtk1:1}
BuildRequires: gtk2-devel, libglade2-devel
@@ -30,18 +31,17 @@ features.
%prep
%setup -q
+%patch0 -p1
%build
-./build.sh \
- --gtk%{?_with_gtk1:1}%{!?_with_gtk1:2} \
- --prefix=%{_prefix} \
- --bindir=%{_bindir} \
- --datadir=%{_datadir}/%{name} \
- --mandir=%{_mandir}/man1} \
- --cc=%{__cc} \
- --cflags="%{optflags}" \
- --make="make %{?_smp_mflags}"
+./Configure -O -Dprefix=%{_prefix} -Dbindir=%{_bindir} \
+ -Dglibpth="/%{_lib} %{_libdir}" \
+ -Dprivlib=%{_datadir}/%{name} -Dsysman=%{_mandir}/man1 \
+ -Dccflags="%{optflags}" -Dcc="%{__cc}" -Dyacc="byacc" \
+ -Dgtkversion=%{?_with_gtk1:1}%{!?_with_gtk1:2} \
+ -Dofficial=true -ders
+make %{?_smp_mflags}
%install
@@ -75,7 +75,6 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%{_bindir}/*
%{_mandir}/*/*
-%{_libdir}/gtk-gnutella
%{_datadir}/gtk-gnutella
%{_datadir}/applications/*
%{_datadir}/pixmaps/*
@@ -85,8 +84,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
-* Thu Nov 24 2011 Dmitry Butskoy <Dmitry at Butskoy.name> - 0.97.1-1
+* Fri Dec 2 2011 Dmitry Butskoy <Dmitry at Butskoy.name> - 0.97.1-1
- Upgrade to 0.97.1
+- add upstream patch for zero fileindex
* Tue Apr 12 2011 Dan HorĂ¡k <dan[at]danny.cz> - 0.96.9-2
- s390(x) has IEEE 754 floats
More information about the scm-commits
mailing list