1 |
commit: b246a4aa6846c43791bff586c154877719f8830c |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 1 22:21:56 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 1 22:21:56 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/eselect-rust.git/commit/?id=b246a4aa |
7 |
|
8 |
Fix code style |
9 |
|
10 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
11 |
|
12 |
rust.eselect.in | 24 +++++++++++++----------- |
13 |
1 file changed, 13 insertions(+), 11 deletions(-) |
14 |
|
15 |
diff --git a/rust.eselect.in b/rust.eselect.in |
16 |
index 8e4ea3a..9de7149 100644 |
17 |
--- a/rust.eselect.in |
18 |
+++ b/rust.eselect.in |
19 |
@@ -1,4 +1,4 @@ |
20 |
-# Copyright 1999-2019 Gentoo Authors |
21 |
+# Copyright 1999-2020 Gentoo Authors |
22 |
# Distributed under the terms of the GNU General Public License v2 |
23 |
|
24 |
DESCRIPTION="Manage the Rust compiler versions" |
25 |
@@ -77,9 +77,11 @@ get_postfix() { |
26 |
get_current_target() { |
27 |
local i targets=( $(find_targets) ) |
28 |
for (( i = 0; i < ${#targets[@]}; i++ )); do |
29 |
- [[ rustc-$(get_postfix ${targets[i]}) = \ |
30 |
- $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]] \ |
31 |
- && echo $i && return 0 |
32 |
+ if [[ rustc-$(get_postfix ${targets[i]}) = \ |
33 |
+ $(basename "$(canonicalise "${BIN_DIR}/rustc")") ]]; then |
34 |
+ echo $i |
35 |
+ return 0 |
36 |
+ fi |
37 |
done |
38 |
echo "NOT_SET" |
39 |
} |
40 |
@@ -90,7 +92,7 @@ get_symlinks_from_file() { |
41 |
local symlinks=() |
42 |
local i |
43 |
if [[ -e ${filename} ]]; then |
44 |
- for i in `cat "${filename}"`; do |
45 |
+ for i in $(cat "${filename}"); do |
46 |
symlinks+=($i) |
47 |
done |
48 |
fi |
49 |
@@ -193,8 +195,8 @@ set_version() { |
50 |
done |
51 |
|
52 |
cp "${ENV_D_PATH}/rust/provider-${target}" \ |
53 |
- "${ENV_D_PATH}/rust/last-set" || \ |
54 |
- die -q "symlink list copying failed" |
55 |
+ "${ENV_D_PATH}/rust/last-set" \ |
56 |
+ || die -q "symlink list copying failed" |
57 |
} |
58 |
|
59 |
### cleanup action ### |
60 |
@@ -250,16 +252,16 @@ describe_set() { |
61 |
} |
62 |
|
63 |
describe_set_parameters() { |
64 |
- echo "<target>" |
65 |
+ echo "<target>" |
66 |
} |
67 |
|
68 |
describe_set_options() { |
69 |
- echo "target : Target number (from 'list' action)" |
70 |
+ echo "target : Target number (from 'list' action)" |
71 |
} |
72 |
|
73 |
do_set() { |
74 |
- [[ -z $1 ]] && die -q "You didn't tell me what to set the version to" |
75 |
- [[ $# -gt 1 ]] && die -q "Too many parameters" |
76 |
+ [[ -z $1 ]] && die -q "You didn't tell me what to set the version to" |
77 |
+ [[ $# -gt 1 ]] && die -q "Too many parameters" |
78 |
|
79 |
set_version "$1" || die -q "Couldn't set new active version" |
80 |
} |