commit 2892fc57f14459c35f72c0c4522c51b7f1515045
Author: Arkadiusz Miƛkiewicz <ar...@maven.pl>
Date:   Thu Apr 5 09:28:34 2018 +0200

    - rel 2; fixes a case when offset gets current file inode number incorrectly

 python-pygtail-bug-38.patch | 12 ++++++++++++
 python-pygtail.spec         |  5 ++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/python-pygtail.spec b/python-pygtail.spec
index 35a79a5..46cbc82 100644
--- a/python-pygtail.spec
+++ b/python-pygtail.spec
@@ -9,11 +9,12 @@
 Summary:       Reads log file lines that have not been read
 Name:          python-%{pypi_name}
 Version:       0.8.0
-Release:       1
+Release:       2
 License:       GPL v2
 Group:         Libraries/Python
 Source0:       https://github.com/bgreenlee/pygtail/archive/%{version}.tar.gz
 # Source0-md5: 504ffc804e83a4dd09e20546990b1d43
+Patch0:                python-pygtail-bug-38.patch
 URL:           https://github.com/bgreenlee/pygtail
 BuildRequires: rpm-pythonprov
 BuildRequires: rpmbuild(macros) >= 1.714
@@ -45,6 +46,8 @@ handle log files that have been rotated.
 
 %prep
 %setup -q -n %{pypi_name}-%{version}
+%patch0 -p1
+
 sed -i -e 's#0\.7\.0#0\.8\.0#g' pygtail/core.py
 
 %build
diff --git a/python-pygtail-bug-38.patch b/python-pygtail-bug-38.patch
new file mode 100644
index 0000000..0b18c4a
--- /dev/null
+++ b/python-pygtail-bug-38.patch
@@ -0,0 +1,12 @@
+diff -urN pygtail-0.8.0.org/pygtail/core.py pygtail-0.8.0/pygtail/core.py
+--- pygtail-0.8.0.org/pygtail/core.py  2018-03-10 17:34:16.000000000 +0100
++++ pygtail-0.8.0/pygtail/core.py      2018-04-05 09:26:52.894624325 +0200
+@@ -182,7 +182,7 @@
+         if self.on_update:
+             self.on_update()
+         offset = self._filehandle().tell()
+-        inode = stat(self.filename).st_ino
++        inode = fstat(self._filehandle().fileno()).st_ino
+         fh = open(self._offset_file, "w")
+         fh.write("%s\n%s\n" % (inode, offset))
+         fh.close()
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pygtail.git/commitdiff/2892fc57f14459c35f72c0c4522c51b7f1515045

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to