From: Sergey Matveev Date: Thu, 27 Nov 2025 18:20:51 +0000 (+0300) Subject: Unify negate X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=dsc.git Unify negate --- diff --git a/dsc b/dsc index e302e4f..c234159 100755 --- a/dsc +++ b/dsc @@ -113,7 +113,7 @@ proc run-checker {opt v} { proc assure-exists {opt} { global Stash - if {! [file exists $Stash/$opt]} { + if {![file exists $Stash/$opt]} { puts stderr "not found" exit 1 } @@ -136,7 +136,7 @@ proc assure-all-list-params-exist {opt {offset 0}} { set idx [lindex [lsearch -all [file split $pth] "*"] end-$offset] if {$idx != ""} { set pth [file join {*}[lrange [file split $opt] 0 $idx]] - if {! [file exists $Stash/$pth]} { + if {![file exists $Stash/$pth]} { puts stderr "$pth does not exist" exit 1 } @@ -153,7 +153,7 @@ switch [lindex $argv 0] { set prefix [lindex $argv 2] } foreach opt [walk $Schema directory] { - if {! [file exists $opt/title]} {continue} + if {![file exists $opt/title]} {continue} set name [string range $opt [expr {[string length $Schema] + 1}] end] if {$prefix != ""} { if {[string range $name 0 [string length $prefix]-1] != $prefix} { @@ -219,7 +219,7 @@ switch [lindex $argv 0] { get { if {[file tail $opt] == "*"} { set opt [file dirname $opt] - if {! [file exists $Stash/$opt]} { + if {![file exists $Stash/$opt]} { exit } foreach dir [readents $Stash/$opt directory] { diff --git a/schema/net/*/addr/*/prefixlen/check b/schema/net/*/addr/*/prefixlen/check index 23b9bd3..c45a349 100755 --- a/schema/net/*/addr/*/prefixlen/check +++ b/schema/net/*/addr/*/prefixlen/check @@ -12,7 +12,7 @@ set prefixlen [read -nonewline stdin] if {$prefixlen == ""} { set prefixlen $deflen } -if {! [string is integer -strict $prefixlen]} { +if {![string is integer -strict $prefixlen]} { puts "invalid integer" exit 1 } diff --git a/schema/net/*/check b/schema/net/*/check index 5f001aa..5fd814f 100755 --- a/schema/net/*/check +++ b/schema/net/*/check @@ -1,7 +1,7 @@ #!/usr/bin/env jimsh set n [read -nonewline stdin] -if {! [regexp {^[a-z0-9]{1,16}$} $n]} { +if {![regexp {^[a-z0-9]{1,16}$} $n]} { puts {does not match ^[a-z0-9]{1,16}$} exit 1 } diff --git a/schema/net/*/mtu/check b/schema/net/*/mtu/check index 895ddd7..80917b0 100755 --- a/schema/net/*/mtu/check +++ b/schema/net/*/mtu/check @@ -4,7 +4,7 @@ set i [read -nonewline stdin] if {$i == ""} { set i 1500 } -if {! [string is integer -strict $i]} { +if {![string is integer -strict $i]} { puts "invalid integer" exit 1 } diff --git a/schema/srv/*/autostart/check b/schema/srv/*/autostart/check index f9a1b3b..f4de234 100755 --- a/schema/srv/*/autostart/check +++ b/schema/srv/*/autostart/check @@ -4,7 +4,7 @@ set n [read -nonewline stdin] if {$n == ""} { set n no } -if {! [string is boolean $n]} { +if {![string is boolean $n]} { puts {is not boolean} exit 1 } diff --git a/schema/srv/*/check b/schema/srv/*/check index 18440e7..84f9639 100755 --- a/schema/srv/*/check +++ b/schema/srv/*/check @@ -1,7 +1,7 @@ #!/usr/bin/env jimsh set n [read -nonewline stdin] -if {! [regexp {^[.A-Za-z0-9_-]{1,32}$} $n]} { +if {![regexp {^[.A-Za-z0-9_-]{1,32}$} $n]} { puts {does not match ^[.A-Za-z0-9_-]{1,32}$} exit 1 } diff --git a/schema/ssh/authorized_keys/*/pub/check b/schema/ssh/authorized_keys/*/pub/check index 158ef73..11bef28 100755 --- a/schema/ssh/authorized_keys/*/pub/check +++ b/schema/ssh/authorized_keys/*/pub/check @@ -1,7 +1,7 @@ #!/usr/bin/env jimsh set n [read -nonewline stdin] -if {! [regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} { +if {![regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} { puts {bad ssh-ed25519 key} exit 1 } diff --git a/schema/ssh/enabled/check b/schema/ssh/enabled/check index f9a1b3b..f4de234 100755 --- a/schema/ssh/enabled/check +++ b/schema/ssh/enabled/check @@ -4,7 +4,7 @@ set n [read -nonewline stdin] if {$n == ""} { set n no } -if {! [string is boolean $n]} { +if {![string is boolean $n]} { puts {is not boolean} exit 1 } diff --git a/schema/ssh/port/check b/schema/ssh/port/check index 6bbe324..45d5c59 100755 --- a/schema/ssh/port/check +++ b/schema/ssh/port/check @@ -4,7 +4,7 @@ set n [read -nonewline stdin] if {$n == ""} { set n 22 } -if {! [string is integer -strict $n]} { +if {![string is integer -strict $n]} { puts "invalid integer" exit 1 } diff --git a/schema/ssh/pub/check b/schema/ssh/pub/check index 158ef73..11bef28 100755 --- a/schema/ssh/pub/check +++ b/schema/ssh/pub/check @@ -1,7 +1,7 @@ #!/usr/bin/env jimsh set n [read -nonewline stdin] -if {! [regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} { +if {![regexp {^ssh-ed25519 [.A-Za-z0-9/+]{68,68}} $n]} { puts {bad ssh-ed25519 key} exit 1 } diff --git a/schema/sys/hostname/check b/schema/sys/hostname/check index fcaf6fa..c4e2443 100755 --- a/schema/sys/hostname/check +++ b/schema/sys/hostname/check @@ -4,7 +4,7 @@ set n [read -nonewline stdin] if {$n == ""} { set n unknown } -if {! [regexp {^[a-z0-9]{1,32}$} $n]} { +if {![regexp {^[a-z0-9]{1,32}$} $n]} { puts {does not match ^[a-z0-9]{1,32}$} exit 1 } diff --git a/schema/ui/password/check b/schema/ui/password/check index f09d95b..09f8e62 100755 --- a/schema/ui/password/check +++ b/schema/ui/password/check @@ -4,7 +4,7 @@ set passwd [read -nonewline stdin] if {$passwd == ""} { set passwd admin } -if {! [regexp {^[0-9a-z-]{1,64}$} $passwd]} { +if {![regexp {^[0-9a-z-]{1,64}$} $passwd]} { puts {does not match ^[0-9a-z-]{1,64}$} exit 1 }