Gentoo Archives: gentoo-commits

From: "Christian Ruppert (idl0r)" <idl0r@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoolkit r780 - in trunk/gentoolkit: . bin
Date: Thu, 06 May 2010 00:25:35
Message-Id: 20100506002530.93CFD2C3FD@corvid.gentoo.org
1 Author: idl0r
2 Date: 2010-05-06 00:25:29 +0000 (Thu, 06 May 2010)
3 New Revision: 780
4
5 Modified:
6 trunk/gentoolkit/ChangeLog
7 trunk/gentoolkit/bin/revdep-rebuild
8 Log:
9 revdep-rebuild: Make revdep-rebuild more quiet, bug 97073. We might
10 improve that a bit more in the future.
11
12
13 Modified: trunk/gentoolkit/ChangeLog
14 ===================================================================
15 --- trunk/gentoolkit/ChangeLog 2010-05-04 16:25:04 UTC (rev 779)
16 +++ trunk/gentoolkit/ChangeLog 2010-05-06 00:25:29 UTC (rev 780)
17 @@ -1,3 +1,7 @@
18 +2010-05-06: Christian Ruppert <idl0r@g.o>
19 + * revdep-rebuild: Make revdep-rebuild more quiet, bug 97073. We might
20 + improve that a bit more in the future.
21 +
22 2010-04-17: Christian Ruppert <idl0r@g.o>
23 * euse: Make python code of euse python-3 compatible, thanks to Arfrever
24 Frehtes Taifersar Arahesis <arfrever@g.o>.
25
26 Modified: trunk/gentoolkit/bin/revdep-rebuild
27 ===================================================================
28 --- trunk/gentoolkit/bin/revdep-rebuild 2010-05-04 16:25:04 UTC (rev 779)
29 +++ trunk/gentoolkit/bin/revdep-rebuild 2010-05-06 00:25:29 UTC (rev 780)
30 @@ -95,7 +95,7 @@
31 setup_portage
32 setup_search_paths_and_masks
33 get_search_env
34 - echo
35 + [[ $QUIET -ne 1 ]] && echo
36
37 # Search for broken binaries
38 get_files
39 @@ -264,8 +264,11 @@
40 builtin cd; rmdir "$WORKING_DIR"
41 fi
42 fi
43 - echo
44 - einfo "$OK_TEXT... All done. "
45 + if [[ $QUIET -ne 1 ]];
46 + then
47 + echo
48 + einfo "$OK_TEXT... All done. "
49 + fi
50 exit 0
51 }
52 ##
53 @@ -370,10 +373,10 @@
54 --no-ld-path) unset FULL_LD_PATH;;
55 --no-order) unset ORDER_PKGS;;
56 --no-progress) progress() { :; };;
57 - --pretend) EMERGE_OPTIONS+=("--pretend");;
58 - --quiet) echo_v() { :; }
59 - progress() { :; }
60 - quiet=1
61 + --pretend) EMERGE_OPTIONS+=("--pretend")
62 + PRETEND=1;;
63 + --quiet) progress() { :; }
64 + QUIET=1
65 EMERGE_OPTIONS+=($1);;
66 --verbose) VERBOSE=1
67 EMERGE_OPTIONS+=("--verbose");;
68 @@ -409,10 +412,10 @@
69 l) unset FULL_LD_PATH;;
70 o) unset ORDER_PKGS;;
71 P) progress() { :; };;
72 - p) EMERGE_OPTIONS+=("--pretend");;
73 - q) echo_v() { :; }
74 - progress() { :; }
75 - quiet=1
76 + p) EMERGE_OPTIONS+=("--pretend")
77 + PRETEND=1;;
78 + q) progress() { :; }
79 + QUIET=1
80 EMERGE_OPTIONS+=("--quiet");;
81 v) VERBOSE=1
82 EMERGE_OPTIONS+=("--verbose");;
83 @@ -634,16 +637,19 @@
84
85 [[ $VERBOSE ]] && echo $'\n'"$APP_NAME environment:"$'\n'"$new_env"
86
87 - echo
88 - einfo "Checking reverse dependencies"
89 - einfo "Packages containing binaries and libraries $HEAD_TEXT"
90 - einfo "will be emerged."
91 + if [[ $QUIET -ne 1 ]];
92 + then
93 + echo
94 + einfo "Checking reverse dependencies"
95 + einfo "Packages containing binaries and libraries $HEAD_TEXT"
96 + einfo "will be emerged."
97 + fi
98 }
99
100 get_files() {
101 - einfo "Collecting system binaries and libraries"
102 + [[ $QUIET -ne 1 ]] && einfo "Collecting system binaries and libraries"
103 if [[ -r "$FILES_FILE" && -s "$FILES_FILE" ]]; then
104 - einfo "Found existing $FILES_FILE"
105 + [[ $QUIET -ne 1 ]] && einfo "Found existing $FILES_FILE"
106 else
107 # Be safe and remove any extraneous temporary files
108 # Don't remove 0_env.rr - The first file in the array
109 @@ -661,7 +667,7 @@
110 -name '*.so' -o -name '*.so.*' -o -name '*.la' \) -print 2> /dev/null |
111 sort -u > "$FILES_FILE" ||
112 die $? "find failed to list binary files (This is a bug.)"
113 - einfo "Generated new $FILES_FILE"
114 + [[ $QUIET -ne 1 ]] && einfo "Generated new $FILES_FILE"
115 fi
116 }
117 parse_ld_so_conf() {
118 @@ -686,9 +692,9 @@
119 get_ldpath() {
120 local COMPLETE_LD_LIBRARY_PATH
121 [[ $SEARCH_BROKEN && $FULL_LD_PATH ]] || return
122 - einfo 'Collecting complete LD_LIBRARY_PATH'
123 + [[ $QUIET -ne 1 ]] && einfo 'Collecting complete LD_LIBRARY_PATH'
124 if [[ -r "$LDPATH_FILE" && -s "$LDPATH_FILE" ]]; then
125 - einfo "Found existing $LDPATH_FILE."
126 + [[ $QUIET -ne 1 ]] && einfo "Found existing $LDPATH_FILE."
127 else
128 clean_trap "$LDPATH_FILE"
129 # Ensure that the "trusted" lib directories are at the start of the path
130 @@ -702,7 +708,7 @@
131 COMPLETE_LD_LIBRARY_PATH="${COMPLETE_LD_LIBRARY_PATH[*]}"
132 IFS="$OIFS"
133 echo "$COMPLETE_LD_LIBRARY_PATH" > "$LDPATH_FILE"
134 - einfo "Generated new $LDPATH_FILE"
135 + [[ $QUIET -ne 1 ]] && einfo "Generated new $LDPATH_FILE"
136 fi
137 }
138 main_checks() {
139 @@ -718,9 +724,9 @@
140 die 1 "Unable to find $LDPATH_FILE"
141 COMPLETE_LD_LIBRARY_PATH=$(<"$LDPATH_FILE")
142 fi
143 - einfo "Checking dynamic linking $WORKING_TEXT"
144 + [[ $QUIET -ne 1 ]] && einfo "Checking dynamic linking $WORKING_TEXT"
145 if [[ -r "$BROKEN_FILE" && -s "$BROKEN_FILE" ]]; then
146 - einfo "Found existing $BROKEN_FILE."
147 + [[ $QUIET -ne 1 ]] && einfo "Found existing $BROKEN_FILE."
148 else
149 clean_trap "$BROKEN_FILE" "$ERRORS_FILE"
150 files=($(<"$FILES_FILE"))
151 @@ -833,7 +839,7 @@
152 fi
153 [[ -r "$BROKEN_FILE" && -s "$BROKEN_FILE" ]] || clean_exit
154 sort -u "$BROKEN_FILE" -o "$BROKEN_FILE"
155 - einfo "Generated new $BROKEN_FILE"
156 + [[ $QUIET -ne 1 ]] && einfo "Generated new $BROKEN_FILE"
157 fi
158 }
159 get_packages() {
160 @@ -861,7 +867,7 @@
161 echo_v " $target_file -> (none)"
162 fi
163 done < "$BROKEN_FILE"
164 - einfo "Generated new $RAW_FILE and $OWNERS_FILE"
165 + [[ $QUIET -ne 1 ]] && einfo "Generated new $RAW_FILE and $OWNERS_FILE"
166 fi
167 # if we find '(none)' on every line, exit out
168 if ! grep -qvF '(none)' "$OWNERS_FILE"; then
169 @@ -878,12 +884,12 @@
170 fi
171 }
172 clean_packages() {
173 - einfo 'Cleaning list of packages to rebuild'
174 + [[ $QUIET -ne 1 ]] && einfo 'Cleaning list of packages to rebuild'
175 if [[ -r "$PKGS_FILE" && -s "$PKGS_FILE" ]]; then
176 - einfo "Found existing $PKGS_FILE"
177 + [[ $QUIET -ne 1 ]] && einfo "Found existing $PKGS_FILE"
178 else
179 sort -u "$RAW_FILE" > "$PKGS_FILE"
180 - einfo "Generated new $PKGS_FILE"
181 + [[ $QUIET -ne 1 ]] && einfo "Generated new $PKGS_FILE"
182 fi
183 }
184 assign_packages_to_ebuilds() {
185 @@ -902,7 +908,7 @@
186 SLOT=$(</var/db/pkg/$EXACT_PKG/SLOT)
187 echo "$PKG:$SLOT"
188 done < "$PKGS_FILE" > "$EBUILDS_FILE"
189 - einfo "Generated new $EBUILDS_FILE"
190 + [[ $QUIET -ne 1 ]] && einfo "Generated new $EBUILDS_FILE"
191 else
192 einfo 'Nothing to rebuild.'
193 die 1 '(The program should have already quit, so this is a minor bug.)'
194 @@ -916,7 +922,7 @@
195 rebuildList=" $(<"$BROKEN_FILE") "
196 rebuildList=(${rebuildList//[[:space:]]obj[[:space:]]/ })
197 get_file_owner "${rebuildList[@]}" | sed 's/^/=/' > "$EBUILDS_FILE"
198 - einfo "Generated new $EBUILDS_FILE"
199 + [[ $QUIET -ne 1 ]] && einfo "Generated new $EBUILDS_FILE"
200 else
201 einfo 'Nothing to rebuild.'
202 die 1 '(The program should have already quit, so this is a minor bug.)'
203 @@ -940,7 +946,7 @@
204 einfo 'Skipping package ordering'
205 return
206 fi
207 - einfo 'Evaluating package order'
208 + [[ $QUIET -ne 1 ]] && einfo 'Evaluating package order'
209 if [[ -r "$ORDER_FILE" && -s "$ORDER_FILE" ]]; then
210 einfo "Found existing $ORDER_FILE"
211 else
212 @@ -999,7 +1005,7 @@
213 die 1 '(The program should have already quit, so this is a minor bug.)'
214 fi
215 fi
216 - [[ -r "$ORDER_FILE" && -s "$ORDER_FILE" ]] && einfo "Generated new $ORDER_FILE"
217 + [[ -r "$ORDER_FILE" && -s "$ORDER_FILE" && $QUIET -ne 1 ]] && einfo "Generated new $ORDER_FILE"
218 }
219
220 show_unowned_files() {
221 @@ -1050,7 +1056,7 @@
222 setup_search_paths_and_masks() {
223 local configfile sdir mdir skip_me filter_SEARCH_DIRS
224
225 - einfo "Configuring search environment for $APP_NAME"
226 + [[ $QUIET -ne 1 ]] && einfo "Configuring search environment for $APP_NAME"
227
228 # Update the incremental variables using /etc/profile.env, /etc/ld.so.conf,
229 # portage, and the environment
230 @@ -1112,7 +1118,7 @@
231
232 trap - SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM
233
234 - einfo 'All prepared. Starting rebuild'
235 + [[ $QUIET -ne 1 ]] && einfo 'All prepared. Starting rebuild'
236 echo "emerge --oneshot ${EMERGE_DEFAULT_OPTS} ${EMERGE_OPTIONS[@]} $REBUILD_LIST"
237
238 is_real_merge && countdown 10
239 @@ -1133,7 +1139,7 @@
240 ##
241 # Finish up
242 cleanup() {
243 - if (( $(<"$STATUS_FILE") != 0 )); then
244 + if [[ (( $(<"$STATUS_FILE") != 0 )) && ! is_real_merge ]]; then
245 ewarn
246 ewarn "$APP_NAME failed to emerge all packages."
247 ewarn 'you have the following choices:'