From d3a395b2558b90b1da4495017e8825e2e68758fd Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 12 Jun 2019 14:38:37 +0200 Subject: [PATCH] Add auto-generator for tools list Signed-off-by: Knut Ahlers --- .SRCINFO | 15 +++++++++++++++ PKGBUILD | 5 +++-- build.sh | 24 +----------------------- tools.txt | 0 update.sh | 22 ++++++++++++++++++++++ 5 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 .SRCINFO create mode 100644 tools.txt create mode 100644 update.sh diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..048ef13 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = vim-go-tools + pkgdesc = Package of tools required by vim-go + pkgver = 0.1.0 + pkgrel = 1 + url = https://github.com/fatih/vim-go + arch = x86_64 + license = other + makedepends = go + source = build.sh + source = tools.txt + sha512sums = 225301ca5a3435d70a12628f55a6174487a59970596a23010c52b4e6554573a0bb9e16d01e4e08211cd1301272142acf195e1a7b97b0ee007ae8cbe757387d70 + sha512sums = 751a9bf8bbea2fac37f4a9e405e2a5020ad0880b353ea9467d54f0a1a31dd321e8f860fc32646c463e2142f46c4b82826e426a872a71752cb63b32ad34393e1e + +pkgname = vim-go-tools + diff --git a/PKGBUILD b/PKGBUILD index 917b5e9..46f7dfc 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -8,8 +8,9 @@ arch=('x86_64') url="https://github.com/fatih/vim-go" license=(other) makedepends=('go') -source=("build.sh") -sha512sums=('5055aec7ebd34916110b85bde9f7db1bce22a278e0c02e518581d399919aac2052e9e9d9469ce869e9152e418234f494729170e0fa261c308c4f29d8abd01ac1') +source=("build.sh" "tools.txt") +sha512sums=('225301ca5a3435d70a12628f55a6174487a59970596a23010c52b4e6554573a0bb9e16d01e4e08211cd1301272142acf195e1a7b97b0ee007ae8cbe757387d70' + '751a9bf8bbea2fac37f4a9e405e2a5020ad0880b353ea9467d54f0a1a31dd321e8f860fc32646c463e2142f46c4b82826e426a872a71752cb63b32ad34393e1e') build() { mkdir -p "${srcdir}/go" diff --git a/build.sh b/build.sh index 49be82f..c264bcd 100644 --- a/build.sh +++ b/build.sh @@ -1,29 +1,7 @@ #!/bin/bash set -euo pipefail -packages=( - github.com/alecthomas/gometalinter - github.com/davidrjenni/reftools/cmd/fillstruct - github.com/fatih/gomodifytags - github.com/fatih/motion - github.com/go-delve/delve/cmd/dlv - github.com/golangci/golangci-lint/cmd/golangci-lint - github.com/josharian/impl - github.com/jstemmer/gotags - github.com/kisielk/errcheck - github.com/klauspost/asmfmt/cmd/asmfmt - github.com/koron/iferr - github.com/mdempsky/gocode - github.com/rogpeppe/godef - github.com/stamblerre/gocode - github.com/zmb3/gogetdoc - golang.org/x/lint/golint - golang.org/x/tools/cmd/goimports - golang.org/x/tools/cmd/gopls - golang.org/x/tools/cmd/gorename - golang.org/x/tools/cmd/guru - honnef.co/go/tools/cmd/keyify -) +packages=($(cat tools.txt)) for package in "${packages[@]}"; do echo -e "\e[96mBuilding ${package}...\e[m" >&2 diff --git a/tools.txt b/tools.txt new file mode 100644 index 0000000..e69de29 diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..cc0072b --- /dev/null +++ b/update.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -euo pipefail + +curl -sSfL "https://raw.githubusercontent.com/fatih/vim-go/master/plugin/go.vim" | + grep -Eo "\\ \['[^']*/[^']*'" | + tr -d "[' " | + sort >tools.txt.new + +diff tools.txt tools.txt.new && { + echo "Up to date" + rm tools.txt.new + exit 0 +} || true + +mv tools.txt.new tools.txt +updpkgsums + +sed -i "s/pkgver=.*/pkgver=$(date +%Y.%m.%d)/" PKGBUILD +makepkg --printsrcinfo >.SRCINFO + +git add tools.txt .SRCINFO PKGBUILD +git c -m "Update tools $(date +%Y.%m.%d)"