File: change_program_exit_to_success.patch

package info (click to toggle)
stacks 2.68%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,092 kB
  • sloc: cpp: 41,356; sh: 3,497; python: 1,410; perl: 1,388; makefile: 148
file content (340 lines) | stat: -rw-r--r-- 10,609 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
Description: Fix exit codes to be successful and output to stdout.
Author: Lance Lin <lq27267@gmail.com>
Last-Update: 2024-01-19

--- stacks.orig/scripts/stacks-gdb
+++ stacks/scripts/stacks-gdb
@@ -28,10 +28,10 @@
 "
 
 if [[ $# -eq 0 ]] ;then
-    echo -n "$usage" >&2
+    echo -n "$usage"
     echo
     echo -n "$gdb_req"
-    exit 1
+    exit 0
 fi
 
 if ! command -v gdb &>/dev/null ;then
--- stacks.orig/scripts/stacks-samtools-tview
+++ stacks/scripts/stacks-samtools-tview
@@ -28,15 +28,15 @@
 sample=
 if (( $# == 0 )) ;then
     echo -n "$help"
-    exit 1
+    exit 0
 fi
 while getopts 'vhP:c:s:' op ;do
     case $op in
     P) dir="$OPTARG" ;;
     c) locus="$OPTARG" ;;
     s) sample="$OPTARG" ;;
-    h) echo -n "$help"; exit 1 ;;
-    v) echo "$stacks_version"; exit 1 ;;
+    h) echo -n "$help"; exit 0 ;;
+    v) echo "$stacks_version"; exit 0 ;;
     *) echo "ERROR: while parsing arguments." >&2; exit 1 ;;
     esac
 done
--- stacks.orig/src/sstacks.cc
+++ stacks/src/sstacks.cc
@@ -1429,13 +1429,13 @@
 }
 
 void version() {
-    cerr << "sstacks " << VERSION << "\n\n";
+    cout << "sstacks " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "sstacks " << VERSION << "\n"
+    cout << "sstacks " << VERSION << "\n"
               << "sstacks -P dir -M popmap [-t n_threads]" << "\n"
               << "sstacks -c catalog_path -s sample_path [-s sample_path ...] -o path [-t n_threads]" << "\n"
               << "  -P,--in-path: path to the directory containing Stacks files.\n"
@@ -1451,10 +1451,10 @@
               ;
 
 #ifdef DEBUG
-    cerr << "\n"
+    cout << "\n"
             "Debug options:\n"
             "  --write-all-matches: Write blacklisted matches. (Compatibility with the web interface?)\n";
 #endif
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/process_radtags.cc
+++ stacks/src/process_radtags.cc
@@ -2566,13 +2566,13 @@
 }
 
 void version() {
-    cerr << "process_radtags " << VERSION << "\n\n";
+    cout << "process_radtags " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "process_radtags " << VERSION << "\n"
+    cout << "process_radtags " << VERSION << "\n"
 	 << "process_radtags -p in_dir [-P] [-b barcode_file] -o out_dir -e enz [--threads num] [-c] [-q] [-r] [-t len]\n"
          << "process_radtags -f in_file [-b barcode_file] -o out_dir -e enz [--threads num] [-c] [-q] [-r] [-t len]\n"
          << "process_radtags --in-path in_dir [--paired] [--barcodes barcode_file] --out-path out_dir --renz-1 enz [--renz-2 enz] [--threads num] [-c] [-q] [-r] [-t len]\n"
@@ -2613,20 +2613,20 @@
     uint cnt = renz_cnt.size();
     it = renz_cnt.begin();
     for (uint i = 1; i <= cnt; i++) {
-        cerr << "'" << it->first << "'";
+        cout << "'" << it->first << "'";
         if (i < cnt - 1)
-            cerr << ", ";
+            cout << ", ";
         else if (i == cnt - 1)
-            cerr << ", or ";
+            cout << ", or ";
 
         if (i % 8 == 0)
-            cerr << "\n      ";
+            cout << "\n      ";
 
         it++;
     }
-    cerr << "\n";
+    cout << "\n";
 
-    cerr << "\n"
+    cout << "\n"
          << "  Protocol-specific options:\n"
          << "    --bestrad: library was generated using BestRAD, check for restriction enzyme on either read and potentially tranpose reads.\n"
 	 << "    --methylrad: library was generated using enzymatic methyl-seq (EM-seq) or bisulphite sequencing.\n\n"
@@ -2651,5 +2651,5 @@
          << "    --barcode-dist-1: the number of allowed mismatches when rescuing single-end barcodes (default 1).\n"
          << "    --barcode-dist-2: the number of allowed mismatches when rescuing paired-end barcodes (defaults to --barcode-dist-1).\n";
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/scripts/denovo_map.pl
+++ stacks/scripts/denovo_map.pl
@@ -920,13 +920,13 @@
 }
 
 sub version {
-    print STDERR "denovo_map.pl ", stacks_version, "\n";
+    print STDOUT "denovo_map.pl ", stacks_version, "\n";
 }
 
 sub usage {
     version();
 
-    print STDERR <<EOQ;
+    print STDOUT <<EOQ;
 denovo_map.pl --samples dir --popmap path --out-path dir [--paired [--rm-pcr-duplicates]] (assembly options) (filtering options) [-X prog:"opts" ...]
 
   Input/Output files:
@@ -964,5 +964,5 @@
     --time-components (for benchmarking)
 EOQ
 
-    exit 1;
+    exit 0;
 }
--- stacks.orig/scripts/ref_map.pl
+++ stacks/scripts/ref_map.pl
@@ -416,13 +416,13 @@
 }
 
 sub version {
-    print STDERR "ref_map.pl ", stacks_version, "\n";
+    print STDOUT "ref_map.pl ", stacks_version, "\n";
 }
 
 sub usage {
     version();
 
-    print STDERR <<EOQ;
+    print STDOUT <<EOQ;
 ref_map.pl --samples path --popmap path [-s spacer] --out-path path [--rm-pcr-duplicates] [-X prog:"opts" ...]
 
   Input/Output files:
@@ -456,5 +456,5 @@
   Miscellaneous:
     --time-components (for benchmarking)
 EOQ
-    exit 1;
+    exit 0;
 }
--- stacks.orig/src/clone_filter.cc
+++ stacks/src/clone_filter.cc
@@ -1311,13 +1311,13 @@
 }
 
 void version() {
-    std::cerr << "clone_filter " << VERSION << "\n\n";
+    std::cout << "clone_filter " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    std::cerr << "clone_filter " << VERSION << "\n"
+    std::cout << "clone_filter " << VERSION << "\n"
               << "clone_filter [-f in_file | -p in_dir [-P] [-I] | -1 pair_1 -2 pair_2] -o out_dir [-i type] [-y type] [-D] [-h]\n"
               << "  f: path to the input file if processing single-end sequences.\n"
               << "  p: path to a directory of files.\n"
@@ -1342,5 +1342,5 @@
               << "    --inline-index:  random oligo is inline with sequence on single-end read and second oligo occurs in FASTQ header.\n"
               << "    --index-inline:  random oligo occurs in FASTQ header (Illumina i5 or i7 read) and is inline with sequence on single-end read (if single read data) or paired-end read (if paired data).\n\n";
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/cstacks.cc
+++ stacks/src/cstacks.cc
@@ -1999,13 +1999,13 @@
 }
 
 void version() {
-    cerr << "cstacks " << VERSION << "\n";
+    cout << "cstacks " << VERSION << "\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "cstacks " << VERSION << "\n"
+    cout << "cstacks " << VERSION << "\n"
               << "cstacks -P in_dir -M popmap [-n num_mismatches] [-t num_threads]" << "\n"
               << "cstacks -s sample1_path [-s sample2_path ...] -o path [-n num_mismatches] [-t num_threads]" << "\n"
               << "\n"
@@ -2026,5 +2026,5 @@
               << "  --k-len <len>: specify k-mer size for matching between between catalog loci (automatically calculated by default).\n"
               << "  --report-mmatches: report query loci that match more than one catalog locus.\n";
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/phasedstacks.cc
+++ stacks/src/phasedstacks.cc
@@ -1938,13 +1938,13 @@
 }
 
 void version() {
-    cerr << "phasedstacks " << VERSION << "\n\n";
+    cout << "phasedstacks " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "phasedstacks " << VERSION << "\n"
+    cout << "phasedstacks " << VERSION << "\n"
               << "phasedstacks -b id -S path -P path -t file_type [-p threads] [-M popmap] [-v] [-h]" << "\n"
               << "  b: Stacks batch ID.\n"
               << "  P: path to the phased output files.\n"
@@ -1963,5 +1963,5 @@
               << "  --min-inform-pairs: when building D' haplotype blocks, the minimum number of informative D' measures to combine two blocks (default 0.9).\n\n";
 
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/populations.cc
+++ stacks/src/populations.cc
@@ -4384,5 +4384,5 @@
          #endif
          ;
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/process_shortreads.cc
+++ stacks/src/process_shortreads.cc
@@ -1120,13 +1120,13 @@
 }
 
 void version() {
-    cerr << "process_shortreads " << VERSION << "\n\n";
+    cout << "process_shortreads " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "process_shortreads " << VERSION << "\n"
+    cout << "process_shortreads " << VERSION << "\n"
               << "process_shortreads [-f in_file | -p in_dir [-P] [-I] | -1 pair_1 -2 pair_2] -b barcode_file -o out_dir [-i type] [-y type] [-c] [-q] [-r] [-E encoding] [-t len] [-D] [-w size] [-s lim] [-h]\n"
               << "  f: path to the input file if processing single-end seqeunces.\n"
               << "  i: input file type, either 'bustard' for the Illumina BUSTARD format, 'bam', 'fastq' (default), or 'gzfastq' for gzipped FASTQ.\n"
@@ -1170,5 +1170,5 @@
               << "    --mate-pair: raw reads are circularized mate-pair data, first read will be reverse complemented.\n"
               << "    --no-overhang: data does not contain an overhang nucleotide between barcode and seqeunce.\n";
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/ustacks.cc
+++ stacks/src/ustacks.cc
@@ -3013,13 +3013,13 @@
 }
 
 void version() {
-    cerr << "ustacks " << VERSION << "\n\n";
+    cout << "ustacks " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "ustacks " << VERSION << "\n"
+    cout << "ustacks " << VERSION << "\n"
          << "ustacks -f in_path -o out_path [-M max_dist] [-m min_reads] [-t num_threads]" << "\n"
          << "  -f,--file: input file path.\n"
          << "  -o,--out-path: output path to write results.\n"
@@ -3055,5 +3055,5 @@
          << "\n"
          << "  h: display this help message.\n";
 
-    exit(1);
+    exit(0);
 }
--- stacks.orig/src/kmer_filter.cc
+++ stacks/src/kmer_filter.cc
@@ -1800,13 +1800,13 @@
 }
 
 void version() {
-    cerr << "kmer_filter " << VERSION << "\n\n";
+    cout << "kmer_filter " << VERSION << "\n\n";
 
-    exit(1);
+    exit(0);
 }
 
 void help() {
-    cerr << "kmer_filter " << VERSION << "\n"
+    cout << "kmer_filter " << VERSION << "\n"
               << "kmer_filter [-f in_file_1 [-f in_file_2...] | -p in_dir] [-1 pair_1 -2 pair_2 [-1 pair_1...]] -o out_dir [-i type] [-y type] [-D] [-h]\n"
               << "  f: path to the input file if processing single-end seqeunces.\n"
               << "  i: input file type, either 'bustard' for the Illumina BUSTARD output files, 'fasta', 'fastq', 'gzfasta', or 'gzfastq' (default 'fastq').\n"
@@ -1834,5 +1834,5 @@
               << "    --read-k-freq <path>: read a set of kmers along with their frequencies of occurrence instead of reading raw input files.\n"
               << "\n";
 
-    exit(1);
+    exit(0);
 }