* 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'))
|
||||
|
||||
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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user