History

Use if COND (instead of ! COND || EXPR) where it makes sense

malc committed 5 years ago

Commit 4bce8ea1 parent 3e690891 file · +10 −10Browse files

Unified · Split

build.bash+10−10
@@ -95,7 +95,7 @@ mflags() { · 94 unmodified lines
95}95}
96 96
97overs="$(ocamlc -vnum 2>/dev/null)" || overs=""97overs="$(ocamlc -vnum 2>/dev/null)" || overs=""
98test "$overs" = "4.12.0" || {98if test "$overs" != "4.12.0"; then
99 url=https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0.tar.xz99 url=https://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0.tar.xz
100 txz=$outd/$(basename $url)100 txz=$outd/$(basename $url)
101 keycmd="printf $url; digest $txz;"101 keycmd="printf $url; digest $txz;"
@@ -127,7 +127,7 @@ test "$overs" = "4.12.0" || { · 25 unmodified lines
127 eval $keycmd >$absprefix/bin/ocamlc.past127 eval $keycmd >$absprefix/bin/ocamlc.past
128 ) && vecho "fresh ocamlc"128 ) && vecho "fresh ocamlc"
129 overs=$(ocamlc -vnum 2>/dev/null)129 overs=$(ocamlc -vnum 2>/dev/null)
130}130fi
131 131
132while read k v; do132while read k v; do
133 case "$k" in133 case "$k" in
@@ -139,10 +139,10 @@ done < <(ocamlc -config) · 5 unmodified lines
139cvers=$($ccomp --version | { read v; echo $v; })139cvers=$($ccomp --version | { read v; echo $v; })
140 140
141bocaml1() {141bocaml1() {
142 grep -q "$3" $outd/ordered || {142 if ! grep -q "$3" $outd/ordered; then
143 bocaml2 "$@"143 bocaml2 "$@"
144 echo "$3" >>"$outd/ordered"144 echo "$3" >>"$outd/ordered"
145 }145 fi
146}146}
147 147
148bocaml2() {148bocaml2() {
@@ -156,10 +156,10 @@ bocaml2() { · 7 unmodified lines
156 local O=${o#$outd/}156 local O=${o#$outd/}
157 for d in $depl; do157 for d in $depl; do
158 local D=${d##$srcd/}158 local D=${d##$srcd/}
159 test "${O%%.cmo}" = "${D%%.cmi}" || {159 if test "${O%%.cmo}" != "${D%%.cmi}"; then
160 test "$d" = "$outd/confstruct.cmo" || d=$outd/${d#$srcd/}160 test "$d" = "$outd/confstruct.cmo" || d=$outd/${d#$srcd/}
161 deps+="$d\n"161 deps+="$d\n"
162 }162 fi
163 done163 done
164 printf "$deps"164 printf "$deps"
165 } >$o.depl || die "escaped $?"165 } >$o.depl || die "escaped $?"
@@ -189,10 +189,10 @@ bocaml() { · 23 unmodified lines
189 s=$outd/confstruct.ml189 s=$outd/confstruct.ml
190 o=$outd/confstruct.cmo;;190 o=$outd/confstruct.cmo;;
191 *)191 *)
192 test "$o" = "$wocmi" && s=$srcd/${o%.cmo}.ml || {192 if test "$o" = "$wocmi"; then s=$srcd/${o%.cmo}.ml; else
193 cmi=true193 cmi=true
194 s=$srcd/$wocmi.mli194 s=$srcd/$wocmi.mli
195 }195 fi
196 o=$outd/$o;;196 o=$outd/$o;;
197 esac197 esac
198 expr >/dev/null "$cycle" : ".*$o" && die cycle $o || cycle="$cycle$o"198 expr >/dev/null "$cycle" : ".*$o" && die cycle $o || cycle="$cycle$o"

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t