From 931b8fd779fd2766a8601707a5b1842e3d6f3d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCdepohl?= <dev@stellardeath.org> Date: Tue, 26 Oct 2021 17:49:03 +0200 Subject: [PATCH] Add "--diff", "--only-project" to home project setup Also, colorful diffs --- mpcdf_common.py | 2 +- mpcdf_setup_home_project.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mpcdf_common.py b/mpcdf_common.py index 6ab446d..fc058a5 100644 --- a/mpcdf_common.py +++ b/mpcdf_common.py @@ -904,7 +904,7 @@ Macros: new.write(s2) new.close() - call(["diff", "-s", "-u", old.name, "--label", "old-prjconf", new.name, "--label", "new-prjconf"]) + call(["diff", "--color=auto", "-s", "-u", old.name, "--label", label1, new.name, "--label", label2]) os.unlink(old.name) os.unlink(new.name) diff --git a/mpcdf_setup_home_project.py b/mpcdf_setup_home_project.py index bda9462..c85b88e 100644 --- a/mpcdf_setup_home_project.py +++ b/mpcdf_setup_home_project.py @@ -11,10 +11,14 @@ import osc.cmdln @osc.cmdln.option('-n', '--dry-run', action="store_true", help="Do not actually run anything but output the resulting XML configuration") +@osc.cmdln.option('--diff', action="store_true", + help="Show (only) differences of prjconf and project meta") @osc.cmdln.option('--remove-old', action="store_true", default=False, help="Remove all obsolete repositories instead of only disabling builds for packages there") @osc.cmdln.option('--remove-old-matching', default=None, help="Remove all obsolete repositories matching this regular expression") +@osc.cmdln.option('--only-project', action="store_true", + help="Only change project metadata, do not iterate over packages and change their enabled repositories") @osc.cmdln.option('--distribution', metavar="DIST", nargs=1, help="Base distribution, necessary argument unless set previously for this project. " "Valid arguments are the names of any repository in the 'software' project.") -- GitLab