Gentoo Archives: gentoo-commits

From: Sven Eden <sven.eden@×××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/ufed:master commit in: /
Date: Fri, 01 Feb 2013 10:49:52
Message-Id: 1359300962.7db268543c3b6c56aec762b68ba0dd8ea762cc3e.yamakuzure@gentoo
1 commit: 7db268543c3b6c56aec762b68ba0dd8ea762cc3e
2 Author: Sven Eden <sven.eden <AT> gmx <DOT> de>
3 AuthorDate: Sun Jan 27 15:36:02 2013 +0000
4 Commit: Sven Eden <sven.eden <AT> gmx <DOT> de>
5 CommitDate: Sun Jan 27 15:36:02 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=7db26854
7
8 Added the information about global flags affecting at least one installed package.
9
10 ---
11 ufed-curses-checklist.c | 9 ++++++++-
12 ufed-curses.c | 4 +++-
13 2 files changed, 11 insertions(+), 2 deletions(-)
14
15 diff --git a/ufed-curses-checklist.c b/ufed-curses-checklist.c
16 index c483d32..00700bd 100644
17 --- a/ufed-curses-checklist.c
18 +++ b/ufed-curses-checklist.c
19 @@ -56,6 +56,7 @@ enum mask showMasked = show_unmasked; //!< Set whether to show masked, unmasked
20 enum order pkgOrder = pkgs_left; //!< Set whether to display package lists left or right of the description
21 enum scope showScope = show_all; //!< Set whether global, local or all flags are shown
22 int lineCountGlobal;
23 +int lineCountGlobalInstalled;
24 int lineCountLocal;
25 int lineCountLocalInstalled;
26 int lineCountMasked;
27 @@ -114,6 +115,7 @@ static void read_flags(void) {
28
29 // Initialize line count per type:
30 lineCountGlobal = 0;
31 + lineCountGlobalInstalled = 0;
32 lineCountLocal = 0;
33 lineCountLocalInstalled = 0;
34 lineCountMasked = 0;
35 @@ -136,7 +138,7 @@ static void read_flags(void) {
36 &on.start, &on.end,
37 &state.start, &state.end,
38 &ndescr) != 1)
39 - ERROR_EXIT(-1, "flag sscanf failed on line\n\"%s\"\n", line);
40 + ERROR_EXIT(-1, "flag sscanf failed on line %d:\n\"%s\"\n", lineNum, line);
41
42 /* Allocate memory for the struct and the arrays */
43 // struct
44 @@ -219,6 +221,11 @@ static void read_flags(void) {
45 flag->item.isGlobal = true;
46 ++lineCountGlobal;
47 }
48 + else if ('G' == descState) {
49 + flag->item.isGlobal = true;
50 + flag->isInstalled[i] = true;
51 + ++lineCountGlobalInstalled;
52 + }
53 else if ('l' == descState) {
54 ++lineCountLocal;
55 }
56
57 diff --git a/ufed-curses.c b/ufed-curses.c
58 index 8b1b53a..997798b 100644
59 --- a/ufed-curses.c
60 +++ b/ufed-curses.c
61 @@ -32,6 +32,7 @@ extern enum mask showMasked;
62 extern enum order pkgOrder;
63 extern enum scope showScope;
64 extern int lineCountGlobal;
65 +extern int lineCountGlobalInstalled;
66 extern int lineCountLocal;
67 extern int lineCountLocalInstalled;
68 extern int lineCountMasked;
69 @@ -77,7 +78,8 @@ int getListHeight()
70 result += lineCountLocal + lineCountLocalInstalled;
71 }
72 if (show_local != showScope) {
73 - result += lineCountGlobal;
74 + // TODO : add installed/not installed filter
75 + result += lineCountGlobal + lineCountGlobalInstalled;
76 }
77 }