mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2026-09-02 02:58:46 +00:00
[cmake] CPMUtil rewrite of the day number 852 (#4130)
Composite PR for several changes to CPMUtil, most notably: - https://git.crueter.xyz/CMake/CPMUtil/pulls/19 - https://git.crueter.xyz/CMake/CPMUtil/pulls/22 - https://git.crueter.xyz/CMake/CPMUtil/pulls/24 - https://git.crueter.xyz/CMake/CPMUtil/pulls/25 These contain a lot of changes that generally simplify control flow and improve ease-of-use. Read those descriptions and patchsets for more info. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4130 Reviewed-by: CamilleLaVey <camillelavey99@gmail.com> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
This commit is contained in:
+37
-16
@@ -7,8 +7,7 @@
|
||||
|
||||
ROOTDIR=$(CDPATH='' cd -- "$(dirname -- "$0")/cpm" && pwd)
|
||||
SCRIPTS="$ROOTDIR"
|
||||
|
||||
. "$SCRIPTS"/common.sh
|
||||
CMAKE="$ROOTDIR/cmake"
|
||||
|
||||
RETURN=0
|
||||
|
||||
@@ -26,33 +25,55 @@ General command-line utility for CPMUtil operations.
|
||||
Commands:
|
||||
package Run operations on a package or packages
|
||||
format Format cpmfile
|
||||
ls List all packages in the cpmfile
|
||||
update Update CPMUtil and its tooling
|
||||
migrate Convert submodules to a basic cpmfile
|
||||
|
||||
Package commands:
|
||||
hash Verify the hash of a package, and update it if needed
|
||||
update Check for updates for a package
|
||||
fetch Fetch a package and place it in the cache
|
||||
add Add a new package
|
||||
rm Remove a package
|
||||
version Change the version of a package
|
||||
which Check if a package is defined
|
||||
download Get the download URL for a package
|
||||
dir Get the local directory for a package
|
||||
reset Reset a fetched package to its original state
|
||||
patch Create an in-tree patch based on local modifications
|
||||
hash Verify the hash of a package, and update it if needed
|
||||
update Check for updates for a package
|
||||
fetch Fetch a package and place it in the cache
|
||||
add Add a new package
|
||||
rm Remove a package
|
||||
version Change the version of a package
|
||||
which Check if a package is defined
|
||||
url Get the download URL for a package
|
||||
dir Get the local directory for a package
|
||||
reset Reset a fetched package to its original state
|
||||
patch Create an in-tree patch based on local modifications
|
||||
|
||||
EOF
|
||||
|
||||
exit $RETURN
|
||||
}
|
||||
|
||||
export ROOTDIR
|
||||
export ROOTDIR CMAKE SCRIPTS
|
||||
|
||||
while :; do
|
||||
case "$1" in
|
||||
format | update | migrate)
|
||||
"$SCRIPTS/$1".sh
|
||||
format | update)
|
||||
cmake -P "$CMAKE/$1".cmake
|
||||
break
|
||||
;;
|
||||
ls)
|
||||
shift
|
||||
print_usage=false
|
||||
filtered=""
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
-h | --help) print_usage=true ;;
|
||||
-n) ;;
|
||||
*) filtered="$filtered $arg" ;;
|
||||
esac
|
||||
done
|
||||
cmake_defines=""
|
||||
$print_usage && cmake_defines="-DPRINT_USAGE=TRUE"
|
||||
# shellcheck disable=SC2086
|
||||
cmake $cmake_defines -P "$CMAKE/ls.cmake" -- $filtered
|
||||
break
|
||||
;;
|
||||
migrate)
|
||||
"$SCRIPTS"/migrate.sh
|
||||
break
|
||||
;;
|
||||
package)
|
||||
|
||||
Reference in New Issue
Block a user