File: curl

package info (click to toggle)
golang-google-grpc 1.27.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, bullseye-backports, experimental
  • size: 5,048 kB
  • sloc: sh: 583; makefile: 66
file content (25 lines) | stat: -rwxr-xr-x 882 bytes parent folder | download
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
#!/bin/sh

set -u

# Copyright: 2020 Dmitry Smirnov <onlyjob@debian.org>
# License: GPL-3+

## Upstream sources are incomplete with .proto files missing.
## "go generate" runs .sh files that invokes `curl` to fetch .proto files.
## This file pretends to be `curl` to avoid downloading in favour of files
## from "debian/missing-sources". When a file is missing, this script tries
## to download it so in order to prepare a new upstream release it might
## be necessary to build the package once in the online environment.
## To update files in "debian/missing-sources", remove them so they
## could be re-downloaded.

file="${1##https://raw.githubusercontent.com/}"
file_path="${CURDIR}"/debian/missing-sources/"${file}"

if [ ! -s "${file_path}" ]; then
    mkdir -v -p "${CURDIR}"/debian/missing-sources/"${file%/*}"
    /usr/bin/curl "$1" > "${file_path}"
fi

cat "${file_path}"