Browse Source

Split-fork from qecc

All other files have been moved to *fastfood* and whole qecc
history (~300 commits) has been squashed into this commit.
Alois Mahdal 10 years ago
parent
commit
e7cf95d428
24 changed files with 1580 additions and 1 deletions
  1. 1
    0
      .gitignore
  2. 344
    0
      LICENSE
  3. 40
    0
      Makefile
  4. 1
    1
      README
  5. 43
    0
      bin/ccfn.in
  6. 39
    0
      bin/eeabrt.in
  7. 74
    0
      bin/eeget.in
  8. 100
    0
      bin/eeiam.in
  9. 109
    0
      bin/eeln.in
  10. 178
    0
      bin/eemk.in
  11. 83
    0
      bin/eepush.in
  12. 74
    0
      bin/eerevert.in
  13. 82
    0
      bin/eewatch.in
  14. 14
    0
      bin/eewww.in
  15. 6
    0
      config.mk
  16. 52
    0
      notes/guidelines.md
  17. 108
    0
      setup/mk.sh
  18. 6
    0
      utils/cleanall.sh
  19. 102
    0
      utils/repeat.sh
  20. 98
    0
      utils/trigger.sh
  21. 11
    0
      utils/unbt.sh
  22. 5
    0
      utils/waiter.sh
  23. 3
    0
      utils/waste_ktime
  24. 7
    0
      utils/waste_utime

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+.autoclean

+ 344
- 0
LICENSE View File

@@ -0,0 +1,344 @@
1
+		    GNU GENERAL PUBLIC LICENSE
2
+		       Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
5
+                       51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+			    Preamble
10
+
11
+  The licenses for most software are designed to take away your
12
+freedom to share and change it.  By contrast, the GNU General Public
13
+License is intended to guarantee your freedom to share and change free
14
+software--to make sure the software is free for all its users.  This
15
+General Public License applies to most of the Free Software
16
+Foundation's software and to any other program whose authors commit to
17
+using it.  (Some other Free Software Foundation software is covered by
18
+the GNU Library General Public License instead.)  You can apply it to
19
+your programs, too.
20
+
21
+  When we speak of free software, we are referring to freedom, not
22
+price.  Our General Public Licenses are designed to make sure that you
23
+have the freedom to distribute copies of free software (and charge for
24
+this service if you wish), that you receive source code or can get it
25
+if you want it, that you can change the software or use pieces of it
26
+in new free programs; and that you know you can do these things.
27
+
28
+  To protect your rights, we need to make restrictions that forbid
29
+anyone to deny you these rights or to ask you to surrender the rights.
30
+These restrictions translate to certain responsibilities for you if you
31
+distribute copies of the software, or if you modify it.
32
+
33
+  For example, if you distribute copies of such a program, whether
34
+gratis or for a fee, you must give the recipients all the rights that
35
+you have.  You must make sure that they, too, receive or can get the
36
+source code.  And you must show them these terms so they know their
37
+rights.
38
+
39
+  We protect your rights with two steps: (1) copyright the software, and
40
+(2) offer you this license which gives you legal permission to copy,
41
+distribute and/or modify the software.
42
+
43
+  Also, for each author's protection and ours, we want to make certain
44
+that everyone understands that there is no warranty for this free
45
+software.  If the software is modified by someone else and passed on, we
46
+want its recipients to know that what they have is not the original, so
47
+that any problems introduced by others will not reflect on the original
48
+authors' reputations.
49
+
50
+  Finally, any free program is threatened constantly by software
51
+patents.  We wish to avoid the danger that redistributors of a free
52
+program will individually obtain patent licenses, in effect making the
53
+program proprietary.  To prevent this, we have made it clear that any
54
+patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+  The precise terms and conditions for copying, distribution and
57
+modification follow.
58
+
59
+		    GNU GENERAL PUBLIC LICENSE
60
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+  0. This License applies to any program or other work which contains
63
+a notice placed by the copyright holder saying it may be distributed
64
+under the terms of this General Public License.  The "Program", below,
65
+refers to any such program or work, and a "work based on the Program"
66
+means either the Program or any derivative work under copyright law:
67
+that is to say, a work containing the Program or a portion of it,
68
+either verbatim or with modifications and/or translated into another
69
+language.  (Hereinafter, translation is included without limitation in
70
+the term "modification".)  Each licensee is addressed as "you".
71
+
72
+Activities other than copying, distribution and modification are not
73
+covered by this License; they are outside its scope.  The act of
74
+running the Program is not restricted, and the output from the Program
75
+is covered only if its contents constitute a work based on the
76
+Program (independent of having been made by running the Program).
77
+Whether that is true depends on what the Program does.
78
+
79
+  1. You may copy and distribute verbatim copies of the Program's
80
+source code as you receive it, in any medium, provided that you
81
+conspicuously and appropriately publish on each copy an appropriate
82
+copyright notice and disclaimer of warranty; keep intact all the
83
+notices that refer to this License and to the absence of any warranty;
84
+and give any other recipients of the Program a copy of this License
85
+along with the Program.
86
+
87
+You may charge a fee for the physical act of transferring a copy, and
88
+you may at your option offer warranty protection in exchange for a fee.
89
+
90
+  2. You may modify your copy or copies of the Program or any portion
91
+of it, thus forming a work based on the Program, and copy and
92
+distribute such modifications or work under the terms of Section 1
93
+above, provided that you also meet all of these conditions:
94
+
95
+    a) You must cause the modified files to carry prominent notices
96
+    stating that you changed the files and the date of any change.
97
+
98
+    b) You must cause any work that you distribute or publish, that in
99
+    whole or in part contains or is derived from the Program or any
100
+    part thereof, to be licensed as a whole at no charge to all third
101
+    parties under the terms of this License.
102
+
103
+    c) If the modified program normally reads commands interactively
104
+    when run, you must cause it, when started running for such
105
+    interactive use in the most ordinary way, to print or display an
106
+    announcement including an appropriate copyright notice and a
107
+    notice that there is no warranty (or else, saying that you provide
108
+    a warranty) and that users may redistribute the program under
109
+    these conditions, and telling the user how to view a copy of this
110
+    License.  (Exception: if the Program itself is interactive but
111
+    does not normally print such an announcement, your work based on
112
+    the Program is not required to print an announcement.)
113
+
114
+These requirements apply to the modified work as a whole.  If
115
+identifiable sections of that work are not derived from the Program,
116
+and can be reasonably considered independent and separate works in
117
+themselves, then this License, and its terms, do not apply to those
118
+sections when you distribute them as separate works.  But when you
119
+distribute the same sections as part of a whole which is a work based
120
+on the Program, the distribution of the whole must be on the terms of
121
+this License, whose permissions for other licensees extend to the
122
+entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+Thus, it is not the intent of this section to claim rights or contest
125
+your rights to work written entirely by you; rather, the intent is to
126
+exercise the right to control the distribution of derivative or
127
+collective works based on the Program.
128
+
129
+In addition, mere aggregation of another work not based on the Program
130
+with the Program (or with a work based on the Program) on a volume of
131
+a storage or distribution medium does not bring the other work under
132
+the scope of this License.
133
+
134
+  3. You may copy and distribute the Program (or a work based on it,
135
+under Section 2) in object code or executable form under the terms of
136
+Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+    a) Accompany it with the complete corresponding machine-readable
139
+    source code, which must be distributed under the terms of Sections
140
+    1 and 2 above on a medium customarily used for software
141
+    interchange; or,
142
+
143
+    b) Accompany it with a written offer, valid for at least three
144
+    years, to give any third party, for a charge no more than your
145
+    cost of physically performing source distribution, a complete
146
+    machine-readable copy of the corresponding source code, to be
147
+    distributed under the terms of Sections 1 and 2 above on a medium
148
+    customarily used for software interchange; or,
149
+
150
+    c) Accompany it with the information you received as to the offer
151
+    to distribute corresponding source code.  (This alternative is
152
+    allowed only for noncommercial distribution and only if you
153
+    received the program in object code or executable form with such
154
+    an offer, in accord with Subsection b above.)
155
+
156
+The source code for a work means the preferred form of the work for
157
+making modifications to it.  For an executable work, complete source
158
+code means all the source code for all modules it contains, plus any
159
+associated interface definition files, plus the scripts used to
160
+control compilation and installation of the executable.  However, as a
161
+special exception, the source code distributed need not include
162
+anything that is normally distributed (in either source or binary
163
+form) with the major components (compiler, kernel, and so on) of the
164
+operating system on which the executable runs, unless that component
165
+itself accompanies the executable.
166
+
167
+If distribution of executable or object code is made by offering
168
+access to copy from a designated place, then offering equivalent
169
+access to copy the source code from the same place counts as
170
+distribution of the source code, even though third parties are not
171
+compelled to copy the source along with the object code.
172
+
173
+  4. You may not copy, modify, sublicense, or distribute the Program
174
+except as expressly provided under this License.  Any attempt
175
+otherwise to copy, modify, sublicense or distribute the Program is
176
+void, and will automatically terminate your rights under this License.
177
+However, parties who have received copies, or rights, from you under
178
+this License will not have their licenses terminated so long as such
179
+parties remain in full compliance.
180
+
181
+  5. You are not required to accept this License, since you have not
182
+signed it.  However, nothing else grants you permission to modify or
183
+distribute the Program or its derivative works.  These actions are
184
+prohibited by law if you do not accept this License.  Therefore, by
185
+modifying or distributing the Program (or any work based on the
186
+Program), you indicate your acceptance of this License to do so, and
187
+all its terms and conditions for copying, distributing or modifying
188
+the Program or works based on it.
189
+
190
+  6. Each time you redistribute the Program (or any work based on the
191
+Program), the recipient automatically receives a license from the
192
+original licensor to copy, distribute or modify the Program subject to
193
+these terms and conditions.  You may not impose any further
194
+restrictions on the recipients' exercise of the rights granted herein.
195
+You are not responsible for enforcing compliance by third parties to
196
+this License.
197
+
198
+  7. If, as a consequence of a court judgment or allegation of patent
199
+infringement or for any other reason (not limited to patent issues),
200
+conditions are imposed on you (whether by court order, agreement or
201
+otherwise) that contradict the conditions of this License, they do not
202
+excuse you from the conditions of this License.  If you cannot
203
+distribute so as to satisfy simultaneously your obligations under this
204
+License and any other pertinent obligations, then as a consequence you
205
+may not distribute the Program at all.  For example, if a patent
206
+license would not permit royalty-free redistribution of the Program by
207
+all those who receive copies directly or indirectly through you, then
208
+the only way you could satisfy both it and this License would be to
209
+refrain entirely from distribution of the Program.
210
+
211
+If any portion of this section is held invalid or unenforceable under
212
+any particular circumstance, the balance of the section is intended to
213
+apply and the section as a whole is intended to apply in other
214
+circumstances.
215
+
216
+It is not the purpose of this section to induce you to infringe any
217
+patents or other property right claims or to contest validity of any
218
+such claims; this section has the sole purpose of protecting the
219
+integrity of the free software distribution system, which is
220
+implemented by public license practices.  Many people have made
221
+generous contributions to the wide range of software distributed
222
+through that system in reliance on consistent application of that
223
+system; it is up to the author/donor to decide if he or she is willing
224
+to distribute software through any other system and a licensee cannot
225
+impose that choice.
226
+
227
+This section is intended to make thoroughly clear what is believed to
228
+be a consequence of the rest of this License.
229
+
230
+  8. If the distribution and/or use of the Program is restricted in
231
+certain countries either by patents or by copyrighted interfaces, the
232
+original copyright holder who places the Program under this License
233
+may add an explicit geographical distribution limitation excluding
234
+those countries, so that distribution is permitted only in or among
235
+countries not thus excluded.  In such case, this License incorporates
236
+the limitation as if written in the body of this License.
237
+
238
+  9. The Free Software Foundation may publish revised and/or new versions
239
+of the General Public License from time to time.  Such new versions will
240
+be similar in spirit to the present version, but may differ in detail to
241
+address new problems or concerns.
242
+
243
+Each version is given a distinguishing version number.  If the Program
244
+specifies a version number of this License which applies to it and
245
+"any later version", you have the option of following the terms and
246
+conditions either of that version or of any later version published by
247
+the Free Software Foundation.  If the Program does not specify a
248
+version number of this License, you may choose any version ever
249
+published by the Free Software Foundation.
250
+
251
+  10. If you wish to incorporate parts of the Program into other free
252
+programs whose distribution conditions are different, write to the author
253
+to ask for permission.  For software which is copyrighted by the Free
254
+Software Foundation, write to the Free Software Foundation; we sometimes
255
+make exceptions for this.  Our decision will be guided by the two goals
256
+of preserving the free status of all derivatives of our free software and
257
+of promoting the sharing and reuse of software generally.
258
+
259
+			    NO WARRANTY
260
+
261
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
262
+WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
263
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
264
+OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
265
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
266
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
267
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
268
+PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
269
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
270
+
271
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
272
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
273
+AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
274
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
275
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
276
+PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
277
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
278
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
279
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
280
+DAMAGES.
281
+
282
+		     END OF TERMS AND CONDITIONS
283
+
284
+	    How to Apply These Terms to Your New Programs
285
+
286
+  If you develop a new program, and you want it to be of the greatest
287
+possible use to the public, the best way to achieve this is to make it
288
+free software which everyone can redistribute and change under these
289
+terms.
290
+
291
+  To do so, attach the following notices to the program.  It is safest
292
+to attach them to the start of each source file to most effectively
293
+convey the exclusion of warranty; and each file should have at least
294
+the "copyright" line and a pointer to where the full notice is found.
295
+
296
+    <one line to give the program's name and a brief idea of what it does.>
297
+    Copyright (C) <year>  <name of author>
298
+
299
+    This program is free software; you can redistribute it and/or modify
300
+    it under the terms of the GNU General Public License as published by
301
+    the Free Software Foundation; either version 2 of the License, or
302
+    (at your option) any later version.
303
+
304
+    This program is distributed in the hope that it will be useful,
305
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
306
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
307
+    GNU General Public License for more details.
308
+
309
+    You should have received a copy of the GNU General Public License
310
+    along with this program; if not, write to the Free Software
311
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
312
+
313
+
314
+Also add information on how to contact you by electronic and paper mail.
315
+
316
+If the program is interactive, make it output a short notice like this
317
+when it starts in an interactive mode:
318
+
319
+    Gnomovision version 69, Copyright (C) year name of author
320
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
321
+    This is free software, and you are welcome to redistribute it
322
+    under certain conditions; type `show c' for details.
323
+
324
+The hypothetical commands `show w' and `show c' should show the appropriate
325
+parts of the General Public License.  Of course, the commands you use may
326
+be called something other than `show w' and `show c'; they could even be
327
+mouse-clicks or menu items--whatever suits your program.
328
+
329
+You should also get your employer (if you work as a programmer) or your
330
+school, if any, to sign a "copyright disclaimer" for the program, if
331
+necessary.  Here is a sample; alter the names:
332
+
333
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
334
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
335
+
336
+  <signature of Ty Coon>, 1 April 1989
337
+  Ty Coon, President of Vice
338
+
339
+This General Public License does not permit incorporating your program into
340
+proprietary programs.  If your program is a subroutine library, you may
341
+consider it more useful to permit linking proprietary applications with the
342
+library.  If this is what you want to do, use the GNU Library General
343
+Public License instead of this License.
344
+

+ 40
- 0
Makefile View File

@@ -0,0 +1,40 @@
1
+# eecc - Eclectic Engineer's Control Center
2
+# See LICENSE file for copyright and license details.
3
+
4
+include config.mk
5
+
6
+all: options built.list
7
+
8
+built.list:
9
+	@setup/mk.sh eecc
10
+
11
+options:
12
+	@echo eecc build options:
13
+	@echo "VERSION  = ${VERSION}"
14
+	@echo "PREFIX   = ${PREFIX}"
15
+
16
+install_manpages: manpages
17
+	@setup/mk.sh install_manpages
18
+
19
+manpages:
20
+	@setup/mk.sh manpages
21
+
22
+eecc:
23
+	@setup/mk.sh eecc
24
+
25
+test: install
26
+	@setup/mk.sh test
27
+
28
+clean:
29
+	@setup/mk.sh clean
30
+
31
+dist: clean
32
+	@setup/mk.sh dist
33
+
34
+install: all
35
+	@setup/mk.sh install
36
+
37
+uninstall:
38
+	@setup/mk.sh uninstall
39
+
40
+.PHONY: all options clean dist install test uninstall

+ 1
- 1
README View File

@@ -1,4 +1,4 @@
1
-QECC
1
+EECC
2 2
 ====
3 3
 
4 4
 Quality Engineering Control Centre

+ 43
- 0
bin/ccfn.in View File

@@ -0,0 +1,43 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+
5
+ffood import core
6
+ffood import recon
7
+
8
+
9
+usage() {
10
+    usage_is "[-I|--include module] [--] function [args...]"
11
+}
12
+
13
+includes=""
14
+FFOOD_DEBUG=false
15
+
16
+while true; do
17
+    case $1 in
18
+        -d|--debug)
19
+            FFOOD_DEBUG=true
20
+            shift 1
21
+            ;;
22
+        -I|--include)
23
+            includes=$includes:$2
24
+            shift 2
25
+            ;;
26
+        "")
27
+            usage
28
+            ;;
29
+        --)
30
+            shift 1
31
+            break
32
+            ;;
33
+        *)
34
+            break;
35
+            ;;
36
+    esac;
37
+done
38
+
39
+for i in $(tr ":" " " <<<"$includes"); do
40
+    ffood import $i
41
+done
42
+
43
+"$@"

+ 39
- 0
bin/eeabrt.in View File

@@ -0,0 +1,39 @@
1
+#!/bin/bash
2
+
3
+# Take a core dump and try to analyze it with ABRT
4
+
5
+. __FFOOD_INIT__
6
+
7
+ffood import core
8
+
9
+usage() {
10
+    usage_is "exename"
11
+}
12
+
13
+while true;
14
+do
15
+    case $1 in
16
+        -d) FFOOD_DEBUG=true ;;
17
+        "") break ;;
18
+        *) cmd=$1; shift; ;;
19
+    esac
20
+done
21
+test -n "$cmd" || usage
22
+
23
+exe=$(which $cmd)
24
+cmp=$(rpm --queryformat "%{NAME}" -qf $exe)
25
+dirname=crash-$cmd
26
+
27
+debug -v exe:cmp
28
+
29
+mkdir $dirname
30
+cp core.* $dirname/coredump
31
+cd $dirname
32
+
33
+# make ABRT feel like home
34
+date +%s > time
35
+echo CCpp > type
36
+echo $cmp > component
37
+echo $exe > executable
38
+
39
+abrt-action-analyze-ccpp-local

+ 74
- 0
bin/eeget.in View File

@@ -0,0 +1,74 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import yummy
8
+
9
+usage() {
10
+    usage_is "[-d] [-f] NVRLIST" \
11
+             "[-d] -n NVR -t DEST"
12
+}
13
+
14
+while true; do case $1 in
15
+    -b|--brewroot)  brewroot=$2;        shift 2;        ;;
16
+    -f|--file)      nvrlist=$2;         shift 2; break; ;;
17
+    -n|--nvr)       nvr=$2;             shift 2;        ;;
18
+    -t|--to)        dest=$2;            shift 2;        ;;
19
+    -d|--debug)     FFOOD_DEBUG=true;   shift;          ;;
20
+    *)              nvrlist=$1;         shift;   break  ;;
21
+esac done
22
+
23
+test -n "$brewroot" || brewroot=$(iniread -p get.brewroot get.ini)
24
+test -n "$brewroot" || die "specify '-b /path/to/brewroot or get.brewroot in get.ini"
25
+test -d "$brewroot" || die "cannot access brewroot: $brewroot"
26
+
27
+get_nvr() {
28
+    local nvr=$1
29
+    local dest=$2
30
+
31
+    local arch="$(nvc_parse arch $nvr)"
32
+    local release="$(nvc_parse release $nvr)"
33
+    local version="$(nvc_parse version $nvr)"
34
+    local name="$(nvc_parse name $nvr)"
35
+
36
+    debug -v nvr:arch:release:version:name:dest
37
+
38
+    rm -rf $dest
39
+    mkdir -p $dest
40
+    local pkgroot="$brewroot/packages/$name/$version/$release"
41
+    rsync -u "$pkgroot/$arch/"* "$dest"
42
+    test -f "$pkgroot/noarch/"* && rsync -u "$pkgroot/noarch/"* "$dest"
43
+    $FFOOD_VERBOSE && find $dest -type f
44
+
45
+}
46
+
47
+if test -n "$nvrlist";     # NVR list provided; make up DESTs and call self
48
+then
49
+    dirname="rpms.$(basename $nvrlist)"
50
+    rm -f rpms
51
+    archs=$(iniread -k arch < $nvrlist | paste -sd,)
52
+    if test -z "$archs";
53
+    then
54
+        warn "archs not specified, using $(which arch)"
55
+        archs=$(arch)
56
+    fi
57
+    for arch in $(tr "," " " <<<"$archs");
58
+    do
59
+        get_nvr $(iniread -k old < $nvrlist).$arch "$dirname/old/$arch"
60
+        get_nvr $(iniread -k new < $nvrlist).$arch "$dirname/new/$arch"
61
+    done
62
+    ln -s $dirname rpms
63
+
64
+elif test -n "$nvr" -a -n "$dest";      # NVR and DEST provided -- do your job
65
+then
66
+    get_nvr "$nvr" "$dest"
67
+else
68
+    usage
69
+fi
70
+
71
+# tigervnc-1.2.80/0.23.20130314svn5065.el7$
72
+#   |||||
73
+#   vvvvv
74
+# /brewroot/packages/tigervnc/1.2.80/0.23.20130314svn5065.el7$

+ 100
- 0
bin/eeiam.in View File

@@ -0,0 +1,100 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import recon
8
+
9
+
10
+#
11
+# self help
12
+#
13
+
14
+available_commands() {
15
+    echo afk
16
+    echo at
17
+    echo back
18
+    echo gone
19
+    echo moving
20
+    echo ooo
21
+    echo wfh
22
+}
23
+
24
+usage() {
25
+    cmd_hint=$(
26
+        available_commands \
27
+            | head -c -1 \
28
+            | tr '\n' '|'
29
+    )
30
+    usage_is "$cmd_hint"
31
+}
32
+
33
+
34
+#
35
+# querying
36
+#
37
+
38
+familiars_at() {
39
+    test -n "$1" || usagef "location"
40
+    iniread -p iam.needing.at.$1 iam.ini
41
+    iniread -p iam.needing.at.ANY iam.ini
42
+}
43
+
44
+where_i_am() {
45
+    if=$(iniread -p iam.using.if iam.ini)
46
+    gwmac=$(arp | grep "^gateway\\>.*\\<$if\$" | tr ' ' '\n' | grep :)
47
+    iniread -p iam.seeing.gw.$gwmac iam.ini | grep . || echo OUT
48
+}
49
+
50
+
51
+#
52
+# subcommand handlers
53
+#
54
+
55
+i_am_afk() {
56
+    mocp --pause
57
+    slock
58
+}
59
+
60
+i_am_at() {
61
+    where_i_am
62
+}
63
+
64
+i_am_back() {
65
+    local f fbin
66
+    for f in $(familiars_at $(where_i_am));
67
+    do
68
+        fbin=${f/ */}
69
+        pids_matching $f || $f &
70
+    done
71
+    klist || urxvt -e kinit
72
+}
73
+
74
+i_am_gone() {
75
+    kdestroy
76
+    killall $(familiars_at $(where_i_am))
77
+    i_am_afk
78
+    i_am_back
79
+}
80
+
81
+i_am_moving() {
82
+    die "not implemented"   # hint: use zleep
83
+}
84
+
85
+i_am_ooo() {
86
+    die "not implemented"
87
+}
88
+
89
+i_am_wfh() {
90
+    die "not implemented"
91
+}
92
+
93
+cmd=$1
94
+
95
+test -n "$cmd" || usage
96
+
97
+available_commands | grep -qse ^$1 || usage
98
+
99
+
100
+i_am_$cmd

+ 109
- 0
bin/eeln.in View File

@@ -0,0 +1,109 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+
8
+DEFAULT_TARGET=$HOME
9
+TRY_RELPATH=true
10
+FORCE=false
11
+
12
+PY_SCRIPT="
13
+import os.path
14
+import sys
15
+src, dst = sys.argv[1:]
16
+r = os.path.relpath(src, dst)
17
+a = os.path.abspath(src)
18
+if len(a) < len (r):
19
+    print a
20
+else:
21
+    print r
22
+"
23
+
24
+usage() {
25
+    local u
26
+    u="[-d|--debug] [-f|--force] [-v|--verbose]"
27
+    u="$u [-i|--intermediate] [-t|--target TARGET] SOURCE [NAME]"
28
+    usage_is "$u"
29
+}
30
+
31
+link() {
32
+    local src=$1
33
+    local dst=$2
34
+
35
+    debug -v src:dst
36
+
37
+    if $TRY_RELPATH;
38
+    then
39
+        src=$(python <(echo "$PY_SCRIPT") "$src" "$(dirname $dst)")
40
+    fi
41
+
42
+    think "linking $src to $dst"
43
+
44
+    rm -f $dst
45
+    ln -s $src $dst
46
+}
47
+
48
+load() {
49
+    iniread -p ln.dir.$1 ln.ini | expand_tilde | debug_pipe out
50
+}
51
+
52
+while true;
53
+do
54
+    case $1 in
55
+        -d|--debug)
56
+            FFOOD_DEBUG=true
57
+            shift
58
+            ;;
59
+        -f|--force)
60
+            FORCE=true
61
+            shift
62
+            ;;
63
+        -i|--intermediate)
64
+            intermediate=$2
65
+            shift 2
66
+            ;;
67
+        -v|--verbose)
68
+            FFOOD_VERBOSE=true
69
+            shift
70
+            ;;
71
+        -t|--target)
72
+            target=$2
73
+            shift 2
74
+            ;;
75
+        "")
76
+            usage
77
+            ;;
78
+        *)
79
+            src=$1
80
+            name=$2
81
+            break
82
+            ;;
83
+    esac
84
+done
85
+
86
+test -z "$target"               && target=$(load target)
87
+test -z "$intermediate"         && intermediate=$(load intermediate)
88
+test -z "$prefix"               && prefix=$(load prefix)
89
+test -z "$target"               && target=$DEFAULT_TARGET
90
+
91
+case $prefix.$name in
92
+    .)          die "provide at least name or set prefix in ln.ini";;
93
+    $prefix.)   name=$prefix;;
94
+    .$name)     :;;
95
+    *)          name=$prefix.$name;;
96
+esac
97
+
98
+debug -v name:intermediate:target
99
+
100
+mkdir -p $target
101
+
102
+if test -n "$intermediate";
103
+then
104
+    mkdir -p $intermediate
105
+    link $src $intermediate/$name
106
+    link $intermediate/$name $target/$name
107
+else
108
+    link $src $target/$name
109
+fi

+ 178
- 0
bin/eemk.in View File

@@ -0,0 +1,178 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import proj_ol
8
+ffood import testing
9
+ffood import sw
10
+ffood import yummy
11
+
12
+ENVIRON_SCRIPT="$FFOOD_DATA_DIR-local/bash_env"
13
+FFOOD_VERBOSE=true
14
+
15
+# tmp needs to be shared to children
16
+if test -d "$TMP_DIR";
17
+then    # we must be child
18
+    THIS_IS_CHILD=true
19
+else    # we are top parent; need some setup
20
+    THIS_IS_CHILD=false
21
+    export TMP_DIR="$(mktemp -d)"
22
+fi
23
+
24
+[ "$(whoami)" == "root" ] || die "you need to be root"
25
+
26
+yum_install_if_needed wget
27
+
28
+case "$1" in
29
+
30
+
31
+    ## ------ ##
32
+    ## COMMON ##
33
+    ## ------ ##
34
+
35
+    abrtbz)
36
+        echo "Updating abrt to internal version"
37
+        save_repo_for abrtbz
38
+        yum_update "abrt"
39
+        ;;
40
+
41
+    sl0)
42
+        echo "Turning off SELinux"
43
+        setenforce 0
44
+        sed -i~ -e 's/^SELINUX=.*/SELINUX=permissive/' /etc/selinux/config
45
+        ;;
46
+
47
+
48
+    ## ------- ##
49
+    ## OPENLMI ##
50
+    ## ------- ##
51
+
52
+    ## setup  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
53
+
54
+    olbrc)
55
+        LMI_CIMOM_PORT=5989
56
+        mkdir -p "$(dirname $ENVIRON_SCRIPT)"
57
+        echo "Adding ol environment script $ENVIRON_SCRIPT to .bashrc"
58
+        {
59
+            # warning: only echo if not login shell or rsync will freak out
60
+            echo "shopt -q login_shell && echo setting up ol environment variables"
61
+            echo "export LMI_ACCOUNT_USER='account_test_user'"
62
+            echo "export LMI_ACCOUNT_GROUP='account_test_group'"
63
+            echo "export LMI_CIMOM_URL='https://${HOSTNAME}:$LMI_CIMOM_PORT'"
64
+            echo "export LMI_CIMOM_USERNAME='pegasus'"
65
+            echo "export LMI_CIMOM_PASSWORD='blank'"
66
+            echo "export LMI_CIMOM_BROKER='tog-pegasus'"
67
+            echo "export LMI_RUN_DANGEROUS='1'"
68
+            echo "export LMI_IND_LISTENER_PORT='15000'"
69
+            echo "export PYTHONPATH='$PYTHONPATH:$PWD/openlmi-providers/src/python'"
70
+        } > $ENVIRON_SCRIPT
71
+        append_if_missing \
72
+            "test -f $ENVIRON_SCRIPT && . $ENVIRON_SCRIPT" \
73
+            /root/.bashrc
74
+        ;;
75
+
76
+    olconfig)
77
+        $0 sl0
78
+        echo "Bypassing SSL verification"
79
+        echo "127.0.0.1 $(hostname)" >> /etc/hosts
80
+        service tog-pegasus start      # to generate server.pem
81
+        service tog-pegasus stop
82
+        cp "/etc/Pegasus/server.pem" \
83
+           "/etc/pki/ca-trust/source/anchors/remote-server.pem"
84
+        update-ca-trust
85
+        echo "Setting pegasus password"
86
+        echo "pegasus:blank" | chpasswd
87
+        $0 olbrc
88
+        ;;
89
+
90
+    ## runtime  - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
91
+
92
+    olenv)
93
+        . $ENVIRON_SCRIPT
94
+        ;;
95
+
96
+    olcs)
97
+        echo "Starting a simple cimserver ($(comment_cimserver))"
98
+        start_cimserver
99
+        ;;
100
+
101
+    olrun*)
102
+        $0 olcs
103
+        $0 olenv
104
+        iniread -p mk.run.what.$2 mk-ol.ini \
105
+            | while read path;
106
+              do
107
+                  pushd "$(dirname $path)";
108
+                  nosetests --nocapture -v "$(basename $path)"
109
+                  popd
110
+              done
111
+        stop_cimserver
112
+        ;;
113
+
114
+    OL)
115
+        save_repo_for openlmi-scripts
116
+        echo "Installing OpenLMI software"
117
+        iniread -s mk.requires.sut mk-ol.ini | any_install
118
+        echo "Installing testing tools"
119
+        iniread -s mk.requires.test mk-ol.ini | any_install
120
+        $0 olconfig
121
+        ;;
122
+
123
+
124
+    ## --------- ##
125
+    ## BEAKERLIB ##
126
+    ## --------- ##
127
+
128
+    bkrund)
129
+        TERM=xterm reset
130
+        pushd "mk-$2"
131
+        make run > 1
132
+        popd
133
+        ;;
134
+
135
+    bkrun)
136
+        pushd "mk-$2"
137
+        make run
138
+        popd
139
+        ;;
140
+
141
+    ## rpmwork  - - - - - - - - - - - - - - - - - - - - - - - - - - - - ##
142
+
143
+    rpmso)
144
+        path=rpms/old/`arch`
145
+        echo "Deploying old RPMs from $path"
146
+        guess_pkgnames $path | yum_preerase
147
+        yum_install $path/*
148
+        guess_pkgnames $path | installed_versions
149
+        ;;
150
+
151
+    rpmsn)
152
+        path=rpms/new/`arch`
153
+        echo "Deploying new RPMs from $path"
154
+        guess_pkgnames $path | yum_preerase
155
+        yum_install $path/*
156
+        guess_pkgnames $path | installed_versions
157
+        ;;
158
+
159
+    RH)
160
+        save_repo_for beakerlib
161
+        save_repo_for rhpkg
162
+        save_repo_for beakerlib-redhat
163
+        echo "Installing tested software"
164
+        iniread -s mk.requires.sut mk-bk.ini | any_install
165
+        echo "Installing testing tools"
166
+        iniread -s mk.requires.test mk-bk.ini | any_install
167
+        ;;
168
+
169
+    *)
170
+        usage_is "TARGET"
171
+
172
+esac
173
+
174
+if ! $THIS_IS_CHILD;
175
+then
176
+    collect_artifacts artifacts
177
+    rm -rf $TMP_DIR
178
+fi

+ 83
- 0
bin/eepush.in View File

@@ -0,0 +1,83 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import recon
8
+
9
+ORDER="$(iniread -p push.options.order push.ini)"
10
+
11
+while true;
12
+do
13
+    case $1 in
14
+        -d|--debug)     FFOOD_DEBUG=true;     shift;    ;;
15
+        -v|--verbose)   FFOOD_VERBOSE=true;   shift;    ;;
16
+        -q|--quiet)     FFOOD_VERBOSE=false;  shift;    ;;
17
+        -o|--order)     ORDER=$2;             shift 2;  ;;
18
+        -h|--help)      usage;                          ;;
19
+        "")             break                           ;;
20
+        *)              hosts="$1"; shift;              ;;
21
+    esac
22
+done
23
+
24
+test -n "$hosts" || hosts=$(iniread -s push.hosts push.ini | debug_pipe ini_hosts)
25
+debug -v hosts
26
+
27
+test -n "$hosts" || die "no valid hosts to begin with"
28
+paths=$(iniread -s push.paths push.ini)
29
+test -n "$paths" || die "no valid paths to begin with"
30
+
31
+think "Probing & sorting paths"
32
+paths=$(echo "$paths" \
33
+        | expand_tilde \
34
+        | filter test -e \
35
+        | sort_paths_by_age \
36
+        | debug_pipe ok_paths
37
+       )
38
+test -n "$paths" || die "no valid paths"
39
+
40
+think "Probing hosts"
41
+hosts=$(echo "$hosts" | filter_hosts -s | debug_pipe ok_hosts )
42
+test -n "$hosts" || die "no valid hosts"
43
+
44
+test "$(wc -l <<<"$paths")" == 1 && ORDER="path:host"
45
+test "$(wc -l <<<"$hosts")" == 1 && ORDER="host:path"
46
+
47
+think "Pushing (${ORDER/:/, then })..."
48
+
49
+debug -v "paths:hosts"
50
+
51
+case "$ORDER" in
52
+
53
+    "path:host")
54
+        for path in $paths;
55
+        do
56
+            for host in $hosts;
57
+            do
58
+                if rsync -L -r --delete $path $host:
59
+                then
60
+                    think $(collapse_tilde <<<"$path") sent to $host
61
+                fi
62
+            done
63
+        done
64
+    ;;
65
+
66
+    "host:path")
67
+        for host in $hosts;
68
+        do
69
+            for path in $paths;
70
+            do
71
+                if rsync -L -r --delete $path $host:
72
+                then
73
+                    think $host got $path
74
+                fi
75
+            done
76
+        done
77
+        ;;
78
+
79
+    *)
80
+        die "unknown push order: '$ORDER'"
81
+        ;;
82
+
83
+esac

+ 74
- 0
bin/eerevert.in View File

@@ -0,0 +1,74 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import recon
8
+
9
+usage() {
10
+    usage_is "[-d|--debug] [-v|--verbose] [--dry-run] [-c|--connection] domain [snapshot]"
11
+}
12
+
13
+FFOOD_DRY_RUN=false
14
+connection="qemu:///system"
15
+
16
+while true; do
17
+    case $1 in
18
+        -c|--connection)
19
+            connection=$2
20
+            shift 2
21
+            ;;
22
+        -d|--debug)
23
+            FFOOD_DEBUG=true
24
+            shift 1
25
+            ;;
26
+        -q|--quiet)
27
+            FFOOD_VERBOSE=false
28
+            shift 1
29
+            ;;
30
+        -v|--verbose)
31
+            FFOOD_VERBOSE=true
32
+            shift 1
33
+            ;;
34
+        --dry-run)
35
+            FFOOD_DRY_RUN=true
36
+            shift 1
37
+            ;;
38
+        "")
39
+            usage
40
+            ;;
41
+        --)
42
+            shift 1
43
+            break
44
+            ;;
45
+        *)
46
+            break
47
+            ;;
48
+    esac
49
+done
50
+
51
+domain="$1"
52
+snapshot="$2"
53
+
54
+FFOOD_DATA_DIR=/home/amahdal/.eecc
55
+
56
+test -z "$snapshot" && {
57
+    think "looking for $domain in revert.ini"
58
+    snapshot=$(iniread -1 -p revert.to.snapshot.$domain revert.ini)
59
+}
60
+test -z "$snapshot" && {
61
+    think "looking for default snapshot name in revert.ini"
62
+    snapshot=$(iniread -1 -p revert.to.snapshot._default_ revert.ini)
63
+}
64
+test -z "$snapshot" && {
65
+    die "could not determine snapshot for $domain"
66
+}
67
+
68
+think "reverting $domain to $snapshot"
69
+debug "virsh -c "$connection" snapshot-revert $domain $snapshot"
70
+$FFOOD_DRY_RUN || virsh -c "$connection" snapshot-revert $domain $snapshot
71
+
72
+think "starting $domain"
73
+debug "virsh -c "$connection" start $domain"
74
+$FFOOD_DRY_RUN || virsh -c "$connection" start $domain

+ 82
- 0
bin/eewatch.in View File

@@ -0,0 +1,82 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import core
7
+ffood import recon
8
+
9
+FFOOD_DEBUG=false
10
+
11
+interval=2
12
+
13
+report_limits() {
14
+    echo "ulimit -m:$(ulimit -m)"
15
+    echo "ulimit -Sm:$(ulimit -Sm)"
16
+    echo "ulimit -Hm:$(ulimit -Hm)"
17
+    echo "ulimit -n:$(ulimit -n)"
18
+    echo "ulimit -Sn:$(ulimit -Sn)"
19
+    echo "ulimit -Hn:$(ulimit -Hn)"
20
+}
21
+
22
+report_on_pids() {
23
+    local pid
24
+    for pid in "$@";
25
+    do
26
+        echo "$pid:name:$(ps -p $pid -o comm=)"
27
+        echo "$pid:rss:$(ps -p $pid -o rss=)"
28
+        echo "$pid:files:$(lsof -p $pid | wc -l)"
29
+    done
30
+}
31
+
32
+usage() {
33
+    usage_is "[-i INTERVAL] [-d] -p PID[,PID]..." \
34
+             "[-i INTERVAL] [-d] -r REGEX[,REGEX]..."
35
+}
36
+
37
+regexes=""
38
+pids=""
39
+
40
+while true;
41
+do
42
+    case $1 in
43
+        -i|--interval)
44
+            interval=$2
45
+            shift 2
46
+            ;;
47
+        -d|--debug)
48
+            FFOOD_DEBUG=true
49
+            shift 1
50
+            ;;
51
+        -r|--regexes)
52
+            regexes=$2
53
+            shift 2
54
+            ;;
55
+        -p|--pids)
56
+            pids=$2
57
+            shift 2
58
+            ;;
59
+        "")
60
+            if test -z "$regexes" && test -z "$pids";
61
+                then usage;
62
+                else break;
63
+            fi
64
+            ;;
65
+        *)
66
+            usage
67
+            ;;
68
+    esac
69
+done
70
+
71
+pids=$(tr "," " " <<<"$pids")
72
+regexes=$(tr "," " " <<<"$regexes")
73
+
74
+report_limits
75
+while true;
76
+do
77
+    # append PIDS from regexes to pids from command line
78
+    current_pids="$pids $(pids_matching $regexes)"
79
+    debug -v current_pids
80
+    report_on_pids $current_pids
81
+    sleep $interval
82
+done

+ 14
- 0
bin/eewww.in View File

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+. __FFOOD_INIT__
4
+FFOOD_INIPATH="__FFOOD_INIPATH__"
5
+
6
+ffood import www
7
+ffood import xorg
8
+
9
+test -z "$uri" && uri="$(echo "$*" | find_uri)"
10
+test -z "$uri" && uri="$(clipln | find_uri)"
11
+test -z "$uri" && uri="$(iniread -p www.bookmark.default www.ini)"
12
+#test -z "$uri" && uri="http://www.example.com/"
13
+
14
+echo $uri

+ 6
- 0
config.mk View File

@@ -0,0 +1,6 @@
1
+# dwm version
2
+VERSION = 0.0.0
3
+PREFIX = /usr/local
4
+MANPREFIX = ${PREFIX}/share/man
5
+FFOOD_INIPATH_GLOBAL = /etc/eecc
6
+FFOOD_INIPATH_USER = .eecc

+ 52
- 0
notes/guidelines.md View File

@@ -0,0 +1,52 @@
1
+
2
+UI
3
+--
4
+
5
+*   Heavily prefer unix filter UI.
6
+
7
+    If you can't do it with filtering, it could mean you should
8
+    split your function anyway.
9
+
10
+*   Even function can use dash options and even `usagef()`.
11
+
12
+*   Reserved options are
13
+
14
+     *  `-q|--quiet`, to turn off verbosity,
15
+     *  `-v|--verbose`, to turn on verbosity,
16
+     *  and `-d|--debug` to turn on debug output (stderr).
17
+
18
+*   Do not `think()` in functions.
19
+
20
+*   Preferred capitalization in messages is:
21
+
22
+    *   all small for libs (debug/warn/die)
23
+
24
+    *   First cap for scripts
25
+
26
+*   Message width:
27
+
28
+    *   think/warn/die: try hard to never exceed 72
29
+
30
+    *   debug: do what you must
31
+
32
+    *   always try to split message to fixed part, colon and  *before* colon and
33
+        the "data" part after the colon, e.g.:
34
+
35
+            file missing: /var/run/media/somebody/some-medium/some-long/path
36
+
37
+        instead of:
38
+
39
+            file /var/run/media/somebody/some-medium/some-long/path is missing
40
+ 
41
+        (even if you think that it will be short)
42
+
43
+
44
+
45
+
46
+PRINCIPLES
47
+----------
48
+
49
+Be smart but honest: if you can default, default, otherwise be honest = fail
50
+
51
+Don't talk.  `think()` instead.
52
+

+ 108
- 0
setup/mk.sh View File

@@ -0,0 +1,108 @@
1
+#!/bin/bash
2
+# eecc - Eclectic Engineer's Control Center
3
+# See LICENSE file for copyright and license details.
4
+
5
+tmp=$(mktemp)
6
+sed -e 's/ = /=/' < config.mk > $tmp
7
+. $tmp
8
+rm -f $tmp
9
+
10
+bindir=${DESTDIR}${PREFIX}/bin
11
+
12
+list_of_bins() {
13
+    echo bin/eeabrt
14
+    echo bin/eeget
15
+    echo bin/eeiam
16
+    echo bin/eeln
17
+    echo bin/eemk
18
+    echo bin/eepush
19
+    echo bin/eerevert
20
+    echo bin/eewatch
21
+    echo bin/eewww
22
+}
23
+
24
+list_of_installed_bins() {
25
+    list_of_bins | sed -e "s/bin/$(sed -e 's/\//\\\//g' <<<$bindir)/"
26
+}
27
+
28
+die() {
29
+    for l in "$@"; do echo "$l" >&2; done
30
+    exit 9
31
+}
32
+
33
+clean() {
34
+    test -f built.list && {
35
+        cat built.list | xargs rm -f
36
+        rm -f built.list
37
+    } || :
38
+}
39
+
40
+dist() {
41
+    local dirname=eecc-${VERSION}
42
+    mkdir -p $dirname
43
+    cp -R   bin \
44
+            config.mk \
45
+            Makefile \
46
+            README \
47
+            LICENSE \
48
+            setup \
49
+            test \
50
+            utils \
51
+            $dirname
52
+    tar -cf $dirname.tar $dirname
53
+    gzip $dirname.tar
54
+    rm -rf $dirname
55
+    echo $dirname.tar.gz >> built.list
56
+}
57
+
58
+install() {
59
+    mkdir -p $bindir
60
+    list_of_bins | xargs cp -vrt $bindir
61
+    list_of_installed_bins | xargs chmod 755
62
+    test -f .autoclean && clean || :
63
+}
64
+
65
+eecc() {
66
+    fff --library-init >& /dev/null \
67
+        || die "-----" \
68
+               "fastfood not installed or fff is not available for $(id -un)." \
69
+               "In the latter case try running (only) \`make\` under normal" \
70
+               "user and repeating the \`make install\` again." \
71
+               "-----"
72
+    local ffood_init=$(fff --library-init)
73
+    local srcpath dstpath
74
+    find -type f -name '*.in' \
75
+        | while read srcpath;
76
+          do
77
+              dstpath=${srcpath%.in}
78
+              perl -pe "s|__FFOOD_INIT__|$ffood_init|;
79
+                        s|__FFOOD_INIPATH__|$FFOOD_INIPATH_GLOBAL:\\\$HOME/$FFOOD_INIPATH_USER|;
80
+                        s|__VERSION__|$VERSION|;" < $srcpath > $dstpath
81
+              echo $dstpath >> built.list
82
+          done
83
+}
84
+
85
+run_test() {
86
+    pushd test
87
+    find -maxdepth 1 -type f \! -name '*.in' | while read test;
88
+    do
89
+        chmod 0755 $test
90
+        $test || exit $?
91
+    done
92
+    popd
93
+}
94
+
95
+uninstall() {
96
+    list_of_installed_bins | xargs rm -f
97
+}
98
+
99
+case $1 in
100
+    clean|dist|install|install_manpages|manpages|eecc|uninstall)
101
+        $1
102
+        ;;
103
+    test)
104
+        run_test
105
+        ;;
106
+    *)
107
+        echo "usage: $(basename $0) clean|dist|install|eecc|test|uninstall" >&2
108
+esac

+ 6
- 0
utils/cleanall.sh View File

@@ -0,0 +1,6 @@
1
+if [ -z "$1" ];
2
+then
3
+    echo usage: $0 PATTERN ;
4
+    exit 1;
5
+fi
6
+cat /etc/passwd | cut -d: -f1 | grep $1 | while read u; do userdel -r $u; done

+ 102
- 0
utils/repeat.sh View File

@@ -0,0 +1,102 @@
1
+#!/bin/sh
2
+
3
+interval=15
4
+cs_out=cimserver.out
5
+cs_err=cimserver.err
6
+to_collect="$cs_out $cs_err listener.out"
7
+default_out=out
8
+
9
+installdir=$(dirname $0)
10
+
11
+##
12
+
13
+cim_start() {
14
+    cimserver "daemon=false" "forceProviderProcesses=false" \
15
+        >$cs_out \
16
+        2>$cs_err \
17
+        &
18
+}
19
+
20
+cim_stop() {
21
+    killall cimserver
22
+}
23
+
24
+## The Git Monitor
25
+
26
+tgm_init() {
27
+    echo Initializing TGM
28
+    yum -y -q install git &>/dev/null
29
+    pushd $out
30
+    git init
31
+    echo The Git Monitor > README
32
+    git add README
33
+    git commit -qm "Initial commit"
34
+    popd
35
+}
36
+
37
+tgm_add() {
38
+    pushd $out
39
+    git add .
40
+    git commit -qm "Regular commit"
41
+    popd
42
+}
43
+
44
+##
45
+
46
+test_prepare() {
47
+    true
48
+    mkdir -p $out
49
+    cim_start
50
+    $installdir/subscribe.py
51
+    tgm_init
52
+}
53
+
54
+test_setup() {
55
+    true
56
+}
57
+
58
+test_run() {
59
+    $installdir/trigger.sh -N -o $out -u joe
60
+}
61
+
62
+test_collect() {
63
+    cp $to_collect $out
64
+    tgm_add
65
+}
66
+
67
+test_teardown() {
68
+    true
69
+}
70
+
71
+test_cleanup() {
72
+    true
73
+    cim_stop
74
+}
75
+
76
+##
77
+
78
+stamp() {
79
+    date +%Y%m%d-%H%M%S
80
+}
81
+
82
+handler_stop() {
83
+    go_on=false
84
+}
85
+trap handler_stop SIGINT
86
+
87
+
88
+out=$default_out
89
+test_prepare
90
+go_on=true
91
+while $go_on;
92
+do
93
+    echo new round
94
+    echo out=$out
95
+    test_setup
96
+    test_run
97
+    test_collect
98
+    test_teardown
99
+    echo waiting ${interval}s for next round
100
+    sleep $interval
101
+done
102
+test_cleanup

+ 98
- 0
utils/trigger.sh View File

@@ -0,0 +1,98 @@
1
+#!/bin/bash
2
+# trigger.sh
3
+
4
+myip() {
5
+    ip addr \
6
+        | grep 192 \
7
+        | sed 's/^ *//' \
8
+        | cut -d\  -f 2 \
9
+        | cut -d/  -f 1
10
+}
11
+
12
+user=joe
13
+use_tcpdump=true
14
+use_nc_proxy=false
15
+delay=2
16
+verbose=false
17
+out=out/$(date +%Y%m%d-%H%M%S)
18
+srv_port=1234
19
+srv_host=$(myip)
20
+
21
+
22
+while true ; do
23
+    case "$1" in
24
+        -o) out="$2"; shift 2
25
+            ;;
26
+        -u) user="$2"; shift 2
27
+            ;;
28
+        -h) srv_host="$2"; shift 2
29
+            ;;
30
+        -p) srv_port="$2"; shift 2
31
+            ;;
32
+        -P) pxy_port="$2"; shift 2
33
+            ;;
34
+        -d) delay="$2"; shift 2
35
+            ;;
36
+        -t) use_tcpdump=true; shift 1
37
+            ;;
38
+        -T) use_tcpdump=false; shift 1
39
+            ;;
40
+        -n) use_nc_proxy=true; shift 1
41
+            ;;
42
+        -N) use_nc_proxy=false; shift 1
43
+            ;;
44
+        -v) verbose=true; shift 1
45
+            ;;
46
+        --) shift 1
47
+            break;
48
+            ;;
49
+        *)  break;
50
+            ;;
51
+    esac
52
+done
53
+
54
+
55
+tmp=$(mktemp -d)
56
+mkdir -p $out
57
+
58
+start_tcpdump() {
59
+    local pcap=$out/traffic.pcap
60
+    echo starting tcpdump
61
+    yum -q -y install tcpdump &>/dev/null
62
+    tcpdump -i any -w $pcap "port $srv_port" \
63
+        &
64
+}
65
+
66
+start_nc_proxy() {
67
+    local pxy_port=$(($srv_port - 1))
68
+    local back=$tmp/back
69
+    local sent=$out/sent
70
+    local rcvd=$out/rcvd
71
+    echo starting proxy
72
+    mkfifo $back
73
+    cat < $back \
74
+        | nc -k -l -p $pxy_port \
75
+        | tee $sent \
76
+        | nc $srv_host $srv_port \
77
+        | tee $rcvd \
78
+        > $back \
79
+        &
80
+}
81
+
82
+trigger() {
83
+    echo adding + removing $user
84
+    useradd $user
85
+    userdel -r $user
86
+}
87
+
88
+$use_tcpdump && start_tcpdump
89
+$use_nc_proxy && start_nc_proxy
90
+
91
+sleep $delay
92
+
93
+trigger
94
+
95
+echo cleaning up
96
+$use_nc_proxy && killall ncat
97
+$use_tcpdump && killall tcpdump
98
+rm -rf $tmp

+ 11
- 0
utils/unbt.sh View File

@@ -0,0 +1,11 @@
1
+#!/bin/bash
2
+
3
+for bt in backtrace*;
4
+do
5
+    btn=${bt#backtrace}
6
+    cat $bt \
7
+        | grep "^#" \
8
+        | perl -pe 's/(#[0-9]+ +)0x0[0-9a-f]+/$1 0x????/' \
9
+        | sort \
10
+        > fns$btn
11
+done

+ 5
- 0
utils/waiter.sh View File

@@ -0,0 +1,5 @@
1
+#!/bin/sh
2
+
3
+echo I AM $$ and YOU will have to WAIT ${1}s for ME
4
+echo HHHAHAHAHAHA!!!
5
+sleep $1

+ 3
- 0
utils/waste_ktime View File

@@ -0,0 +1,3 @@
1
+#!/bin/sh
2
+
3
+exec dd if=/dev/urandom of=/dev/null bs=100M

+ 7
- 0
utils/waste_utime View File

@@ -0,0 +1,7 @@
1
+#!/bin/sh
2
+
3
+a=1
4
+while true
5
+do
6
+    a=$(( a + 1 ))
7
+done