public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Devan Franchini" <twitch153@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/
Date: Sat, 11 Jul 2015 01:27:42 +0000 (UTC)	[thread overview]
Message-ID: <1436577920.9e251c7574d074e424ea19024f743c754f321979.twitch153@gentoo> (raw)

commit:     9e251c7574d074e424ea19024f743c754f321979
Author:     Devan Franchini <twitch153 <AT> gentoo <DOT> org>
AuthorDate: Sat Jul 11 01:25:17 2015 +0000
Commit:     Devan Franchini <twitch153 <AT> gentoo <DOT> 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


             reply	other threads:[~2015-07-11  1:28 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-11  1:27 Devan Franchini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-06-22 23:04 [gentoo-commits] proj/webapp-config:master commit in: WebappConfig/ Devan Franchini
2017-02-16  3:09 Devan Franchini
2017-02-16  3:09 Devan Franchini
2017-02-16  3:09 Devan Franchini
2017-02-16  3:09 Devan Franchini
2016-05-12 12:42 Anthony G. Basile
2015-07-03  4:50 Devan Franchini
2015-07-02 16:49 Devan Franchini
2015-06-19 22:38 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2015-06-19 19:52 Devan Franchini
2014-01-25  3:17 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-25  3:14 Devan Franchini
2014-01-02  1:47 Devan Franchini
2014-01-01  1:09 Devan Franchini
2013-10-29 19:13 Devan Franchini
2013-10-29  2:40 Devan Franchini
2013-10-29  2:40 Devan Franchini
2013-10-29  2:40 Devan Franchini
2013-10-29  2:40 Devan Franchini
2013-10-29  2:40 Devan Franchini
2013-10-29  2:18 Devan Franchini
2013-10-29  2:18 Devan Franchini
2013-10-29  2:15 Devan Franchini
2013-10-10  0:35 Devan Franchini
2013-09-26  4:03 Devan Franchini
2013-09-26  3:44 Devan Franchini
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-09-24 18:20 Anthony G. Basile
2013-08-06 12:28 Anthony G. Basile
2013-08-06 11:00 Anthony G. Basile
2013-08-06 11:00 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-08-03 13:24 Anthony G. Basile
2013-04-22  0:52 Anthony G. Basile
2013-03-23  4:05 Anthony G. Basile
2013-03-14  2:19 Anthony G. Basile
2013-03-09 13:45 Anthony G. Basile
2013-02-12  3:40 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2012-06-29 13:00 Anthony G. Basile
2011-12-30 17:52 Anthony G. Basile
2011-12-30 17:50 Anthony G. Basile
2011-12-30 17:34 Anthony G. Basile
2011-12-30 17:23 Anthony G. Basile
2011-12-30 17:11 Anthony G. Basile
2011-12-30 16:50 Anthony G. Basile
2011-12-30 16:42 Anthony G. Basile
2011-08-06  1:51 Anthony G. Basile
2011-06-14 15:23 Anthony G. Basile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436577920.9e251c7574d074e424ea19024f743c754f321979.twitch153@gentoo \
    --to=twitch153@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox