1 |
commit: 7e66abd0a28b088f3a657f483b1ed091b5d9a938 |
2 |
Author: André Erdmann <dywi <AT> mailerd <DOT> de> |
3 |
AuthorDate: Wed Jun 5 18:04:02 2013 +0000 |
4 |
Commit: André Erdmann <dywi <AT> mailerd <DOT> de> |
5 |
CommitDate: Wed Jun 5 18:04:02 2013 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=7e66abd0 |
7 |
|
8 |
roverlay/main: --fixup-category-move[-reverse] |
9 |
|
10 |
--- |
11 |
roverlay/argutil.py | 30 ++++++++++++++++++++++++++++-- |
12 |
roverlay/main.py | 5 +++++ |
13 |
2 files changed, 33 insertions(+), 2 deletions(-) |
14 |
|
15 |
diff --git a/roverlay/argutil.py b/roverlay/argutil.py |
16 |
index 689fe78..90d95df 100644 |
17 |
--- a/roverlay/argutil.py |
18 |
+++ b/roverlay/argutil.py |
19 |
@@ -88,7 +88,9 @@ def get_parser ( command_map, default_config_file, default_command='create' ): |
20 |
), |
21 |
add_help=True, |
22 |
formatter_class=argparse.RawDescriptionHelpFormatter, |
23 |
- ) |
24 |
+ ) |
25 |
+ |
26 |
+ incremental_mutex = parser.add_mutually_exclusive_group() |
27 |
|
28 |
arg = parser.add_argument |
29 |
opt_in = dict ( default=False, action='store_true' ) |
30 |
@@ -223,6 +225,28 @@ def get_parser ( command_map, default_config_file, default_command='create' ): |
31 |
action='store_true', |
32 |
) |
33 |
|
34 |
+ incremental_mutex.add_argument ( |
35 |
+ '--fixup-category-move', |
36 |
+ help=''' |
37 |
+ remove packages from the default category |
38 |
+ if they exist in another one |
39 |
+ ''', |
40 |
+ dest='fixup_category_move', |
41 |
+ default=None, |
42 |
+ action='store_true' |
43 |
+ ) |
44 |
+ |
45 |
+ incremental_mutex.add_argument ( |
46 |
+ '--fixup-category-move-reverse', |
47 |
+ help=''' |
48 |
+ remove packages from other categories if they exist in the |
49 |
+ default one |
50 |
+ ''', |
51 |
+ default=None, |
52 |
+ dest='fixup_category_move_rev', |
53 |
+ action='store_true' |
54 |
+ ) |
55 |
+ |
56 |
arg ( |
57 |
'--stats', |
58 |
help="print some stats", |
59 |
@@ -288,7 +312,7 @@ def get_parser ( command_map, default_config_file, default_command='create' ): |
60 |
# --no-incremental currently means that an existing overlay won't be |
61 |
# scanned for ebuilds (which means that ebuilds will be recreated), |
62 |
# but old ebuilds won't be explicitly removed |
63 |
- arg ( |
64 |
+ incremental_mutex.add_argument ( |
65 |
'--no-incremental', |
66 |
help="start overlay creation from scratch (ignore an existing overlay)", |
67 |
dest='incremental', |
68 |
@@ -365,6 +389,8 @@ def parse_argv ( command_map, **kw ): |
69 |
incremental = p.incremental, |
70 |
immediate_ebuild_writes = p.immediate_ebuild_writes, |
71 |
dump_file = p.dump_file, |
72 |
+ fixup_category_move = p.fixup_category_move, |
73 |
+ fixup_category_move_rev = p.fixup_category_move_rev, |
74 |
) |
75 |
|
76 |
if given ( 'overlay' ): |
77 |
|
78 |
diff --git a/roverlay/main.py b/roverlay/main.py |
79 |
index ab75099..a0ca8e4 100644 |
80 |
--- a/roverlay/main.py |
81 |
+++ b/roverlay/main.py |
82 |
@@ -272,6 +272,11 @@ def main ( |
83 |
|
84 |
overlay_creator.release_package_rules() |
85 |
|
86 |
+ if OPTION ( 'fixup_category_move' ): |
87 |
+ overlay_creator.remove_moved_ebuilds ( reverse=False ) |
88 |
+ elif OPTION ( 'fixup_category_move_rev' ): |
89 |
+ overlay_creator.remove_moved_ebuilds ( reverse=True ) |
90 |
+ |
91 |
overlay_creator.run ( close_when_done=True ) |
92 |
|
93 |
optionally ( overlay_creator.write_overlay, 'write_overlay' ) |