summaryrefslogtreecommitdiff
path: root/script/update/project/repo
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-07 06:55:10 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-07 10:26:11 +0100
commit1e89264ce326997f95391e00f1fa71319f1bb226 (patch)
treef1a577604f4ff74fe7f122b1f511e93499adac27 /script/update/project/repo
parenta413c01a3ef90f7befc5805b233b67b9352ee727 (diff)
update/project/*: merge to update/project/trees
Just one script. Just one! Well, two, but the 2nd one already existed: logic in update/project/trees and update/project/repo was merged into include/git.sh and update/project/build was renamed to update/project/trees; an -f option was added, which calls the functions under git.sh so git clones are now handled by the main build script (for handling makefiles and defconfigs) but the logic there is a stub, where git.sh does all the actual heavy lifting this cuts the file count down by two, and reduces sloccount a reasonable amount because much of the logic already exists in the build script, when it comes to handling targets. git.sh was adjusted to integrate with this, rather than act standalone Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update/project/repo')
-rwxr-xr-xscript/update/project/repo77
1 files changed, 0 insertions, 77 deletions
diff --git a/script/update/project/repo b/script/update/project/repo
deleted file mode 100755
index df522edc..00000000
--- a/script/update/project/repo
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/env sh
-# SPDX-License-Identifier: GPL-3.0-only
-# SPDX-FileCopyrightText: 2022 Caleb La Grange <thonkpeasant@protonmail.com>
-# SPDX-FileCopyrightText: 2022 Ferass El Hafidi <vitali64pmemail@protonmail.com>
-# SPDX-FileCopyrightText: 2023 Leah Rowe <leah@libreboot.org>
-
-. "include/err.sh"
-. "include/git.sh"
-. "include/option.sh"
-
-eval "$(setvars "" name rev loc url bkup_url depend)"
-tmp_dir="${PWD}/tmp/gitclone"
-
-main()
-{
- [ $# -gt 0 ] || fail "no argument given"
-
- [ -z "${1+x}" ] && fail 'main(): name not set'
- name=${1#src/}
-
- scan_config "${name}" "config/git" "fail"
- verify_config
-
- clone_project
- [ "${depend}" = "" ] || for d in ${depend} ; do
- xx_ ./update project repo ${d}
- done
- xx_ rm -Rf "${tmp_dir}"
-}
-
-verify_config()
-{
- [ -z "${rev+x}" ] && fail 'verify_config: rev not set'
- [ -z "${loc+x}" ] && fail 'verify_config: loc not set'
- [ -z "${url+x}" ] && fail 'verify_config: url not set'
-}
-
-clone_project()
-{
- xx_ rm -Rf "${tmp_dir}"
- xx_ mkdir -p "${tmp_dir%/*}"
-
- loc="${loc#src/}"
- loc="src/${loc}"
-
- git clone ${url} "${tmp_dir}" || git clone ${bkup_url} "${tmp_dir}" || \
- fail "clone_project: could not download ${name}"
- git_reset_rev "${tmp_dir}" "${rev}" "fail" || \
- fail "clone_project ${loc}/: cannot reset <- ${rev}"
- git_am_patches "${tmp_dir}" "${PWD}/config/${name}/patches" "fail" || \
- fail "clone_project ${loc}/: cannot apply patches"
-
- xx_ rm -Rf "${loc}"
- [ "${loc}" = "${loc%/*}" ] || xx_ mkdir -p ${loc%/*}
- xx_ mv "${tmp_dir}" "${loc}"
-}
-
-fail()
-{
- for x in "${loc}" "${tmp_dir}"; do
- [ -z "${x}" ] || [ ! -d "${x}" ] || rm -Rf "${loc}" || :
- done
- usage
- err "${1}"
-}
-
-usage()
-{
- cat <<- EOF
- Usage: ./update project repo [name]
-
- Options:
- name: Module name as specified in files under config/git/
- EOF
-}
-
-main $@