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 4E677138CCE for ; Sun, 17 May 2015 02:28:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E9D74E093E; Sun, 17 May 2015 02:28:41 +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 9A13EE093E for ; Sun, 17 May 2015 02:28:41 +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 C5FD4340FB4 for ; Sun, 17 May 2015 02:28:40 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A84189C8 for ; Sun, 17 May 2015 02:28:38 +0000 (UTC) From: "Devan Franchini" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Devan Franchini" Message-ID: <1431829607.bfbfdd01c9d143015c5f08fb29410d980f498594.twitch153@gentoo> Subject: [gentoo-commits] proj/webapp-config:experimental commit in: WebappConfig/ X-VCS-Repository: proj/webapp-config X-VCS-Files: WebappConfig/config.py X-VCS-Directories: WebappConfig/ X-VCS-Committer: twitch153 X-VCS-Committer-Name: Devan Franchini X-VCS-Revision: bfbfdd01c9d143015c5f08fb29410d980f498594 X-VCS-Branch: experimental Date: Sun, 17 May 2015 02:28:38 +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: 8d9f5f1a-e148-4b4e-ac76-51ca85a0c264 X-Archives-Hash: 21190796cb229ce1e5b68a741668dc0a commit: bfbfdd01c9d143015c5f08fb29410d980f498594 Author: Devan Franchini gentoo org> AuthorDate: Sun May 17 02:26:44 2015 +0000 Commit: Devan Franchini gentoo org> CommitDate: Sun May 17 02:26:47 2015 +0000 URL: https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=bfbfdd01 config.py: Adds optionality to --dir flag If the --dir flag is not specified with actions that require the dir flag then webapp-config will default to the name of the package as the installation directory. WebappConfig/config.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/WebappConfig/config.py b/WebappConfig/config.py index 06dfc4c..c9c0baf 100644 --- a/WebappConfig/config.py +++ b/WebappConfig/config.py @@ -429,8 +429,9 @@ class Config: '--dir', nargs = 1, help = 'Install into DIR under the' - ' htdocs dir. The default is ' - + self.config.get('USER', 'g_installdir')) + ' htdocs dir. Not specifying using this flag' + ' will result in defaulting to the package ' + ' name.') inst_locs.add_argument('-h', '--host', @@ -891,7 +892,6 @@ class Config: # Map command line options into the configuration option_to_config = {'host' : 'vhost_hostname', - 'dir' : 'g_installdir', 'server' : 'vhost_server', 'secure' : 'g_secure', 'user' : 'vhost_config_uid', @@ -1009,6 +1009,15 @@ class Config: pvr += argsvr[i] self.config.set('USER', 'pvr', pvr) + if not options['dir'] and self.work != 'list_installs': + pn = self.config.get('USER', 'pn') + msg = 'Install dir flag not supplied, defaulting to '\ + '"%(pn)s".' % {'pn': pn} + + OUT.warn(msg) + self.config.set('USER', 'g_installdir', pn) + self.flag_dir = True + # -------------------------------------------------------------------- # Helper functions