aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys/commands
diff options
context:
space:
mode:
authorBogdano Arendartchuk <bogdano@mandriva.org>2007-06-05 19:17:27 +0000
committerBogdano Arendartchuk <bogdano@mandriva.org>2007-06-05 19:17:27 +0000
commit5f1a15b9c7b253c0267d05613683ac1fb5f88e6c (patch)
tree691b3689c17df655db9a075c5d4853b99e217d42 /RepSys/commands
parent5c221808ecb832d3419bb96002ede1a553ed7b73 (diff)
downloadmgarepo-5f1a15b9c7b253c0267d05613683ac1fb5f88e6c.tar
mgarepo-5f1a15b9c7b253c0267d05613683ac1fb5f88e6c.tar.gz
mgarepo-5f1a15b9c7b253c0267d05613683ac1fb5f88e6c.tar.bz2
mgarepo-5f1a15b9c7b253c0267d05613683ac1fb5f88e6c.tar.xz
mgarepo-5f1a15b9c7b253c0267d05613683ac1fb5f88e6c.zip
Improved (and fixed) the support to mirrors and "switch" subcommand
- added the switch subcommand to quickly switch between the default and the mirrored repositories - fixed bug of generating bogus mirror URLs - make "ci" smarter by only relocation if something has been changed in the working copy and it is not already relocated.
Diffstat (limited to 'RepSys/commands')
-rw-r--r--RepSys/commands/switch.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/RepSys/commands/switch.py b/RepSys/commands/switch.py
new file mode 100644
index 0000000..dcbdd17
--- /dev/null
+++ b/RepSys/commands/switch.py
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+from RepSys.command import *
+from RepSys.rpmutil import switch
+
+HELP = """\
+Usage: repsys switch [URL]
+
+Relocates the working copy to the base location URL. If URL is not
+provided, it will use the option default_parent from repsys.conf as
+default, or, if the current working copy is already based in
+default_parent, it will use the location from the mirror option from
+repsys.conf.
+
+If the current work is based in another URL, it will use default_parent.
+
+Options:
+ -h Show this message
+
+Examples:
+ repsys switch
+ repsys switch https://mirrors.localnetwork/svn/packages/cooker
+"""
+
+def parse_options():
+ parser = OptionParser(help=HELP)
+ opts, args = parser.parse_args()
+ if len(args):
+ opts.mirrorurl = args[0]
+ return opts
+
+def main():
+ do_command(parse_options, switch)