from hash_utils import HashMap
from defaults import contents_definitions
from contents import ContentsMap
-
+from catalyst.version import get_version
__maintainer__="Catalyst <catalyst@gentoo.org>"
-__version__="rewrite-git"
conf_values={}
def version():
- print "Catalyst, version "+__version__
+ print get_version()
print "Copyright 2003-2008 Gentoo Foundation"
print "Copyright 2008-2012 various authors"
print "Distributed under the GNU General Public License version 2.1\n"
def main():
- version()
if os.getuid() != 0:
+ version()
# catalyst cannot be run as a normal user due to chroots, mounts, etc
print "!!! catalyst: This script requires root privileges to operate"
sys.exit(2)
run = False
for o, a in opts:
if o in ("-h", "--help"):
+ version()
usage()
sys.exit(1)
if o in ("-V", "--version"):
- print "Catalyst version "+__version__
+ print get_version()
sys.exit(1)
if o in ("-d", "--debug"):
usage()
sys.exit(2)
+ # made it this far so start by outputting our version info
+ version()
# import configuration file and import our main module using those settings
parse_config(myconfig)
--- /dev/null
+#!/usr/bin/python -OO
+
+# Maintained in full by:
+# Catalyst Team <catalyst@gentoo.org>
+# Release Engineering Team <releng@gentoo.org>
+# Copyright: 2011 Brian Harring <ferringb@gmail.com>
+# License: BSD/GPL2
+# Copied & edited by: Brian Dolbec <dolsen@gentoo.org>
+
+'''Version information and/or git version information
+'''
+
+from snakeoil.version import format_version
+
+__version__="rewrite-git"
+_ver = None
+
+def get_version():
+ """Return: a string describing our version."""
+ global _ver
+ if _ver is None:
+ _ver = format_version('catalyst',__file__, __version__)
+ return _ver