From 4af747cb2a25eb5cb9bce1c560676e75d8153121 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Mon, 17 Apr 2023 10:19:28 -0700 Subject: Add sync --no-vcs If --no-vcs is given along with --download and/or --upload, the SVN operations are skipped but the download and/or upload will go ahead. This replaces the same functionality that was lost when the bug with --dry-run was fixed in commit da90dea3. --- MgaRepo/commands/sync.py | 3 +++ MgaRepo/rpmutil.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/MgaRepo/commands/sync.py b/MgaRepo/commands/sync.py index 9f318e1..51b6f45 100644 --- a/MgaRepo/commands/sync.py +++ b/MgaRepo/commands/sync.py @@ -15,6 +15,7 @@ Options: --dry-run Print results without changing the working copy --download -d Try to download the source files not found + --no-vcs Don't touch any files under source control (use with -d & -u) --upload -u Upload changed source files and update sha1.lst -h Show this message @@ -26,6 +27,8 @@ def parse_options(): parser = OptionParser(help=HELP) parser.add_option("--dry-run", dest="dryrun", default=False, action="store_true") + parser.add_option("--no-vcs", dest="vcs", default=True, + action="store_false") # TODO: # Completely remove -c switch from code parser.add_option("-c", dest="commit", default=False, diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py index b71afb0..a99c08a 100644 --- a/MgaRepo/rpmutil.py +++ b/MgaRepo/rpmutil.py @@ -514,7 +514,7 @@ def ispkgtopdir(path=None): names = os.listdir(path) return (".svn" in names and "SPECS" in names and "SOURCES" in names) -def sync(dryrun=False, commit=False, download=False, up=False): +def sync(dryrun=False, vcs=True, commit=False, download=False, up=False): svn = SVN() topdir = getpkgtopdir() spath = binrepo.sources_path(topdir) @@ -590,11 +590,11 @@ def sync(dryrun=False, commit=False, download=False, up=False): toremove.append(path) for path in toremove: print("D\t%s" % path) - if not dryrun: + if not dryrun and vcs: delete([path], commit=commit) for path in toadd: print("A\t%s" % path) - if not dryrun: + if not dryrun and vcs: upload([path], commit=commit) # check binrepo files changed = binrepo.check_sources(topdir) -- cgit v1.2.1