Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Slowroll:Build:2
etcd
vendor-update.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File vendor-update.sh of Package etcd
#!/usr/bin/bash # # Script to update the vendor tarball # Author: Elisei Roca #------------------------------------ set -eo pipefail # set -x NAME=etcd STACK=("server" "etcdctl" "etcdutl") VERSION=$(grep -oP '(?<=Version:)(.*)' etcd.spec | xargs) [ ! -f "$NAME-$VERSION".tar.gz ] && echo "$NAME-$VERSION.tar.gz does not exist" && exit 1 echo "Updating vendor file..." tempdir="$(mktemp -d --suffix=.etcd)" function cleanup() { rm -rf "${tempdir}" } trap cleanup EXIT mkdir -p "${tempdir}/vendor" tar --strip-components=1 -xvf "$NAME-$VERSION".tar.gz -C "${tempdir}" &> /dev/null dir=$(pwd) for item in ${STACK[*]}; do mkdir "${tempdir}/vendor/${item}" cd "${tempdir}/${item}" go mod vendor mv vendor/ ../vendor/"$item" done cd "$dir" fdupes -r -1 "${tempdir}/vendor/" | while read line; do target=""; for file in ${line[*]}; do if [ "x${target}" == "x" ]; then target=$file; else ln -f "${target}" "${file}"; fi; done; done tar -czvf vendor.tar.gz -C "${tempdir}" vendor &> /dev/null echo "Repacked to vendor.tar.gz"
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor