Bug 160007 - [NEW PORT] ports-mgmt/porttree: Show dependences of FreeBSD port as pseudo graphical tree
Summary: [NEW PORT] ports-mgmt/porttree: Show dependences of FreeBSD port as pseudo gr...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Olli Hauer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-22 19:10 UTC by vladimir.chukharev
Modified: 2011-11-06 17:44 UTC (History)
0 users

See Also:


Attachments
porttree-0.1.r7.shar (2.31 KB, text/plain)
2011-08-22 19:10 UTC, vladimir.chukharev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description vladimir.chukharev 2011-08-22 19:10:05 UTC
For a given port determine its dependences using any combination of the FETCH_,
EXTRACT_, PATCH_, BUILD_, LIB_, and RUN_DEPENDS and show them as a pseudo
graphical tree. Use back references for cross-connections.

Generated with FreeBSD Port Tools 0.99
Sent via gmail.
Comment 1 Olli Hauer freebsd_committer 2011-08-27 15:04:08 UTC
There are some issues.

If I try the script with the following locale:

$> locale
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=

$> ./porttree.py -r /usr/ports/mail/postfix
Traceback (most recent call last):
  File "./porttree.py", line 181, in <module>
    print Net(port_tree).show(port_dir, style=eval('int(%s)' % str(options.style)))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u22a2' in position 2: ordinal not in range(128)


$> locale
LANG=
LC_CTYPE=de_DE.ISO8859-15
LC_COLLATE=de_DE.ISO8859-15
LC_TIME=de_DE.ISO8859-15
LC_NUMERIC=en_US.ISO8859-15
LC_MONETARY=de_DE.ISO8859-15
LC_MESSAGES=en_US.ISO8859-15
LC_ALL=

$> ./porttree.py -r /usr/ports/mail/postfix
Traceback (most recent call last):
  File "./porttree.py", line 181, in <module>
    print Net(port_tree).show(port_dir, style=eval('int(%s)' % str(options.style)))
  File "/usr/local/lib/python2.7/encodings/iso8859_15.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u250c' in position 2: character maps to <undefined>


$> pkg_info -qox py
math/py-networkx
textproc/py-pygments
devel/py-setuptools
devel/py-subversion
lang/python27
Comment 2 V.Chukharev 2011-09-14 22:06:05 UTC
Yes, you are right. There is an issue with coding. Currently it works only with utf-8.
I run it in gterm with UTF-8 encoding. Even pipe breaks the program in default style.

This is connected to the way how Python 2.* treats strings and unicode strings.
but have not yet found a good solution. A workaround is to use -s 0 for
ASCII-only chars for drawing the tree.

See also http://code.google.com/p/porttree/issues/detail?id=1

-- 
Vladimir Chukharev
Tampere University of Technology
Comment 3 V.Chukharev 2011-09-15 13:59:06 UTC
The new version of the porttree port. Please disregard the old version.

The new version outputs utf-8 chars and does not break on a terminal
with non-utf-8 encoding. If the terminal has pseudo graphics, iconv
can be used to convert to the right encoding. ISO-8859-* do not have,
the only way is to use style 0 (-s 0) to draw with +, | and `.
See man for examples.

Many new features are added.

--- porttree-0.2.r20.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       porttree
#       porttree/pkg-descr
#       porttree/distinfo
#       porttree/Makefile
#
echo c - porttree
mkdir -p porttree > /dev/null 2>&1
echo x - porttree/pkg-descr
sed 's/^X//' >porttree/pkg-descr << '602a5ff264d0d3f6c041a303b573ce36'
XFor a given port determine its dependences using any combination of the FETCH_,
XEXTRACT_, PATCH_, BUILD_, LIB_, and RUN_DEPENDS and show them as a pseudo
Xgraphical tree. Use back references for cross-connections.
602a5ff264d0d3f6c041a303b573ce36
echo x - porttree/distinfo
sed 's/^X//' >porttree/distinfo << '5b512887ac4c012b571d94007fa4865c'
XSHA256 (porttree-0.2.r20.tar.bz2) = ebb32cd9283aa74683cb612b464b2b1426481e65e9264a04c82d2b92cd180503
XSIZE (porttree-0.2.r20.tar.bz2) = 8724
5b512887ac4c012b571d94007fa4865c
echo x - porttree/Makefile
sed 's/^X//' >porttree/Makefile << 'a45043e9afed212b53be44b69cd3aeb8'
X# New ports collection makefile for:   porttree
X# Date created:         18 Aug 2011
X# Whom:                 Vladimir Chukharev
X#
X# $FreeBSD$
X#
X
XPORTNAME=      porttree
XPORTVERSION=   0.2.r${SVN_REV}
XCATEGORIES=    ports-mgmt python
XMASTER_SITES=  ${MASTER_SITE_GOOGLE_CODE}
X
XMAINTAINER=    Vladimir.Chukharev@gmail.com
XCOMMENT=       Show dependences of FreeBSD port as pseudo graphical tree
X
XLICENSE=       MIT
X
XMAN1=  porttree.1
XUSE_BZIP2=     yes
X#USE_PYTHON=   2.4+
X
XOPTIONS=       GENDIST "Support generating distfile from SVN" Off
X
X.include <bsd.port.options.mk>
X
XRUN_DEPENDS+=  ${PYTHON_PKGNAMEPREFIX}networkx>=1.5:${PORTSDIR}/math/py-networkx
X
X.if defined(WITH_GENDIST)
XFETCH_DEPENDS+=        svn:${PORTSDIR}/devel/subversion
X.endif
X
XSVNROOT?=      http://porttree.googlecode.com/svn/trunk/
XSVN_REV=       20
XNO_BUILD=      yes
XNO_INSTALL=    yes
XPLIST_FILES=   bin/porttree
X
X.include <bsd.port.pre.mk>
Xdo-install:
X       ${INSTALL_SCRIPT} ${WRKSRC}/src/porttree.py ${PREFIX}/bin/porttree
X       ${INSTALL_MAN} ${WRKSRC}/src/porttree.1 ${MAN8PREFIX}/man/man1
Xgen-dist:
X       ${MKDIR} ${WRKDIR}
X       ${RM} -rf ${WRKSRC}
X       svn export -r ${SVN_REV} ${SVNROOT} ${WRKSRC}
X       ${TAR} -cvy -C ${WRKDIR} --exclude FreeBSDport -f ${DISTDIR}/${DISTNAME}.tar.bz2 ${DISTNAME}
X.include <bsd.port.post.mk>
a45043e9afed212b53be44b69cd3aeb8
exit
--- porttree-0.2.r20.shar ends here ---


-- 
Vladimir Chukharev
Tampere University of Technology
Comment 4 Olli Hauer freebsd_committer 2011-11-06 16:24:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->ohauer

I'll take it.
Comment 5 dfilter service freebsd_committer 2011-11-06 17:16:09 UTC
ohauer      2011-11-06 17:15:50 UTC

  FreeBSD ports repository

  Modified files:
    ports-mgmt           Makefile 
  Added files:
    ports-mgmt/porttree  Makefile distinfo pkg-descr 
  Log:
  For a given port determine its dependences using any combination of the
   - FETCH_DEPENDS
   - EXTRACT_DEPENDS
   - PATCH_DEPENDS
   - LIB_DEPENDS
   - BUILD_DEPENDS
   - RUN_DEPENDS
  
  and show them as a pseudo graphical tree.
  Use back references for cross-connections.
  
  WWW: http://code.google.com/p/porttree/
  
  PR:             ports/160007
  Submitted by:   Vladimir Chukharev
  
  Revision  Changes    Path
  1.46      +1 -0      ports/ports-mgmt/Makefile
  1.1       +44 -0     ports/ports-mgmt/porttree/Makefile (new)
  1.1       +2 -0      ports/ports-mgmt/porttree/distinfo (new)
  1.1       +12 -0     ports/ports-mgmt/porttree/pkg-descr (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 6 Olli Hauer freebsd_committer 2011-11-06 17:43:55 UTC
State Changed
From-To: open->closed

Committed with minor changes, 
Thanks!