From 928b0bed6fff9a002fcd10533fd1fa464e1bc10b Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Thu, 3 May 2007 21:03:27 +0000 Subject: Added one cheap copy of the sync subcommand from mdvsys. It required two sensitive changes: - in order to parse the spec file, "rpm" module was used, so this is the brand new package dependency; and - as RepSys already had one "rpm" module, we had to rename it to "simplerpm" in order to allow access to the module from python-rpm (I think py2.4 is still used a lot so we can't use absolute imports) --- RepSys/commands/sync.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 RepSys/commands/sync.py (limited to 'RepSys/commands/sync.py') diff --git a/RepSys/commands/sync.py b/RepSys/commands/sync.py new file mode 100644 index 0000000..42ede8d --- /dev/null +++ b/RepSys/commands/sync.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +from RepSys.command import * +from RepSys.rpmutil import sync + +HELP = """\ +Usage: repsys sync + +Will add or removed from the working copy new files added or removed +from the spec file. + +"No changes are commited." + +Options: + --dry-run Print results without changing the working copy + -h Show this message + +Examples: + repsys sync +""" + +def parse_options(): + parser = OptionParser(help=HELP) + parser.add_option("--dry-run", dest="dryrun", default=False, + action="store_true") + opts, args = parser.parse_args() + if len(args): + opts.target = args[0] + return opts + +def main(): + do_command(parse_options, sync) -- cgit v1.2.1 From 1e929f67375b699cdcac0b1557d115eed7035ae8 Mon Sep 17 00:00:00 2001 From: Bogdano Arendartchuk Date: Fri, 8 Feb 2008 00:43:26 +0000 Subject: Added option -d to sync, to download the missing files It also added a configuration option download-command, in the [global] section to define which command will be used to download. The default is wget. --- RepSys/commands/sync.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'RepSys/commands/sync.py') diff --git a/RepSys/commands/sync.py b/RepSys/commands/sync.py index 42ede8d..a51db22 100644 --- a/RepSys/commands/sync.py +++ b/RepSys/commands/sync.py @@ -12,6 +12,8 @@ from the spec file. Options: --dry-run Print results without changing the working copy + --download -d + Try to download the source files not found -h Show this message Examples: @@ -22,6 +24,8 @@ def parse_options(): parser = OptionParser(help=HELP) parser.add_option("--dry-run", dest="dryrun", default=False, action="store_true") + parser.add_option("-d", "--download", dest="download", default=False, + action="store_true") opts, args = parser.parse_args() if len(args): opts.target = args[0] -- cgit v1.2.1