summaryrefslogtreecommitdiffstats
path: root/tools/export.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/export.py')
-rwxr-xr-xtools/export.py49
1 files changed, 34 insertions, 15 deletions
diff --git a/tools/export.py b/tools/export.py
index 0ea6df2af..bdb85de41 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -220,12 +220,12 @@ E.G. 1.2.0pre1 is a valid version.
dryrun=options.dryrun)
find_and_replace('solaris-ips/MANIFEST.bcfg2.header',
'set name=pkg.fmri value="pkg://bcfg2/bcfg2@',
- 'set name=pkg.fmri value="pkg://bcfg2/bcfg2@%s"' % version,
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2@%s"\n' % version,
startswith=True,
dryrun=options.dryrun)
find_and_replace('solaris-ips/MANIFEST.bcfg2-server.header',
'set name=pkg.fmri value="pkg://bcfg2/bcfg2-server@',
- 'set name=pkg.fmri value="pkg://bcfg2/bcfg2-server@%s"' % version,
+ 'set name=pkg.fmri value="pkg://bcfg2/bcfg2-server@%s"\n' % version,
startswith=True,
dryrun=options.dryrun)
find_and_replace('solaris-ips/pkginfo.bcfg2', 'VERSION=',
@@ -248,30 +248,49 @@ E.G. 1.2.0pre1 is a valid version.
find_and_replace('misc/bcfg2-selinux.spec', 'Version:',
'Version: %s\n' % version_release,
dryrun=options.dryrun)
- if version_info['build'] == '':
- find_and_replace('misc/bcfg2.spec', 'Release: ',
- 'Release: 1\n',
+ if version_info['build'].startswith('rc'):
+ find_and_replace('misc/bcfg2.spec', 'global _rc ',
+ '%%global _rc %s\n' % version_info['build'],
dryrun=options.dryrun)
- find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
- 'Release: 1\n',
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _rc ',
+ '%%global _rc %s\n' % version_info['build'],
+ dryrun=options.dryrun)
+ elif version_info['build'].startswith('pre'):
+ find_and_replace('misc/bcfg2.spec', 'global _pre ',
+ '%%global _pre %s\n' % version_info['build'],
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _pre ',
+ '%%global _pre %s\n' % version_info['build'],
dryrun=options.dryrun)
else:
+ # comment out pre/rc
+ find_and_replace('misc/bcfg2.spec', 'global _pre ',
+ '#%%global _pre 2\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _pre ',
+ '#%%global _pre 2\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2.spec', 'global _rc ',
+ '#%%global _rc 1\n',
+ dryrun=options.dryrun)
+ find_and_replace('misc/bcfg2-selinux.spec', 'global _rc ',
+ '#%%global _rc 1\n',
+ dryrun=options.dryrun)
+
find_and_replace('misc/bcfg2.spec', 'Release: ',
- 'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ 'Release: 1%{?_pre_rc}%{?dist}\n',
+ startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', 'Release: ',
- 'Release: 0.%s.%s\n' %
- (version_info['build'][-1], version_info['build']),
+ 'Release: 1%{?_pre_rc}%{?dist}\n',
+ startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', '%setup',
- '%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ '%setup -q -n %{name}-%{version}%{?_pre_rc}\n',
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2-selinux.spec', '%setup',
- '%%setup -q -n %%{name}-%%{version}%s\n' %
- version_info['build'],
+ '%setup -q -n %{name}-%{version}%{?_pre_rc}\n',
startswith=True,
dryrun=options.dryrun)
find_and_replace('misc/bcfg2.spec', 'BuildRoot',