From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 53BCF1389E2 for ; Thu, 1 Jan 2015 05:59:19 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3C509E088F; Thu, 1 Jan 2015 05:59:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B9726E089C for ; Thu, 1 Jan 2015 05:59:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B19163406DC for ; Thu, 1 Jan 2015 05:59:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BBC5AE9F8 for ; Thu, 1 Jan 2015 05:59:04 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091887.89beddf2ccfb320bac1f8d5b2e5964bf4890ac78.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/main.py catalyst/version.py X-VCS-Directories: catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 89beddf2ccfb320bac1f8d5b2e5964bf4890ac78 X-VCS-Branch: pending Date: Thu, 1 Jan 2015 05:59:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a6b3b379-cccd-4b6d-ada0-05bbaeea9144 X-Archives-Hash: 42516d714a0d70d75f0bbf850909cc67 commit: 89beddf2ccfb320bac1f8d5b2e5964bf4890ac78 Author: Brian Dolbec gentoo org> AuthorDate: Thu May 30 19:34:06 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:07 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=89beddf2 Migrate version to use snakeoil's format_version() to append git commit info. This will make tagging releases easy as well as providing better debug info while running live versions of the software. --- catalyst/main.py | 11 +++++++---- catalyst/version.py | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 7fea4e7..ae0abae 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -14,7 +14,6 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from . import __version__ import catalyst.config import catalyst.util from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS @@ -22,6 +21,7 @@ from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse from catalyst.support import CatalystError, find_binary +from catalyst.version import get_version conf_values={} @@ -57,7 +57,7 @@ catalyst -f stage1-specfile.spec 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" @@ -169,8 +169,8 @@ def build_target(addlargs): 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) @@ -204,11 +204,12 @@ def main(): 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"): @@ -264,6 +265,8 @@ def main(): 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) diff --git a/catalyst/version.py b/catalyst/version.py new file mode 100644 index 0000000..03c77e4 --- /dev/null +++ b/catalyst/version.py @@ -0,0 +1,23 @@ +#!/usr/bin/python -OO + +# Maintained in full by: +# Catalyst Team +# Release Engineering Team +# Copyright: 2011 Brian Harring +# License: BSD/GPL2 +# Copied & edited by: Brian Dolbec + +'''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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 20240138ADA for ; Thu, 26 Feb 2015 20:12:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B08F3E08AA; Thu, 26 Feb 2015 20:12:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3F2E9E08AA for ; Thu, 26 Feb 2015 20:12:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 213EB340BCD for ; Thu, 26 Feb 2015 20:12:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4413D129DC for ; Thu, 26 Feb 2015 20:12:43 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1420091887.89beddf2ccfb320bac1f8d5b2e5964bf4890ac78.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/main.py catalyst/version.py X-VCS-Directories: catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 89beddf2ccfb320bac1f8d5b2e5964bf4890ac78 X-VCS-Branch: master Date: Thu, 26 Feb 2015 20:12:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: ae40c895-064c-4aa1-9891-65fe1945cb9a X-Archives-Hash: 6aca526db29a3f02267bc95e4f45df69 Message-ID: <20150226201243.rA5pg_iAOHv2TRyXzWtyaXcJocdx345Os6WJJAAsgmI@z> commit: 89beddf2ccfb320bac1f8d5b2e5964bf4890ac78 Author: Brian Dolbec gentoo org> AuthorDate: Thu May 30 19:34:06 2013 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Thu Jan 1 05:58:07 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=89beddf2 Migrate version to use snakeoil's format_version() to append git commit info. This will make tagging releases easy as well as providing better debug info while running live versions of the software. --- catalyst/main.py | 11 +++++++---- catalyst/version.py | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 7fea4e7..ae0abae 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -14,7 +14,6 @@ import os.path __selfpath__ = os.path.abspath(os.path.dirname(__file__)) -from . import __version__ import catalyst.config import catalyst.util from catalyst.contents import ContentsMap, CONTENTS_DEFINITIONS @@ -22,6 +21,7 @@ from catalyst.defaults import confdefaults, option_messages from catalyst.hash_utils import HashMap, HASH_DEFINITIONS from catalyst.lock import LockInUse from catalyst.support import CatalystError, find_binary +from catalyst.version import get_version conf_values={} @@ -57,7 +57,7 @@ catalyst -f stage1-specfile.spec 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" @@ -169,8 +169,8 @@ def build_target(addlargs): 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) @@ -204,11 +204,12 @@ def main(): 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"): @@ -264,6 +265,8 @@ def main(): 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) diff --git a/catalyst/version.py b/catalyst/version.py new file mode 100644 index 0000000..03c77e4 --- /dev/null +++ b/catalyst/version.py @@ -0,0 +1,23 @@ +#!/usr/bin/python -OO + +# Maintained in full by: +# Catalyst Team +# Release Engineering Team +# Copyright: 2011 Brian Harring +# License: BSD/GPL2 +# Copied & edited by: Brian Dolbec + +'''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