]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: make mkall.sh accept file list
authorKir Kolyshkin <kolyshkin@gmail.com>
Sat, 13 Aug 2022 19:53:37 +0000 (12:53 -0700)
committerTobias Klauser <tobias.klauser@gmail.com>
Thu, 1 Sep 2022 22:00:15 +0000 (22:00 +0000)
Amend the "mkall.sh -syscalls" implementation to
 - prepend ./ before mksyscalls.pl;
 - accept the optional file list argument.

This is a preparation for CL 416115.

Change-Id: Ib4dc2b4aa0d2dd22a256414864e92f2d2fd957a5
Reviewed-on: https://go-review.googlesource.com/c/go/+/423676
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
src/syscall/mkall.sh

index dccb3851de770b19ceddfd3b99383f8f4d140d12..2ee500a8d1139ba4b3e5173c4b2b437a1d00574b 100755 (executable)
@@ -88,11 +88,12 @@ run="sh"
 
 case "$1" in
 -syscalls)
-       for i in zsyscall*go
+       shift
+       for i in ${@:-zsyscall*go}
        do
                # Run the command line that appears in the first line
                # of the generated file to regenerate it.
-               sed 1q $i | sed 's;^// ;;' | sh > _$i && gofmt < _$i > $i
+               sed 1q $i | sed 's;^// ;./;' | sh > _$i && gofmt < _$i > $i
                rm _$i
        done
        exit 0