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 0F568138D11 for ; Sat, 11 Jul 2015 01:28:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C2CF01401D; Sat, 11 Jul 2015 01:27:45 +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 6EB2F1401D for ; Sat, 11 Jul 2015 01:27:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 71C59340988 for ; Sat, 11 Jul 2015 01:27:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A05E575A for ; Sat, 11 Jul 2015 01:27:42 +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: <1436577920.9e251c7574d074e424ea19024f743c754f321979.twitch153@gentoo> Subject: [gentoo-commits] proj/webapp-config:master 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: 9e251c7574d074e424ea19024f743c754f321979 X-VCS-Branch: master Date: Sat, 11 Jul 2015 01:27:42 +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: e33b2e91-f4cd-4360-b5e2-ab6839c5dc3f X-Archives-Hash: fa5ca75f8051ebfe2247a3c254f9780a commit: 9e251c7574d074e424ea19024f743c754f321979 Author: Devan Franchini gentoo org> AuthorDate: Sat Jul 11 01:25:17 2015 +0000 Commit: Devan Franchini gentoo org> CommitDate: Sat Jul 11 01:25:20 2015 +0000 URL: https://gitweb.gentoo.org/proj/webapp-config.git/commit/?id=9e251c75 config.py: Fixes package version checking regression Previously webapp-config would not do any sanity checks when setting the package version. After adding a sanity check in 1.54 I made the mistake of not being flexible enough and this caused a regression that prevented web apps with versions such as "20140929d"[1] to be installed. This commit fixes that while still allowing for some sanity checking. [1]: https://github.com/gentoo/webapp-config/issues/2 WebappConfig/config.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/WebappConfig/config.py b/WebappConfig/config.py index 6c915c3..3a176a0 100644 --- a/WebappConfig/config.py +++ b/WebappConfig/config.py @@ -996,17 +996,20 @@ class Config: OUT.die('Invalid package name') if len(args) > 1: - argsvr = args[1].split('.') - if len(argsvr) == 1: - OUT.die('Invalid package version: %(pvr)s' + pvr = args[1] + has_int = False # A package version should have at least one + # numerical value, but we want to allow for + # the flexibility of having any alphanumeric + # value while checking to make sure it's sane. + + for char in pvr: + if char.isdigit(): + has_int = True + + if not has_int: + OUT.die('Invalid package version: "%(pvr)s"' % {'pvr': args[1]}) - pvr = '' - for i in range(0, len(argsvr)): - if not i == len(argsvr) - 1: - pvr += argsvr[i] + '.' - else: - pvr += argsvr[i] self.config.set('USER', 'pvr', pvr) if (not options['dir'] and