eden/tools/cpm/package.sh
crueter 94e655b4e4
[cmake] Update CPMUtil
Notable changes

- Single cpmfile
- version/min_version/git_version have been fixed and replaced with
  version and min_version
- Docs rewrite
- Legacy options are gone
- Fixed update/version commands

Interactive adder is nonfunctional right now, will rewrite later

Signed-off-by: crueter <crueter@eden-emu.dev>
2026-06-23 22:33:02 -04:00

44 lines
869 B
Bash
Executable file

#!/bin/sh -e
# SPDX-FileCopyrightText: Copyright 2026 crueter
# SPDX-License-Identifier: LGPL-3.0-or-later
RETURN=0
usage() {
cat <<EOF
Usage: cpmutil.sh package [command]
Operate on a package or packages.
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
EOF
exit $RETURN
}
SCRIPTS=$(CDPATH='' cd -- "$(dirname -- "$0")/package" && pwd)
export SCRIPTS
while :; do
case "$1" in
hash | update | fetch | add | rm | version | which | download)
cmd="$1"
shift
"$SCRIPTS/$cmd".sh "$@"
break
;;
*) usage ;;
esac
shift
done