[cpm, tools]: Ability to override and set custom hosts (like a self hosted instance/git-daemon) #2837
No reviewers
Labels
No labels
android
audio
bug
ci
cmake
confirmed
core
desktop
duplicate
enhancement
frontend
fw
git
graphics
loader
nv gpu
ui
vulkan
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
eden-emu/eden!2837
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "selfhost0"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: lizzie lizzie@eden-emu.dev
@ -14,2 +14,4 @@"Force system packages for all CPM dependencies (NOT RECOMMENDED)" OFF)option(CPMUTIL_DEFAULT_HOST"Sets the default host when 'git_host' isn't defined" "github.com")https://cmake.org/cmake/help/latest/command/set.html#cache-legacy
set(CPMUTIL_DEFAULT_HOST github.com CACHE STRING "Sets the default host when no custom Git host isn't defined")Though I already have this and a few other changes stashed in CPMUtil, so I will push that whenever it's ready
@ -33,1 +33,4 @@- [Translation Scripts](./translations)## Mirror- [Mirroring scripts](./mirror)Prefer newlines after headings, some Markdown viewers need it
@ -0,0 +12,4 @@echo "1 - Do initial clone/world"echo "2 - Clone submodules (update)"echo "3 - Force manual remotes update (please use crontab instead)"read -p "Selection? [none]: " ANSWERinteractive CLIs are not the greatest. Instead we should use getopt-like parsing
https://git.crueter.xyz/scripts/windev/src/branch/master/install.sh#L379
Also, this is less relevant for a getopt-like solution, but prefer cat-EOF heredocs unless there are a ton of variables/command outputs
@ -0,0 +20,4 @@REPOS=$(find "$CPM_DIR" "$CPM_DIR/src" -maxdepth 3 -type f -name 'cpmfile.json' -not -path 'build' \| sort | uniq | xargs jq -s 'reduce .[] as $item ({}; . * $item)' \| jq -r 'reduce .[] as $i (""; . + (if $i.git_host == null then "https://github.com" else "https://" + $i.git_host end) + "/" + $i.repo + " ")' \| tr ' ' '\n' | xargs -I {} echo {})tools/cpm/common.shwill aggregate everything for you@ -0,0 +31,4 @@cd $TARGET_ROOT_DIR && find . -maxdepth 2 -type d -name '*.git' -print0 \| xargs -0 -I {} sh -c ". $CPM_DIR/tools/mirror/common.sh && git_retrieve_gitmodules {}" \| while IFS= read -r line; doNAME=$(echo "$line" | awk -F'/' '{print $5}')cutis preferred here. Awk is generally reserved for more complex cases, since cut is faster@ -0,0 +38,4 @@donesudo chmod 755 $TARGET_ROOT_DIRelif [ "$ANSWER" = "3" ]; thenecho Forcing git updatesecho always prefers quotes
@ -0,0 +3,4 @@# SPDX-License-Identifier: GPL-3.0-or-later# You must run this at the root of the eden git repoCPM_DIR=$PWDNPROC=`nproc`This will not work on OpenBSD, macOS and a few others
@ -0,0 +29,4 @@case "$1" in--path)shiftSCM_ROOT_DIR=$1This will have unintended behavior if the user specifies path afterwards. Prefer what I did in windev/install.sh; set environment variables to determine which ops to do, then parse them later. This also lets you force ordering and such
fb08764372af65ea9a1eaf65ea9a1e9662b005d8This has the slightly unfortunate side effect of not working exactly as expected, since CPM specifically works with source archives, releases, and tags, not necessarily raw commits from a Git repo--if there is a cgit-like service that has this functionality though, it might work
@crueter wrote in #2837 (comment):
git itself can make a headless git server; cgit is just a frontend - I expect the mirror-er to know that, atleast
cgit offers tarballs (for tags only) btw
<cgit-url>/<path-to-repo>/snapshot/<repo name>-<tag>.tar.gzhttp://example.com/OpenTTD/OpenTTD.git/snapshot/OpenTTD-15.0-beta3.tar.gzThat isn't sufficient, because we need general "commitish" archives; that is, commits, tags, and (theoretically) branches. Not to mention releases. Gentoo's gitweb has something similar, e.g. https://gitweb.gentoo.org/repo/proj/guru.git/snapshot/guru-278b5cb7e54fb4f0a1169042fa3559c5811da581.tar.gz, but that still isn't touching releases.
9662b005d84da9c6303bView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.