[M120 Migration][VD] Remove accessing oom_score_adj in zygote process
[platform/framework/web/chromium-efl.git] / third_party / libgav1 / update_readme.go
1 // Copyright 2019 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // How to run.
6 // `go run update_readme.go.` at //third_party/libgav1.
7 // README.chromium is updated with the correct info.
8 package main
9
10 import (
11         "fmt"
12         "os/exec"
13 )
14
15 func updateReadme() {
16         gitCmd := exec.Command("bash", "-c", "git --no-pager log -1 --format=format:\"%H\"")
17         gitCmd.Dir = "src"
18         out, err := gitCmd.Output()
19         if err != nil {
20                 panic(fmt.Sprintf("failed to execute git command: %v", err))
21         }
22
23         hash := string(out)
24
25         sedCmd := exec.Command("sed", "-E", "-i.back", "-e",
26                 fmt.Sprintf("s/^(Revision:)[[:space:]]+[a-f0-9]{40}/\\1 %s/", hash),
27                 "README.chromium")
28         if err := sedCmd.Run(); err != nil {
29                 panic(fmt.Sprintf("failed to execute sed command: %v %v", sedCmd, err))
30         }
31
32         rmCmd := exec.Command("rm", "README.chromium.back")
33         if rmCmd.Run() != nil {
34                 panic(fmt.Sprintf("failed to execute rm command: %v", err))
35         }
36 }
37
38 func main() {
39         updateReadme()
40 }