# HG changeset patch # User Paul Boddie # Date 1225063316 -3600 # Node ID 31cef282d0b9f5d7cd67545c9d52efb702e419ad # Parent eb06eca515752bd4d53f7356fea44b514d886321 Added packaging resources. diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/astgrep.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.1 Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,87 @@ +.TH "ASTGREP" "1" + +.\" Manual page prepared by: +.\" +.\" Paul Boddie +.\" +.\" To view this file while editing, run it through groff: +.\" groff -Tascii -man astgrep.1 | less + +.SH NAME +astgrep \- grep/search through Python abstract syntax trees +.SH SYNOPSIS +.B astgrep +[options] \-t TERM_TYPE [ \-e PATTERN ] ( \-r DIRECTORY | FILE ) +.SH DESCRIPTION +\fBastgrep\fR is a program which searches through Python source files for +textual information of a specific type. Instead of matching a search term or +expression, \fIPATTERN\fR, to all text in a program, as \fBgrep\fR would do, +\fBastgrep\fR matches only tokens in the program having a particular type, +specified using \fITERM_TYPE\fR, such as names or constants. + +Like \fBgrep\fR, a single \fIFILE\fR or a number of files within a directory +hierarchy, \fIDIRECTORY\fR, can be searched, with the occurrences listed from +each file. +.SH COMMAND LINE OPTIONS +.TP +.BR \-n , " \-\-line-number" +Show the line number of each match. +.TP +.BR \-p , " \-\-print-token" +Show the matching token for each match. +.TP +\fB\-t\fR, \fB\-\-type\fR=\fITERM_TYPE\fR +Indicate the type of token to be matched. +.TP +\fB\-e\fR, \fB\-\-regexp\fR=\fIPATTERN\fR +Use \fIPATTERN\fR as the term to search for. +.TP +\fB\-r\fR, \fB\-R\fR, \fB\-\-recursive\fR \fIDIRECTORY\fR +Search Python files within \fIDIRECTORY\fR, recursively. +.SH TERM TYPES +Details of term types can be found in the "AST Nodes" section of the Python +Library Reference or by using \fBpydoc\fR to inspect the node classes in the +\fBcompiler.ast\fR Python module: +.RS 4 +.PP +.PD 0 +.B pydoc compiler.ast +.RE +.PD +.SH EXAMPLES +Search for classes whose name contains \fINode\fR in a particular file: +.RS 4 +.PP +.PD 0 +.B astgrep -t Class -e Node libxml2dom/__init__.py +.RE +.PD +.PP +Search for functions or methods whose name starts with \fIvisit\fR in a +particular directory hierarchy, \fImicropython\fR, showing the name of the +matching functions in the output: +.RS 4 +.PP +.PD 0 +.B astgrep -p -t Function -e '^visit' -r micropython +.RE +.PD +.PP +Search for accesses of attributes having the exact name \fI_node\fR in a +particular directory hierarchy, \fIlibxml2dom\fR, showing the line number of +each match in the output: +.RS 4 +.PP +.PD 0 +.B astgrep -n -t Getattr -e '^_node$' -r libxml2dom +.RE +.PD +.SH SEE ALSO +.BR python (1), +.BR grep (1) +.PP +astgrep +.I http://www.boddie.org.uk/python/astgrep.html +.PD +.SH COPYRIGHT +Copyright \(co 2008 Paul Boddie; License GNU GPL version 3 diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.install Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,2 @@ +astgrep.py usr/lib/astgrep/bin/ +scripts/astgrep usr/bin/ diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.postinst Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,43 @@ +#! /bin/sh +# postinst script for astgrep +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package +# +# quoting from the policy: +# Any necessary prompting should almost always be confined to the +# post-installation script, and should be protected with a conditional +# so that unnecessary prompting doesn't happen if a package's +# installation fails and the `postinst' is called with `abort-upgrade', +# `abort-remove' or `abort-deconfigure'. + +PACKAGE=astgrep + +case "$1" in + configure|abort-upgrade|abort-remove|abort-deconfigure) + chmod ugo+rx /usr/lib/astgrep/bin/astgrep.py /usr/bin/astgrep + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + + +exit 0 + + diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/astgrep.prerm Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,20 @@ +#! /bin/sh +# prerm script for astgrep + +set -e + +PACKAGE=astgrep + +case "$1" in + remove|upgrade|failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + + + +exit 0 diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/changelog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/changelog Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,5 @@ +astgrep (0.1-0ubuntu1) gutsy; urgency=low + + * Packaging of upstream sources. + + -- Paul Boddie Mon, 27 Oct 2008 00:19:50 +0100 diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/compat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/compat Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,1 @@ +5 diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/control --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/control Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,16 @@ +Source: astgrep +Section: python +Priority: optional +Maintainer: Paul Boddie +Build-Depends: debhelper (>= 5.0.38), python-all-dev (>= 2.3.5-11), python-central (>= 0.5.6) +XS-Python-Version: all +Standards-Version: 3.7.2.1 + +Package: astgrep +Architecture: all +Depends: ${python:Depends}, python-cmdsyntax (>= 0.91-0ubuntu2) +XB-Python-Version: ${python:Versions} +Description: Search through Python source files for textual information + of a specific type. Instead of matching a search term or expression to + all text in a program, as grep would do, astgrep matches only tokens + in the program having a particular type, such as names or constants. diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/copyright --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/copyright Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,31 @@ +Package creator: + + Paul Boddie + +The origin of the package is: + + http://www.boddie.org.uk/python/astgrep.html + +Package author: + + Paul Boddie + +Copyright: + +Licence Agreement for astgrep +----------------------------- + +Copyright (C) 2008 Paul Boddie + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 3 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. If not, see . diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/docs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/docs Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,2 @@ +README.txt +docs diff -r eb06eca51575 -r 31cef282d0b9 packages/ubuntu-gutsy/python-astgrep/debian/rules --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/packages/ubuntu-gutsy/python-astgrep/debian/rules Mon Oct 27 00:21:56 2008 +0100 @@ -0,0 +1,67 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +PYVERS=$(shell pyversions -vr) + +build: build-stamp + +build-stamp: $(PYVERS:%=build-python%) + touch $@ + +build-python%: + #python$* setup.py build_py + #touch $@ + +build-python-scripts: + #python setup.py build_scripts + #touch $@ + +clean: + dh_testdir + dh_testroot + rm -f *-stamp + rm -rf build + find . -name '*.py[co]' | xargs rm -f + dh_clean + +install: build install-prereq $(PYVERS:%=install-python%) install-python-scripts + # Script fixing would appear here. + +install-prereq: + dh_testdir + dh_testroot + dh_clean -k + +install-python%: + #python$* setup.py install_lib --install-dir $(CURDIR)/debian/python-desktop/usr/lib/python$*/site-packages + +install-python-scripts: + #python setup.py install_scripts --install-dir $(CURDIR)/debian/python-desktop/usr/bin + +# Build architecture-independent files here. + +binary-indep: install + dh_testdir -i + dh_testroot -i + # Install before dh_pycentral so that it can work out that there's Python involved + dh_install -i -n + dh_pycentral -i usr/lib/astgrep/bin + dh_installdocs -i + dh_installchangelogs -i + gzip --best debian/astgrep.1 + dh_installman -i debian/astgrep.1.gz + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +# Build architecture-dependent files here. + +binary-arch: + # Empty rule for this package. + +binary: binary-indep binary-arch +.PHONY: build clean binary-arch binary-indep binary install