fix release message

This commit is contained in:
Dimitris Zlatanidis 2015-02-25 10:01:08 +02:00
parent 1d06eb2317
commit bf2e677d11
2 changed files with 8 additions and 8 deletions

View file

@ -79,9 +79,8 @@ def select_slack_release(slack_rel):
defined wrong
'''
if slack_rel not in ['stable', 'current']:
print("\n You have not specified the Slackware release.\n"
" Edit file '/etc/slpkg/slpkg.conf' and change the \n"
" value of the variable RELEASE.\n")
return 'FAULT'
return slack_rel
class MetaData(object):
@ -131,6 +130,7 @@ class MetaData(object):
'slackr', 'slonly', 'ktown', 'multi', 'slacke',
'salix', 'slackl', 'rested']
# read value from configuration file
if os.path.isfile('%s%s' % (conf_path, 'slpkg.conf')):
f = open('%s%s' % (conf_path, 'slpkg.conf'), 'r')
conf = f.read()
@ -164,7 +164,7 @@ class MetaData(object):
repositories = [repo.strip() for repo in repositories]
# Check Slackware release
select_slack_release(slack_rel)
slack_rel = select_slack_release(slack_rel)
# Grap sub repositories
ktown_kde_repo = grab_sub_repo(repositories, 'ktown')

View file

@ -28,8 +28,8 @@ from __metadata__ import MetaData as _m
def options():
arguments = [
"\nslpkg - version {0} | set: {1}\n".format(_m.__version__,
_m.slack_rel),
"\nslpkg - version {0} | Slackware release: {1}\n".format(
_m.__version__, _m.slack_rel),
"Slpkg is a user-friendly package manager for Slackware "
"installations\n",
"Commands:",
@ -88,8 +88,8 @@ def usage(repo):
error_repo = ("slpkg: error: repository '{0}' does not exist"
"\n".format(repo))
view = [
"\nslpkg - version {0} | set: {1}\n".format(_m.__version__,
_m.slack_rel),
"\nslpkg - version {0} | Slackware release: {1}\n".format(
_m.__version__, _m.slack_rel),
"Usage: slpkg Commands:",
" [update] [upgrade] [repo-add [repository name] [URL]]",
" [repo-remove [repository]] [repo-list]",