diff options
author | mm <mm@FreeBSD.org> | 2010-12-23 16:57:49 +0800 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2010-12-23 16:57:49 +0800 |
commit | e1ff2fc0e38cfa01570c3c470c700a8ceeea9ec5 (patch) | |
tree | 8fd9a6978f2e53d51f19309b3553494647eb3cde /sysutils/py-zfs | |
parent | 0641a015fa57157cf0e6d3cc33d5eeb36b108bea (diff) | |
download | freebsd-ports-gnome-e1ff2fc0e38cfa01570c3c470c700a8ceeea9ec5.tar.gz freebsd-ports-gnome-e1ff2fc0e38cfa01570c3c470c700a8ceeea9ec5.tar.zst freebsd-ports-gnome-e1ff2fc0e38cfa01570c3c470c700a8ceeea9ec5.zip |
- First copy files, then work with them
- Fixes for v28
Diffstat (limited to 'sysutils/py-zfs')
-rw-r--r-- | sysutils/py-zfs/Makefile | 23 | ||||
-rw-r--r-- | sysutils/py-zfs/files/extra-patch-userspace.py | 43 | ||||
-rw-r--r-- | sysutils/py-zfs/files/extra-patch-util.py | 24 |
3 files changed, 82 insertions, 8 deletions
diff --git a/sysutils/py-zfs/Makefile b/sysutils/py-zfs/Makefile index c64325b8249e..b17ede8bef20 100644 --- a/sysutils/py-zfs/Makefile +++ b/sysutils/py-zfs/Makefile @@ -7,7 +7,7 @@ PORTNAME= zfs PORTVERSION= 1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils python MASTER_SITES= # none PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} @@ -44,19 +44,26 @@ exists(${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/table.py) PYFILES+= holds.py \ table.py PLIST_SUB+= V28="" +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-util.py \ + ${FILESDIR}/extra-patch-userspace.py .else PLIST_SUB+= V28="@comment " .endif -post-patch: +do-extract: @${MKDIR} ${WRKSRC} - @${SED} -e "s|/usr/bin/python2.4|${PYTHON_CMD}|g" \ - ${SRCDIR}/cddl/contrib/opensolaris/cmd/pyzfs/pyzfs.py \ - > ${WRKSRC}/pyzfs.py + @${CP} ${SRCDIR}/cddl/contrib/opensolaris/cmd/pyzfs/pyzfs.py \ + ${WRKSRC}/pyzfs.py .for PYFILE in ${PYFILES} - @${SED} -e "s|/usr/bin/python2.4|${PYTHON_CMD}|g" \ - ${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/${PYFILE} \ - > ${WRKSRC}/${PYFILE} + @${CP} ${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/${PYFILE} \ + ${WRKSRC}/${PYFILE} +.endfor + +post-patch: + +.for PYFILE in pyzfs.py ${PYFILES} + @${REINPLACE_CMD} -e "s|#! /usr/bin/python.*|#! ${PYTHON_CMD}|g" \ + ${WRKSRC}/${PYFILE} .endfor do-install: diff --git a/sysutils/py-zfs/files/extra-patch-userspace.py b/sysutils/py-zfs/files/extra-patch-userspace.py new file mode 100644 index 000000000000..58b574be7cef --- /dev/null +++ b/sysutils/py-zfs/files/extra-patch-userspace.py @@ -0,0 +1,43 @@ +--- userspace.py.orig 2010-12-23 09:35:39.917675583 +0100 ++++ userspace.py 2010-12-23 09:52:20.873003971 +0100 +@@ -30,7 +30,6 @@ + import pwd + import grp + import errno +-import solaris.misc + import zfs.util + import zfs.ioctl + import zfs.dataset +@@ -68,9 +67,9 @@ + idstr = "%u" % rid + + (typename, mapfunc) = { +- (1, 1): ("SMB Group", lambda id: solaris.misc.sid_to_name(id, 0)), ++ (1, 1): ("SMB Group", id), + (1, 0): ("POSIX Group", lambda id: grp.getgrgid(int(id)).gr_name), +- (0, 1): ("SMB User", lambda id: solaris.misc.sid_to_name(id, 1)), ++ (0, 1): ("SMB User", id), + (0, 0): ("POSIX User", lambda id: pwd.getpwuid(int(id)).pw_name) + }[isgroup, bool(domain)] + +@@ -107,13 +106,13 @@ + (domain, rid, value) = elem + (field, isgroup) = props[prop] + +- if options.translate and domain: +- try: +- rid = solaris.misc.sid_to_id("%s-%u" % (domain, rid), +- not isgroup) +- domain = None +- except KeyError: +- pass; ++# if options.translate and domain: ++# try: ++# rid = solaris.misc.sid_to_id("%s-%u" % (domain, rid), ++# not isgroup) ++# domain = None ++# except KeyError: ++# pass; + key = (isgroup, domain, rid) + + try: diff --git a/sysutils/py-zfs/files/extra-patch-util.py b/sysutils/py-zfs/files/extra-patch-util.py new file mode 100644 index 000000000000..d1f77623f561 --- /dev/null +++ b/sysutils/py-zfs/files/extra-patch-util.py @@ -0,0 +1,24 @@ +--- util.py.orig 2010-12-23 09:07:09.188744296 +0100 ++++ util.py 2010-12-23 09:10:16.315849339 +0100 +@@ -28,7 +28,6 @@ + import gettext + import errno + import os +-import solaris.misc + # Note: this module (zfs.util) should not import zfs.ioctl, because that + # would introduce a circular dependency + +@@ -37,11 +36,8 @@ + + dev = open("/dev/zfs", "w") + +-try: +- _ = gettext.translation("SUNW_OST_OSLIB", "/usr/lib/locale", +- fallback=True).gettext +-except: +- _ = solaris.misc.gettext ++_ = gettext.translation("SUNW_OST_OSLIB", "/usr/lib/locale", ++ fallback=True).gettext + + def default_repr(self): + """A simple __repr__ function.""" |