diff options
author | Raul Cuza <raulcuza@gmail.com> | 2011-07-05 23:55:47 -0400 |
---|---|---|
committer | Raul Cuza <raulcuza@gmail.com> | 2011-07-06 13:38:00 -0400 |
commit | 6c4f30ab28d8200239350242b545c1021cb084d5 (patch) | |
tree | 6abea5e20623028cd101ffc2a0db88c410429663 /tools | |
parent | d2dfb778793bcf635de64f388b96da595f55740a (diff) | |
download | bcfg2-6c4f30ab28d8200239350242b545c1021cb084d5.tar.gz bcfg2-6c4f30ab28d8200239350242b545c1021cb084d5.tar.bz2 bcfg2-6c4f30ab28d8200239350242b545c1021cb084d5.zip |
Finish converting find_and_replace calls to use dryrun argument.
Set default value to false.
Made the find_and_replace calls multilined.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/export2.py | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/tools/export2.py b/tools/export2.py index 25ac8335e..0b8cc159d 100755 --- a/tools/export2.py +++ b/tools/export2.py @@ -33,7 +33,7 @@ ftpdir = '/mcs/ftp/pub/bcfg' def run(command): return Popen(command, shell=True, stdout=PIPE).communicate() -def find_and_replace(f, iftest, rline, startswith=False, dryrun=True): +def find_and_replace(f, iftest, rline, startswith=False, dryrun=False): if dryrun: inplace=0 print "*** dry-run: New '%s' will look like this:" % f @@ -144,24 +144,37 @@ def main(argv=None): # update solaris version find_and_replace('solaris/Makefile', 'VERS=', - 'VERS=%s-1\n' % version, startswith=True) + 'VERS=%s-1\n' % version, + startswith=True, + dryrun=options.dryrun) find_and_replace('solaris/pkginfo.bcfg2', 'VERSION=', - 'VERSION="%s"\n' % version, startswith=True) + 'VERSION="%s"\n' % version, + startswith=True, + dryrun=options.dryrun) find_and_replace('solaris/pkginfo.bcfg2-server', 'VERSION=', - 'VERSION="%s"\n' % version, startswith=True) + 'VERSION="%s"\n' % version, + startswith=True, + dryrun=options.dryrun) # set new version in setup.py - find_and_replace('setup.py', 'version=', ' version="%s",\n' % version) + find_and_replace('setup.py', 'version=', ' version="%s",\n' % version, + dryrun=options.dryrun) # replace version in misc/bcfg2.spec find_and_replace('misc/bcfg2.spec', 'Version:', - 'Version: %s\n' % version) + 'Version: %s\n' % version, + dryrun=options.dryrun) # update the version in reports find_and_replace('src/lib/Server/Reports/reports/templates/base.html', - 'Bcfg2 Version', ' <span>Bcfg2 Version %s</span>\n' % version) + 'Bcfg2 Version', ' <span>Bcfg2 Version %s</span>\n' % version, + dryrun=options.dryrun) # update the version in the docs find_and_replace('doc/conf.py', 'version =', - 'version = \'%s\'\n' % majorver[0:3], startswith=True) + 'version = \'%s\'\n' % majorver[0:3], + startswith=True, + dryrun=options.dryrun) find_and_replace('doc/conf.py', 'release =', - 'release = \'%s\'\n' % (majorver), startswith=True) + 'release = \'%s\'\n' % (majorver), + startswith=True, + dryrun=options.dryrun) # tag the release #FIXME: do this using python-dulwich |