* give error if repo is present
This commit is contained in:
+6
-3
@@ -305,9 +305,12 @@ def index(dirs, output = 'pisi-index.xml', skip_sources=False):
|
|||||||
ctx.ui.info(_('* Index file written'))
|
ctx.ui.info(_('* Index file written'))
|
||||||
|
|
||||||
def add_repo(name, indexuri):
|
def add_repo(name, indexuri):
|
||||||
repo = pisi.repodb.Repo(URI(indexuri))
|
if ctx.repodb.has_repo(name):
|
||||||
ctx.repodb.add_repo(name, repo)
|
raise Error(_('Repo %s already present.') % name)
|
||||||
ctx.ui.info(_('Repo %s added to system.') % name)
|
else:
|
||||||
|
repo = pisi.repodb.Repo(URI(indexuri))
|
||||||
|
ctx.repodb.add_repo(name, repo)
|
||||||
|
ctx.ui.info(_('Repo %s added to system.') % name)
|
||||||
|
|
||||||
def remove_repo(name):
|
def remove_repo(name):
|
||||||
if ctx.repodb.has_repo(name):
|
if ctx.repodb.has_repo(name):
|
||||||
|
|||||||
@@ -874,8 +874,8 @@ NB: We support only local files (e.g., /a/b/c) and http:// URIs at the moment
|
|||||||
name = self.args[0]
|
name = self.args[0]
|
||||||
indexuri = self.args[1]
|
indexuri = self.args[1]
|
||||||
else:
|
else:
|
||||||
name = 'pardus'
|
name = 'pardus-1-test'
|
||||||
indexuri = 'http://paketler.uludag.org.tr/pardus-1.0/pisi-index.xml'
|
indexuri = 'http://paketler.uludag.org.tr/pardus-1-test/pisi-index.xmi'
|
||||||
pisi.api.add_repo(name, indexuri)
|
pisi.api.add_repo(name, indexuri)
|
||||||
if ctx.ui.confirm(_('Update PISI database for repository %s?') % name):
|
if ctx.ui.confirm(_('Update PISI database for repository %s?') % name):
|
||||||
pisi.api.update_repo(name)
|
pisi.api.update_repo(name)
|
||||||
|
|||||||
Reference in New Issue
Block a user