File: generate

package info (click to toggle)
golang-bazil-fuse 0.0~git20160811.0.371fbbd-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, buster-backports
  • size: 728 kB
  • sloc: sh: 26; makefile: 5
file content (34 lines) | stat: -rwxr-xr-x 813 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
set -e

mksys="$(go env GOROOT)/src/pkg/syscall/mksyscall.pl"

fix() {
    sed 's,^package syscall$,&x\nimport "syscall",' \
	| gofmt -r='BytePtrFromString -> syscall.BytePtrFromString' \
	| gofmt -r='Syscall6 -> syscall.Syscall6' \
	| gofmt -r='Syscall -> syscall.Syscall' \
	| gofmt -r='SYS_GETXATTR -> syscall.SYS_GETXATTR' \
	| gofmt -r='SYS_LISTXATTR -> syscall.SYS_LISTXATTR' \
	| gofmt -r='SYS_SETXATTR -> syscall.SYS_SETXATTR' \
	| gofmt -r='SYS_REMOVEXATTR -> syscall.SYS_REMOVEXATTR' \
	| gofmt -r='SYS_MSYNC -> syscall.SYS_MSYNC'
}

cd "$(dirname "$0")"

$mksys xattr_darwin.go \
    | fix \
    >xattr_darwin_amd64.go

$mksys -l32 xattr_darwin.go \
    | fix \
    >xattr_darwin_386.go

$mksys msync.go \
    | fix \
    >msync_amd64.go

$mksys -l32 msync.go \
    | fix \
    >msync_386.go