diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2006-08-03 04:51:51 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2006-08-03 04:51:51 +0000 |
commit | 5d69a524f81f234b3fbc41d49ba18d6f6886baba (patch) | |
tree | b71312bf7f1e8d10fef0f3ac6f28784065e73e72 /dtools/bin |
Houston, we have a trunk.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3122 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'dtools/bin')
-rwxr-xr-x | dtools/bin/check-config-files | 72 | ||||
-rwxr-xr-x | dtools/bin/check-imports | 4 | ||||
-rwxr-xr-x | dtools/bin/check-tarball-h-files | 23 | ||||
-rwxr-xr-x | dtools/bin/get-config-files | 6 | ||||
-rwxr-xr-x | dtools/bin/incr_release | 37 | ||||
-rwxr-xr-x | dtools/bin/make-upload | 12 | ||||
-rwxr-xr-x | dtools/bin/show_release | 36 | ||||
-rwxr-xr-x | dtools/bin/tag_release | 47 |
8 files changed, 237 insertions, 0 deletions
diff --git a/dtools/bin/check-config-files b/dtools/bin/check-config-files new file mode 100755 index 0000000000..7111c951d7 --- /dev/null +++ b/dtools/bin/check-config-files @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# usage: takes list of directories on command line + +import sys +import os +import os.path +from itertools import ifilter, ifilterfalse, imap, izip +import md5 +from pprint import pprint +from sets import Set + +class info(object): + def __init__(self, dir, name, md5sum): + self.dir = dir + self.name = name + self.md5sum = md5sum + def __repr__(self): + return '<%r, %r, %r>' % (self.dir, self.name, self.md5sum) + + +def md5sum_file(filename): + f = open(filename, 'r') + m = md5.new(f.read()) + return m.hexdigest() + +def process_dir(dir): + files = list(ifilterfalse(lambda s: s.endswith('~'), + _filter(os.listdir(dir), ('CVS','Makefile', 'Makefile.in', '.svn')))) + return [info(dir, f, md5sum_file(os.path.join(dir, f))) for f in files] + + +# Return a copy with items that occur in skip removed. +# +def _filter(flist, skip): + return list(ifilterfalse(skip.__contains__, flist)) + +def main(): + dirs = sys.argv[1:] + r = [] + for d in dirs: + r += process_dir(d) + + names = Set([x.name for x in r]) + #pprint(names) + + # check for missing files across the union of names + for d in dirs: + names_in_dir = Set([x.name for x in r if x.dir == d]) + diff = names.difference(names_in_dir) + if len(diff) != 0: + print "%s is missing %r" % (d, diff) + + # check for different versions of files + name_list = [n for n in names] + name_list.sort() + + for name in name_list: + vers = {} + pairs = [(x.dir, x.md5sum) for x in r if x.name == name] + for (dir, sum) in pairs: + if vers.has_key(sum): + vers[sum].append(dir) + else: + vers[sum] = [ dir ] + if len(vers) != 1: # multiple versions + print "Multiple versions of %s:" % (name,) + pprint(vers) + + # pprint(r) + +if __name__ == '__main__': + main() diff --git a/dtools/bin/check-imports b/dtools/bin/check-imports new file mode 100755 index 0000000000..75ca547d6d --- /dev/null +++ b/dtools/bin/check-imports @@ -0,0 +1,4 @@ +#!/bin/bash + +find . -name '*.py' | xargs grep -h -E '^(from|import)' | sort -u + diff --git a/dtools/bin/check-tarball-h-files b/dtools/bin/check-tarball-h-files new file mode 100755 index 0000000000..f94832c2d7 --- /dev/null +++ b/dtools/bin/check-tarball-h-files @@ -0,0 +1,23 @@ +#!/bin/bash + +tarball=$1 +if [ "x$tarball" == "x" ] +then + echo "usage: $0 tarball" 1>&2 + exit 1 +fi + +path=${tarball%%.tar.gz} + +tar tzf $tarball \ + | grep -E '\.(h|py|v)$' \ + | sed -e "s/$path/./" \ + | sort >/tmp/tarball-h-files + +find . \( -name '*.h' -o -name '*.py' \) -print | grep -v ./$path | sort >/tmp/build-h-files + +comm -23 /tmp/build-h-files /tmp/tarball-h-files + +# rm /tmp/tarball-h-files /tmp/build-h-files + + diff --git a/dtools/bin/get-config-files b/dtools/bin/get-config-files new file mode 100755 index 0000000000..9bdffc129c --- /dev/null +++ b/dtools/bin/get-config-files @@ -0,0 +1,6 @@ +#!/bin/bash + +# fetch latest config.guess and config.sub + +wget http://savannah.gnu.org/cgi-bin/viewcvs/config/config/config.guess?rev=HEAD&content-type=text/plain +wget http://savannah.gnu.org/cgi-bin/viewcvs/config/config/config.sub?rev=HEAD&content-type=text/plain diff --git a/dtools/bin/incr_release b/dtools/bin/incr_release new file mode 100755 index 0000000000..167192e2b5 --- /dev/null +++ b/dtools/bin/incr_release @@ -0,0 +1,37 @@ +#!/usr/bin/env python +# +# Copyright 2005 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio 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 2, or (at your option) +# any later version. +# +# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +from optparse import OptionParser +import release_tools +import os.path + +def main(): + parser = OptionParser() + parser.add_option('-f', '--final', action='store_true', default=False) + (options, args) = parser.parse_args() + + for f in args: + release_tools.incr_release(os.path.join(f, 'configure.ac'), options.final) + +if __name__ == '__main__': + main() + diff --git a/dtools/bin/make-upload b/dtools/bin/make-upload new file mode 100755 index 0000000000..73a0feb63a --- /dev/null +++ b/dtools/bin/make-upload @@ -0,0 +1,12 @@ +#!/bin/bash + +read -s -p "GPG Passphrase: " passphrase + +for file in "$@" +do + echo "directory: gnuradio" > $file.directive + echo "$passphrase" | gpg --passphrase-fd 0 --clearsign $file.directive + rm $file.directive + echo "$passphrase" | gpg --passphrase-fd 0 -b $file +done +passphrase="XYZabcdefhghakdsj;lasjdf;ajfdiuiwjr;lajv;laoisfuaoieurlkajdsflkajsdfoiuew" diff --git a/dtools/bin/show_release b/dtools/bin/show_release new file mode 100755 index 0000000000..a4eff60512 --- /dev/null +++ b/dtools/bin/show_release @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# +# Copyright 2005 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio 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 2, or (at your option) +# any later version. +# +# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +from optparse import OptionParser +import release_tools +import os.path + +def main(): + parser = OptionParser() + (options, args) = parser.parse_args() + + for f in args: + print release_tools.get_release(os.path.join(f, 'configure.ac')) + +if __name__ == '__main__': + main() + diff --git a/dtools/bin/tag_release b/dtools/bin/tag_release new file mode 100755 index 0000000000..883b94b4eb --- /dev/null +++ b/dtools/bin/tag_release @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# +# Copyright 2005 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio 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 2, or (at your option) +# any later version. +# +# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# + +from optparse import OptionParser +import release_tools +import os +import os.path +import sys + +def main(): + parser = OptionParser() + (options, args) = parser.parse_args() + + exit_code = 0 + for d in args: + f = os.path.join(d, 'configure.ac') + rel = release_tools.get_release(f) + if rel is None: + raise ValueError, "%s: couldn't find version" % (f,) + tag = release_tools.make_tag(rel) + cmd = '(cd %s; cvs tag %s)' % (d, tag) + print cmd + exit_code = exit_code | os.system(cmd) + + sys.exit(exit_code) + +if __name__ == '__main__': + main() |