kicad: modify update script to use gitlab for libraries
Kicad libraries are now hosted on gitlab instead of github.
This commit is contained in:
parent
f174a84d33
commit
b67afd8a44
@ -58,7 +58,6 @@ file="${here}/versions.nix"
|
|||||||
# just in case this runs in parallel
|
# just in case this runs in parallel
|
||||||
tmp="${here}/,versions.nix.${RANDOM}"
|
tmp="${here}/,versions.nix.${RANDOM}"
|
||||||
|
|
||||||
# libraries currently on github, move to $gitlab/libraries planned
|
|
||||||
libs=( symbols templates footprints packages3d )
|
libs=( symbols templates footprints packages3d )
|
||||||
|
|
||||||
get_rev="git ls-remote --heads --tags"
|
get_rev="git ls-remote --heads --tags"
|
||||||
@ -67,9 +66,6 @@ gitlab="https://gitlab.com/kicad"
|
|||||||
# append commit hash or tag
|
# append commit hash or tag
|
||||||
gitlab_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
|
gitlab_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
|
||||||
|
|
||||||
# append "-$lib/archive/[hash or tag].tar.gz
|
|
||||||
github="https://github.com/kicad/kicad"
|
|
||||||
|
|
||||||
# not a lib, but separate and already moved to gitlab
|
# not a lib, but separate and already moved to gitlab
|
||||||
i18n="${gitlab}/code/kicad-i18n.git"
|
i18n="${gitlab}/code/kicad-i18n.git"
|
||||||
i18n_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad-i18n/repository/archive.tar.gz?sha="
|
i18n_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad-i18n/repository/archive.tar.gz?sha="
|
||||||
@ -147,8 +143,8 @@ for version in "${all_versions[@]}"; do
|
|||||||
|
|
||||||
for lib in "${libs[@]}"; do
|
for lib in "${libs[@]}"; do
|
||||||
echo "Checking ${lib}" >&2
|
echo "Checking ${lib}" >&2
|
||||||
url="${github}-${lib}.git"
|
url="${gitlab}/libraries/kicad-${lib}.git"
|
||||||
lib_rev="$(${get_rev} "${url}" "${version}" | cut -f1)"
|
lib_rev="$(${get_rev} "${url}" "${version}" | cut -f1 | head -n1)"
|
||||||
has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
|
has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
|
||||||
has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256")"
|
has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256")"
|
||||||
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
|
||||||
@ -161,7 +157,7 @@ for version in "${all_versions[@]}"; do
|
|||||||
esac
|
esac
|
||||||
printf "\"%s\";\n" "${lib_rev}"
|
printf "\"%s\";\n" "${lib_rev}"
|
||||||
printf "%8s%s.sha256 =\t\"%s\";\n" "" \
|
printf "%8s%s.sha256 =\t\"%s\";\n" "" \
|
||||||
"${lib}" "$(${prefetch} "${github}-${lib}/archive/${lib_rev}.tar.gz")"
|
"${lib}" "$(${prefetch} "https://gitlab.com/api/v4/projects/kicad%2Flibraries%2Fkicad-${lib}/repository/archive.tar.gz?sha=${lib_rev}")"
|
||||||
count=$((count+1))
|
count=$((count+1))
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user