>From upstream https://bz.mercurial-scm.org/show_bug.cgi?id=4943 # Files opened in a+ mode have inconsistent behavior on various # platforms. Windows requires that a file positioning call be made # when the file handle transitions between reads and writes. See # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other # platforms, Python or the platform itself can be buggy. Some versions # of Solaris have been observed to not append at the end of the file # if the file was seeked to before the end. See issue4943 for more. # # We work around this issue by inserting a seek() before writing. # Note: This is likely not necessary on Python 3. bump PKGREVISION okay'd by wiz@diff -r1.7 -r1.8 pkgsrc/devel/py-mercurial/Makefile
(richard)
@@ -1,36 +1,37 @@ | @@ -1,36 +1,37 @@ | |||
1 | # $NetBSD: Makefile,v 1.7 2015/09/02 16:52:37 wiz Exp $ | 1 | # $NetBSD: Makefile,v 1.8 2015/12/21 13:19:17 richard Exp $ | |
2 | 2 | |||
3 | DISTNAME= mercurial-${VERSION} | 3 | DISTNAME= mercurial-${VERSION} | |
4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | 4 | PKGNAME= ${PYPKGPREFIX}-${DISTNAME} | |
5 | PKGREVISION= 1 | |||
5 | CATEGORIES= devel scm | 6 | CATEGORIES= devel scm | |
6 | MASTER_SITES= https://mercurial.selenic.com/release/ | 7 | MASTER_SITES= https://mercurial.selenic.com/release/ | |
7 | 8 | |||
8 | MAINTAINER= wiz@NetBSD.org | 9 | MAINTAINER= wiz@NetBSD.org | |
9 | HOMEPAGE= http://mercurial.selenic.com/ | 10 | HOMEPAGE= http://mercurial.selenic.com/ | |
10 | COMMENT= Fast, lightweight source control management system | 11 | COMMENT= Fast, lightweight source control management system | |
11 | LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer | 12 | LICENSE= gnu-gpl-v2 OR gnu-gpl-v3 # OR newer | |
12 | 13 | |||
13 | # with this dependency, two zip test cases start working | 14 | # with this dependency, two zip test cases start working | |
14 | # http://bz.selenic.com/show_bug.cgi?id=4483 | 15 | # http://bz.selenic.com/show_bug.cgi?id=4483 | |
15 | # http://bz.selenic.com/show_bug.cgi?id=4485 | 16 | # http://bz.selenic.com/show_bug.cgi?id=4485 | |
16 | #BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip | 17 | #BUILD_DEPENDS+= unzip-[0-9]*:../../archivers/unzip | |
17 | DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses | 18 | DEPENDS+= ${PYPKGPREFIX}-curses-[0-9]*:../../devel/py-curses | |
18 | 19 | |||
19 | USE_TOOLS+= gmake msgfmt | 20 | USE_TOOLS+= gmake msgfmt | |
20 | 21 | |||
21 | INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 | 22 | INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 | |
22 | INSTALLATION_DIRS+= share/doc/mercurial | 23 | INSTALLATION_DIRS+= share/doc/mercurial | |
23 | 24 | |||
24 | .include "Makefile.version" | 25 | .include "Makefile.version" | |
25 | 26 | |||
26 | do-test: | 27 | do-test: | |
27 | cd ${WRKSRC} && make tests PYTHON=${PYTHONBIN} | 28 | cd ${WRKSRC} && make tests PYTHON=${PYTHONBIN} | |
28 | 29 | |||
29 | post-install: | 30 | post-install: | |
30 | ${INSTALL_DATA} ${WRKSRC}/doc/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 | 31 | ${INSTALL_DATA} ${WRKSRC}/doc/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1 | |
31 | ${INSTALL_DATA} ${WRKSRC}/doc/*.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5 | 32 | ${INSTALL_DATA} ${WRKSRC}/doc/*.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5 | |
32 | ${INSTALL_DATA} ${WRKSRC}/README \ | 33 | ${INSTALL_DATA} ${WRKSRC}/README \ | |
33 | ${DESTDIR}${PREFIX}/share/doc/mercurial | 34 | ${DESTDIR}${PREFIX}/share/doc/mercurial | |
34 | 35 | |||
35 | .include "../../lang/python/distutils.mk" | 36 | .include "../../lang/python/distutils.mk" | |
36 | .include "../../mk/bsd.pkg.mk" | 37 | .include "../../mk/bsd.pkg.mk" |
@@ -1,6 +1,7 @@ | @@ -1,6 +1,7 @@ | |||
1 | $NetBSD: distinfo,v 1.27 2015/12/05 11:22:32 wiz Exp $ | 1 | $NetBSD: distinfo,v 1.28 2015/12/21 13:19:17 richard Exp $ | |
2 | 2 | |||
3 | SHA1 (mercurial-3.6.2.tar.gz) = 1dbf5d9d42f70f1fb0b26f8e659a1b7879bc1533 | 3 | SHA1 (mercurial-3.6.2.tar.gz) = 1dbf5d9d42f70f1fb0b26f8e659a1b7879bc1533 | |
4 | RMD160 (mercurial-3.6.2.tar.gz) = 0671aa8429befbc9b049cb640a54d4c810103f56 | 4 | RMD160 (mercurial-3.6.2.tar.gz) = 0671aa8429befbc9b049cb640a54d4c810103f56 | |
5 | SHA512 (mercurial-3.6.2.tar.gz) = 2ad780174a30c39a1482d597466523a133b8c62a3a0eb9ac3b183082e279fc624998a9ffa520abafe5f7afc7d9f4600f443ad4dfa1003bd7fdc6b713040091ed | 5 | SHA512 (mercurial-3.6.2.tar.gz) = 2ad780174a30c39a1482d597466523a133b8c62a3a0eb9ac3b183082e279fc624998a9ffa520abafe5f7afc7d9f4600f443ad4dfa1003bd7fdc6b713040091ed | |
6 | Size (mercurial-3.6.2.tar.gz) = 4518349 bytes | 6 | Size (mercurial-3.6.2.tar.gz) = 4518349 bytes | |
7 | SHA1 (patch-mercurial_revlog.py) = 2c6ba5325480d6a6c025e00fe7903eb007069e1f |
$NetBSD: patch-mercurial_revlog.py,v 1.1 2015/12/21 13:19:17 richard Exp $
https://bz.mercurial-scm.org/show_bug.cgi?id=4943
--- mercurial/revlog.py.orig 2015-12-02 02:18:26.000000000 +0000
+++ mercurial/revlog.py
@@ -13,6 +13,7 @@ and O(changes) merge between branches.
# import stuff from node for others to import from revlog
import collections
+import os
from node import bin, hex, nullid, nullrev
from i18n import _
import ancestor, mdiff, parsers, error, util, templatefilters
@@ -1426,6 +1427,20 @@ class revlog(object):
return node
def _writeentry(self, transaction, ifh, dfh, entry, data, link, offset):
+ # Files opened in a+ mode have inconsistent behavior on various
+ # platforms. Windows requires that a file positioning call be made
+ # when the file handle transitions between reads and writes. See
+ # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
+ # platforms, Python or the platform itself can be buggy. Some versions
+ # of Solaris have been observed to not append at the end of the file
+ # if the file was seeked to before the end. See issue4943 for more.
+ #
+ # We work around this issue by inserting a seek() before writing.
+ # Note: This is likely not necessary on Python 3.
+ ifh.seek(0, os.SEEK_END)
+ if dfh:
+ dfh.seek(0, os.SEEK_END)
+
curr = len(self) - 1
if not self._inline:
transaction.add(self.datafile, offset)