mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
- First copy files, then work with them
- Fixes for v28
This commit is contained in:
parent
b4b2700758
commit
a097548a94
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=266781
3 changed files with 82 additions and 8 deletions
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
PORTNAME= zfs
|
PORTNAME= zfs
|
||||||
PORTVERSION= 1
|
PORTVERSION= 1
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= sysutils python
|
CATEGORIES= sysutils python
|
||||||
MASTER_SITES= # none
|
MASTER_SITES= # none
|
||||||
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
|
||||||
|
@ -44,19 +44,26 @@ exists(${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/table.py)
|
||||||
PYFILES+= holds.py \
|
PYFILES+= holds.py \
|
||||||
table.py
|
table.py
|
||||||
PLIST_SUB+= V28=""
|
PLIST_SUB+= V28=""
|
||||||
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-util.py \
|
||||||
|
${FILESDIR}/extra-patch-userspace.py
|
||||||
.else
|
.else
|
||||||
PLIST_SUB+= V28="@comment "
|
PLIST_SUB+= V28="@comment "
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
post-patch:
|
do-extract:
|
||||||
@${MKDIR} ${WRKSRC}
|
@${MKDIR} ${WRKSRC}
|
||||||
@${SED} -e "s|/usr/bin/python2.4|${PYTHON_CMD}|g" \
|
@${CP} ${SRCDIR}/cddl/contrib/opensolaris/cmd/pyzfs/pyzfs.py \
|
||||||
${SRCDIR}/cddl/contrib/opensolaris/cmd/pyzfs/pyzfs.py \
|
${WRKSRC}/pyzfs.py
|
||||||
> ${WRKSRC}/pyzfs.py
|
|
||||||
.for PYFILE in ${PYFILES}
|
.for PYFILE in ${PYFILES}
|
||||||
@${SED} -e "s|/usr/bin/python2.4|${PYTHON_CMD}|g" \
|
@${CP} ${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/${PYFILE} \
|
||||||
${SRCDIR}/cddl/contrib/opensolaris/lib/pyzfs/common/${PYFILE} \
|
${WRKSRC}/${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
|
.endfor
|
||||||
|
|
||||||
do-install:
|
do-install:
|
||||||
|
|
43
sysutils/py-zfs/files/extra-patch-userspace.py
Normal file
43
sysutils/py-zfs/files/extra-patch-userspace.py
Normal file
|
@ -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:
|
24
sysutils/py-zfs/files/extra-patch-util.py
Normal file
24
sysutils/py-zfs/files/extra-patch-util.py
Normal file
|
@ -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."""
|
Loading…
Add table
Reference in a new issue