File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed
GNU-Parallel/aurpkg/scripts Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -44,19 +44,18 @@ pkgbuild="https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h"
44
44
45
45
run_tests () {
46
46
pkg=" $1 "
47
- out_dir= " $2 "
47
+ mkcd " ${OUT} / $pkg " || exit 1
48
48
49
- mkcd " ${out_dir} / $pkg " || exit 1
49
+ curl --insecure -o PKGBUILD " $pkgbuild = $pkg " 2> /dev/null || echo ' '
50
50
51
- curl --insecure -o PKGBUILD " $pkgbuild =$pkg " 2> /dev/null || echo ' '
52
-
53
- # Info: Fetch required PGP keys from PKGBUILD (commented in the original script)
51
+ # Fetch required pgp keys from PKGBUILD (optional)
54
52
# gpg --recv-keys $(sed -n "s:^validpgpkeys=('\([0-9A-Fa-fx]\+\)').*$:\1:p" PKGBUILD)
53
+ # Some failure is expected here, so we ignore the return code
55
54
makedeb -d >> " ../$pkg .txt" 2>&1
56
55
cd - > /dev/null || exit 1
57
56
}
58
- export -f run_tests
57
+ export -f run_tests mkcd
59
58
export pkgbuild
60
59
61
60
# Read package names from the input file and process them in parallel
62
- cat " $IN " | tr ' \n ' ' ' | parallel --jobs " $( nproc ) " run_tests {} " $OUT "
61
+ parallel run_tests :::: " $IN "
Original file line number Diff line number Diff line change 25
25
[[ -n " $input_file " ]] || { echo " script was not provided with \$ input_file" ; exit 1; }
26
26
[[ -n " $statistics_dir " ]] || { echo " script was not provided with \$ statistics_dir" ; exit 1; }
27
27
28
- mkdir -p " $statistics_dir "
29
-
30
- cut -c 89-92 " $input_file " |
31
- grep -v 999 |
32
- sort -n |
33
- tee >( head -n1 > " ${statistics_dir} /min.txt " ) \
34
- >( tail -n1 > " ${statistics_dir} /max.txt " ) |
35
- awk ' { total += $1; count++ } END { print total/count } ' > " ${statistics_dir} /average.txt "
28
+ mkdir -p " ${ statistics_dir} "
29
+
30
+ tee < " ${input_file} " | cut -c 89-92 | grep -v 999 | sort -rn | head -n1 > " ${statistics_dir} /max.txt " &
31
+ tee < " ${input_file} " | cut -c 89-92 | grep -v 999 | sort -n | head -n1 > " ${statistics_dir} /min.txt " &
32
+ tee < " ${input_file} " | cut -c 89-92 | grep -v 999 | awk ' { total += $1; count++ } END { print total/count } ' > " ${statistics_dir} /average.txt " &
33
+
34
+ wait
35
+
You can’t perform that action at this time.
0 commit comments