mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
projects-dir.mk: Add install-prereq-build
Add a target to pull in all prerequisites needed for building via the package manager. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
021e52de59
commit
f5ab24d344
2 changed files with 67 additions and 11 deletions
53
scripts/pkg-manager.sh
Normal file
53
scripts/pkg-manager.sh
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/sh
|
||||
|
||||
log()
|
||||
{
|
||||
echo $@ >&2
|
||||
}
|
||||
|
||||
err()
|
||||
{
|
||||
echo $@ >&2
|
||||
}
|
||||
|
||||
fatal()
|
||||
{
|
||||
err "Giving up: $@"
|
||||
exit 1
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
cat<<-EOT
|
||||
$myname cmd args
|
||||
EOT
|
||||
}
|
||||
|
||||
run()
|
||||
{
|
||||
log "Running ==== $@"
|
||||
eval sudo "$@"
|
||||
}
|
||||
|
||||
cmd_install()
|
||||
{
|
||||
case $ID in
|
||||
opensuse|suse)
|
||||
eval run zypper in "$@"
|
||||
;;
|
||||
debian)
|
||||
eval run apt-get install "$@"
|
||||
;;
|
||||
*)
|
||||
fatal "Tried to install to unsupported platform \"$ID\""
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# -- here we go
|
||||
myname=`basename $0`
|
||||
. /etc/os-release
|
||||
cmd="$1"
|
||||
shift
|
||||
eval cmd_$cmd "$@"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue