1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.1 Mon Oct 27 00:21:56 2008 +0100 1.3 @@ -0,0 +1,87 @@ 1.4 +.TH "ASTGREP" "1" 1.5 + 1.6 +.\" Manual page prepared by: 1.7 +.\" 1.8 +.\" Paul Boddie <paul@boddie.org.uk> 1.9 +.\" 1.10 +.\" To view this file while editing, run it through groff: 1.11 +.\" groff -Tascii -man astgrep.1 | less 1.12 + 1.13 +.SH NAME 1.14 +astgrep \- grep/search through Python abstract syntax trees 1.15 +.SH SYNOPSIS 1.16 +.B astgrep 1.17 +[options] \-t TERM_TYPE [ \-e PATTERN ] ( \-r DIRECTORY | FILE ) 1.18 +.SH DESCRIPTION 1.19 +\fBastgrep\fR is a program which searches through Python source files for 1.20 +textual information of a specific type. Instead of matching a search term or 1.21 +expression, \fIPATTERN\fR, to all text in a program, as \fBgrep\fR would do, 1.22 +\fBastgrep\fR matches only tokens in the program having a particular type, 1.23 +specified using \fITERM_TYPE\fR, such as names or constants. 1.24 + 1.25 +Like \fBgrep\fR, a single \fIFILE\fR or a number of files within a directory 1.26 +hierarchy, \fIDIRECTORY\fR, can be searched, with the occurrences listed from 1.27 +each file. 1.28 +.SH COMMAND LINE OPTIONS 1.29 +.TP 1.30 +.BR \-n , " \-\-line-number" 1.31 +Show the line number of each match. 1.32 +.TP 1.33 +.BR \-p , " \-\-print-token" 1.34 +Show the matching token for each match. 1.35 +.TP 1.36 +\fB\-t\fR, \fB\-\-type\fR=\fITERM_TYPE\fR 1.37 +Indicate the type of token to be matched. 1.38 +.TP 1.39 +\fB\-e\fR, \fB\-\-regexp\fR=\fIPATTERN\fR 1.40 +Use \fIPATTERN\fR as the term to search for. 1.41 +.TP 1.42 +\fB\-r\fR, \fB\-R\fR, \fB\-\-recursive\fR \fIDIRECTORY\fR 1.43 +Search Python files within \fIDIRECTORY\fR, recursively. 1.44 +.SH TERM TYPES 1.45 +Details of term types can be found in the "AST Nodes" section of the Python 1.46 +Library Reference or by using \fBpydoc\fR to inspect the node classes in the 1.47 +\fBcompiler.ast\fR Python module: 1.48 +.RS 4 1.49 +.PP 1.50 +.PD 0 1.51 +.B pydoc compiler.ast 1.52 +.RE 1.53 +.PD 1.54 +.SH EXAMPLES 1.55 +Search for classes whose name contains \fINode\fR in a particular file: 1.56 +.RS 4 1.57 +.PP 1.58 +.PD 0 1.59 +.B astgrep -t Class -e Node libxml2dom/__init__.py 1.60 +.RE 1.61 +.PD 1.62 +.PP 1.63 +Search for functions or methods whose name starts with \fIvisit\fR in a 1.64 +particular directory hierarchy, \fImicropython\fR, showing the name of the 1.65 +matching functions in the output: 1.66 +.RS 4 1.67 +.PP 1.68 +.PD 0 1.69 +.B astgrep -p -t Function -e '^visit' -r micropython 1.70 +.RE 1.71 +.PD 1.72 +.PP 1.73 +Search for accesses of attributes having the exact name \fI_node\fR in a 1.74 +particular directory hierarchy, \fIlibxml2dom\fR, showing the line number of 1.75 +each match in the output: 1.76 +.RS 4 1.77 +.PP 1.78 +.PD 0 1.79 +.B astgrep -n -t Getattr -e '^_node$' -r libxml2dom 1.80 +.RE 1.81 +.PD 1.82 +.SH SEE ALSO 1.83 +.BR python (1), 1.84 +.BR grep (1) 1.85 +.PP 1.86 +astgrep 1.87 +.I http://www.boddie.org.uk/python/astgrep.html 1.88 +.PD 1.89 +.SH COPYRIGHT 1.90 +Copyright \(co 2008 Paul Boddie; License GNU GPL version 3
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:21:56 2008 +0100 2.3 @@ -0,0 +1,2 @@ 2.4 +astgrep.py usr/lib/astgrep/bin/ 2.5 +scripts/astgrep usr/bin/
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:21:56 2008 +0100 3.3 @@ -0,0 +1,43 @@ 3.4 +#! /bin/sh 3.5 +# postinst script for astgrep 3.6 +# 3.7 +# see: dh_installdeb(1) 3.8 + 3.9 +set -e 3.10 + 3.11 +# summary of how this script can be called: 3.12 +# * <postinst> `configure' <most-recently-configured-version> 3.13 +# * <old-postinst> `abort-upgrade' <new version> 3.14 +# * <conflictor's-postinst> `abort-remove' `in-favour' <package> 3.15 +# <new-version> 3.16 +# * <deconfigured's-postinst> `abort-deconfigure' `in-favour' 3.17 +# <failed-install-package> <version> `removing' 3.18 +# <conflicting-package> <version> 3.19 +# for details, see http://www.debian.org/doc/debian-policy/ or 3.20 +# the debian-policy package 3.21 +# 3.22 +# quoting from the policy: 3.23 +# Any necessary prompting should almost always be confined to the 3.24 +# post-installation script, and should be protected with a conditional 3.25 +# so that unnecessary prompting doesn't happen if a package's 3.26 +# installation fails and the `postinst' is called with `abort-upgrade', 3.27 +# `abort-remove' or `abort-deconfigure'. 3.28 + 3.29 +PACKAGE=astgrep 3.30 + 3.31 +case "$1" in 3.32 + configure|abort-upgrade|abort-remove|abort-deconfigure) 3.33 + chmod ugo+rx /usr/lib/astgrep/bin/astgrep.py /usr/bin/astgrep 3.34 + ;; 3.35 + 3.36 + *) 3.37 + echo "postinst called with unknown argument \`$1'" >&2 3.38 + exit 1 3.39 + ;; 3.40 +esac 3.41 + 3.42 + 3.43 + 3.44 +exit 0 3.45 + 3.46 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:21:56 2008 +0100 4.3 @@ -0,0 +1,20 @@ 4.4 +#! /bin/sh 4.5 +# prerm script for astgrep 4.6 + 4.7 +set -e 4.8 + 4.9 +PACKAGE=astgrep 4.10 + 4.11 +case "$1" in 4.12 + remove|upgrade|failed-upgrade) 4.13 + ;; 4.14 + 4.15 + *) 4.16 + echo "prerm called with unknown argument \`$1'" >&2 4.17 + exit 1 4.18 + ;; 4.19 +esac 4.20 + 4.21 + 4.22 + 4.23 +exit 0
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:21:56 2008 +0100 5.3 @@ -0,0 +1,5 @@ 5.4 +astgrep (0.1-0ubuntu1) gutsy; urgency=low 5.5 + 5.6 + * Packaging of upstream sources. 5.7 + 5.8 + -- Paul Boddie <paul@boddie.org.uk> Mon, 27 Oct 2008 00:19:50 +0100
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 6.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/compat Mon Oct 27 00:21:56 2008 +0100 6.3 @@ -0,0 +1,1 @@ 6.4 +5
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 7.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:21:56 2008 +0100 7.3 @@ -0,0 +1,16 @@ 7.4 +Source: astgrep 7.5 +Section: python 7.6 +Priority: optional 7.7 +Maintainer: Paul Boddie <paul@boddie.org.uk> 7.8 +Build-Depends: debhelper (>= 5.0.38), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6) 7.9 +XS-Python-Version: all 7.10 +Standards-Version: 3.7.2.1 7.11 + 7.12 +Package: astgrep 7.13 +Architecture: all 7.14 +Depends: ${python:Depends}, python-cmdsyntax (>= 0.91-0ubuntu2) 7.15 +XB-Python-Version: ${python:Versions} 7.16 +Description: Search through Python source files for textual information 7.17 + of a specific type. Instead of matching a search term or expression to 7.18 + all text in a program, as grep would do, astgrep matches only tokens 7.19 + in the program having a particular type, such as names or constants.
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 8.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/copyright Mon Oct 27 00:21:56 2008 +0100 8.3 @@ -0,0 +1,31 @@ 8.4 +Package creator: 8.5 + 8.6 + Paul Boddie <paul@boddie.org.uk> 8.7 + 8.8 +The origin of the package is: 8.9 + 8.10 + http://www.boddie.org.uk/python/astgrep.html 8.11 + 8.12 +Package author: 8.13 + 8.14 + Paul Boddie <paul@boddie.org.uk> 8.15 + 8.16 +Copyright: 8.17 + 8.18 +Licence Agreement for astgrep 8.19 +----------------------------- 8.20 + 8.21 +Copyright (C) 2008 Paul Boddie <paul@boddie.org.uk> 8.22 + 8.23 +This program is free software; you can redistribute it and/or modify it under 8.24 +the terms of the GNU General Public License as published by the Free Software 8.25 +Foundation; either version 3 of the License, or (at your option) any later 8.26 +version. 8.27 + 8.28 +This program is distributed in the hope that it will be useful, but WITHOUT 8.29 +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 8.30 +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 8.31 +details. 8.32 + 8.33 +You should have received a copy of the GNU General Public License along with 8.34 +this program. If not, see <http://www.gnu.org/licenses/>.
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/docs Mon Oct 27 00:21:56 2008 +0100 9.3 @@ -0,0 +1,2 @@ 9.4 +README.txt 9.5 +docs
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 10.2 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:21:56 2008 +0100 10.3 @@ -0,0 +1,67 @@ 10.4 +#!/usr/bin/make -f 10.5 + 10.6 +# Uncomment this to turn on verbose mode. 10.7 +#export DH_VERBOSE=1 10.8 + 10.9 +PYVERS=$(shell pyversions -vr) 10.10 + 10.11 +build: build-stamp 10.12 + 10.13 +build-stamp: $(PYVERS:%=build-python%) 10.14 + touch $@ 10.15 + 10.16 +build-python%: 10.17 + #python$* setup.py build_py 10.18 + #touch $@ 10.19 + 10.20 +build-python-scripts: 10.21 + #python setup.py build_scripts 10.22 + #touch $@ 10.23 + 10.24 +clean: 10.25 + dh_testdir 10.26 + dh_testroot 10.27 + rm -f *-stamp 10.28 + rm -rf build 10.29 + find . -name '*.py[co]' | xargs rm -f 10.30 + dh_clean 10.31 + 10.32 +install: build install-prereq $(PYVERS:%=install-python%) install-python-scripts 10.33 + # Script fixing would appear here. 10.34 + 10.35 +install-prereq: 10.36 + dh_testdir 10.37 + dh_testroot 10.38 + dh_clean -k 10.39 + 10.40 +install-python%: 10.41 + #python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-desktop/usr/lib/python$*/site-packages 10.42 + 10.43 +install-python-scripts: 10.44 + #python setup.py install_scripts --install-dir $(CURDIR)/debian/python-desktop/usr/bin 10.45 + 10.46 +# Build architecture-independent files here. 10.47 + 10.48 +binary-indep: install 10.49 + dh_testdir -i 10.50 + dh_testroot -i 10.51 + # Install before dh_pycentral so that it can work out that there's Python involved 10.52 + dh_install -i -n 10.53 + dh_pycentral -i usr/lib/astgrep/bin 10.54 + dh_installdocs -i 10.55 + dh_installchangelogs -i 10.56 + gzip --best debian/astgrep.1 10.57 + dh_installman -i debian/astgrep.1.gz 10.58 + dh_fixperms -i 10.59 + dh_installdeb -i 10.60 + dh_gencontrol -i 10.61 + dh_md5sums -i 10.62 + dh_builddeb -i 10.63 + 10.64 +# Build architecture-dependent files here. 10.65 + 10.66 +binary-arch: 10.67 + # Empty rule for this package. 10.68 + 10.69 +binary: binary-indep binary-arch 10.70 +.PHONY: build clean binary-arch binary-indep binary install