Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
For PBIs on 10, add a "pbi <cmd>" and "app <cmd>" alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed Oct 22, 2013
1 parent f09d1ce commit 3907934
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src-sh/pbi-manager10/install.sh
Expand Up @@ -42,6 +42,8 @@ ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_update
ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_update_hashdir
ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbid
ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi-crashhandler
ln -f ${LB}/sbin/pbi_create ${LB}/sbin/app
ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi

# Set the new PREFIX / LOCALBASE
if [ "$LB" != /usr/local ] ; then
Expand Down
47 changes: 47 additions & 0 deletions src-sh/pbi-manager10/pbi-manager
Expand Up @@ -7641,6 +7641,51 @@ getZFSTank() {
return 1
}

app_init()
{
cmd=$1

# Alias install -> add
if [ "$cmd" = "install" ] ; then cmd="add" ; fi

which -s "pbi_${cmd}"
if [ $? -ne 0 ] ; then usage_app; fi

shift
pbi_${cmd} $*
exit $?
}

usage_app()
{
cat <<EOF
usage: `basename $0` <subcommand>
Available sub-commands:
add
addrepo
autobuild
browser
create
deleterepo
delete
icon
indextool
info
install
listrepo
makeport
makepatch
makerepo
metatool
patch
update
EOF
exit 1
}

# Source our shared PCBSD functions
. /usr/local/share/pcbsd/scripts/functions.sh

Expand Down Expand Up @@ -7676,6 +7721,8 @@ case `basename ${0}` in
pbi_update) pbi_update_init "$@" ;;
pbi_update_hashdir) pbi_update_hashdir_init "$@" ;;
pbi-crashhandler) pbi_crash_init "$@" ;;
app) app_init "$@" ;;
pbi) app_init "$@" ;;
pbid) pbid_init "$@" ;;
*) echo "Error: Called with invalid basename!" ; exit_trap ;;
esac
Expand Down
4 changes: 3 additions & 1 deletion src-sh/port-files/Makefile
Expand Up @@ -37,7 +37,9 @@ PLIST_FILES+= share/pbi-manager/.pbime \
share/pbi-manager/.pbimount \
share/pbi-manager/.ldconfig \
share/pbi-manager/.mount_nullfs \
etc/man.d/pbi.conf
etc/man.d/pbi.conf \
sbin/app \
sbin/pbi
.endif

do-install:
Expand Down

0 comments on commit 3907934

Please sign in to comment.