diff --git a/pisi/api.py b/pisi/api.py index 2bc7c511..a7a6409e 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -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): diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 8ae83adb..af545b4d 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -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)