* give error if repo is present

This commit is contained in:
Eray Özkural
2006-03-29 11:07:33 +00:00
parent 3e5d0ff1da
commit 44de0f9295
2 changed files with 8 additions and 5 deletions
+6 -3
View File
@@ -305,9 +305,12 @@ def index(dirs, output = 'pisi-index.xml', skip_sources=False):
ctx.ui.info(_('* Index file written'))
def add_repo(name, indexuri):
repo = pisi.repodb.Repo(URI(indexuri))
ctx.repodb.add_repo(name, repo)
ctx.ui.info(_('Repo %s added to system.') % name)
if ctx.repodb.has_repo(name):
raise Error(_('Repo %s already present.') % 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):
if ctx.repodb.has_repo(name):
+2 -2
View File
@@ -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]
indexuri = self.args[1]
else:
name = 'pardus'
indexuri = 'http://paketler.uludag.org.tr/pardus-1.0/pisi-index.xml'
name = 'pardus-1-test'
indexuri = 'http://paketler.uludag.org.tr/pardus-1-test/pisi-index.xmi'
pisi.api.add_repo(name, indexuri)
if ctx.ui.confirm(_('Update PISI database for repository %s?') % name):
pisi.api.update_repo(name)