commit:     421b4ac4b2b572653ef9dab7fc5a0f87d5c3bb09
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 13 18:39:51 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Nov 13 18:39:51 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=421b4ac4

maker.py: Skip the protocol verification if it failed to guess one 

---
 layman/maker.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/layman/maker.py b/layman/maker.py
index c7d5139..3393d1b 100644
--- a/layman/maker.py
+++ b/layman/maker.py
@@ -348,9 +348,10 @@ class Interactive(object):
                 sources.append(get_input(msg))
 
                 ovl_type = self.guess_overlay_type(sources[0])
-                msg = 'Is %(type)s the correct overlay type?: '\
-                    % ({'type': ovl_type})
-                correct = get_ans(msg)
+                if ovl_type:
+                    msg = 'Is "%(type)s" the correct overlay type?: '\
+                        % ({'type': ovl_type})
+                    correct = get_ans(msg)
                 while not ovl_type or not correct:
                     msg = 'Please provide overlay type: '
                     ovl_type = self.check_overlay_type(\
@@ -368,9 +369,10 @@ class Interactive(object):
                 sources.append(get_input('Define source URL: '))
 
                 ovl_type = self.guess_overlay_type(sources[0])
-                msg = 'Is %(type)s the correct overlay type?: '\
-                       % ({'type': ovl_type})
-                correct = get_ans(msg)
+                if ovl_type:
+                    msg = 'Is %(type)s the correct overlay type?: '\
+                           % ({'type': ovl_type})
+                    correct = get_ans(msg)
                 while not ovl_type or not correct:
                     msg = 'Please provide overlay type: '
                     ovl_type = self.check_overlay_type(\

Reply via email to