small repair

This commit is contained in:
zenobit 2022-02-02 07:11:42 +01:00 committed by zenobit
parent 11e4282629
commit b4e34d422d
10 changed files with 62 additions and 752 deletions

View file

@ -7,14 +7,14 @@ all:
.PHONY: install
install:
cp ./vbm $(PREFIX_BIN)/vbm
cp ./bash-completion/completions/vbm $(PREFIX_BASHC)/vbm
cp ./vpm $(PREFIX_BIN)/vpm
cp ./bash-completion/completions/vpm $(PREFIX_BASHC)/vpm
.PHONY: uninstall
uninstall:
rm -f $(PREFIX_BIN)/vbm
rm -f $(PREFIX_BASHC)/vbm
rm -f $(PREFIX_BIN)/vpm
rm -f $(PREFIX_BASHC)/vpm
.PHONY: check
check:
which vbm
which vpm

View file

@ -1,87 +1,88 @@
### Changed name from vpm to vbm so it can coexist with original, already in void repos...
# vbm - An XBPS package management helper for vb-linux and VoidLinux
### Changed name from vpm to vpm2
# vpm2 - An XBPS package management helper for vb-linux and VoidLinux
version 1.4.1
`vbm` is a simple to use, daily-driver enhancement to the awesome XBPS (X Binary
`vpm` is a simple to use, daily-driver enhancement to the awesome XBPS (X Binary
Package System), initially designed as a helper tool for use with VoidLinux.
Feel free to think "Void Package Management" or something if it helps you
remember its name, but please note that it's NOT a "package manager" in the
nitpickers understanding of the word - especially vbm shouldn't be confused with
XBPS - vbm is just an addon helper tool for XBPS to make your life easier.
nitpickers understanding of the word - especially vpm shouldn't be confused with
XBPS - vpm is just an addon helper tool for XBPS to make your life easier.
That's it.
# Screenshots
vbm...
vpm...
![vbm](https://codeberg.org/oSoWoSo/vbm/raw/branch/main/screenshots/vbm.png)
![vpm](https://codeberg.org/oSoWoSo/vpm/raw/branch/main/screenshots/vpm.png)
vbm trying install package but...
vpm trying install package but...
![try](https://codeberg.org/oSoWoSo/vbm/raw/branch/main/screenshots/vbm2.png)
![try](https://codeberg.org/oSoWoSo/vpm/raw/branch/main/screenshots/vpm2.png)
vbm automatic updating xbps while updating system...
vpm automatic updating xbps while updating system...
![xbps](https://codeberg.org/oSoWoSo/vbm/raw/branch/main/screenshots/vbm3.png)
![xbps](https://codeberg.org/oSoWoSo/vpm/raw/branch/main/screenshots/vpm3.png)
vbm installing package...
vpm installing package...
![xbps](https://codeberg.org/oSoWoSo/vbm/raw/branch/main/screenshots/vbm4.png)
![xbps](https://codeberg.org/oSoWoSo/vpm/raw/branch/main/screenshots/vpm4.png)
# Motivation to write vbm
# Motivation to write vpm
I initially found XBPS to have a steep learning-curve, so I wanted to ease the
life of new VoidLinux users, and XBPS users in general. Please don't feel afraid
to look up the corresponding XBPS commands it translates to, or use vbm
--show-translations so you even see the translations already when using vbm
help. It has been said that vbm will ease the transition from Debian's APT, and
to look up the corresponding XBPS commands it translates to, or use vpm
--show-translations so you even see the translations already when using vpm
help. It has been said that vpm will ease the transition from Debian's APT, and
some other user-friendly repository/package-managers.
# Dependencies
vbm requires BASH, the Bourne Again SHell, which should be installed by default
vpm requires BASH, the Bourne Again SHell, which should be installed by default
on a new VoidLinux system. You also will need git and xcheckrestart both provided
by xtools package to obtain a clone of the vbm GitHub repository.
by xtools package to obtain a clone of the vpm GitHub repository.
(see "Installation" section, below).
Or you can just grab vbm and paste it anywhere in your system.
Or you can just grab vpm and paste it anywhere in your system.
# Installation
### 1. Install xtools via `xbps-install`
### for xcheckrestart functions etc...
### 1. Install xtools via `xbps-install`
### (optional - needed for for xcheckrestart functions)
$ xbps-install -S xtools
### 2. Clone vbm repository
### 2. Clone vpm repository
$ git clone https://codeberg.org/oSoWoSo/vbm.git
$ git clone https://codeberg.org/oSoWoSo/vpm.git
### 3. Enter the cloned repo and install vbm
### 3. Enter the cloned repo and install vpm
$ cd vbm
$ chmod +x vbm
$ cd vpm
$ chmod +x vpm
$ make install
### 3a. Remove vbm
### 3a. Remove vpm
If you want to remove vbm, just use make to remove it. Make sure you are in the cloned directory first, then run:
If you want to remove vpm, just use make to remove it. Make sure you are in the cloned directory first, then run:
$ make uninstall
# ZOMG! PONIES!!111
Rainbows and unicorns, indeed. If you like colorized output, please see the
--color=true option, too! All vbm options try to have human readable and easy to
--color=true option, too! All vpm options try to have human readable and easy to
remember syntax, no --long-option-with-multiple-complex-words, no need to even
prefix arguments with --, vbm just tries to do its best it can to understand the
user (there are some command-line-switches, though, see vbm help).
prefix arguments with --, vpm just tries to do its best it can to understand the
user (there are some command-line-switches, though, see vpm help).
Also vbm will ask for password if needed.
Also vpm will ask for password if needed.
# License
vbm is released under the terms of the GNU General Public License,
vpm is released under the terms of the GNU General Public License,
Version 3. See the LICENSE file for further information.
```
@ -105,7 +106,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
- https://github.com/netzverweigerer/vpm - vpm was written by Armin Jenewein <vpm@m2m.pm>
- https://github.com/bahamas10/vpm - forked by Dave Eddy <dave@daveeddy.com>
- https://codeberg.org/oSoWoSo/vbm - and this fork by zenobit <zen@osowoso.xyz>
- https://codeberg.org/oSoWoSo/vpm - and this fork by zenobit <zen@osowoso.xyz>
# Mirrors

View file

@ -1,6 +1,6 @@
source /usr/share/bash-completion/completions/xbps
_vbm()
_vpm()
{
local cur prev words cword
_init_completion || return
@ -12658,5 +12658,5 @@ _vbm()
xsnow'
} &&
complete -F _vbm vbm
complete -F _vpm vpm

0
screenshots/screenshot-utility.sh Normal file → Executable file
View file

View file

Before

Width:  |  Height:  |  Size: 205 KiB

After

Width:  |  Height:  |  Size: 205 KiB

View file

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View file

Before

Width:  |  Height:  |  Size: 330 KiB

After

Width:  |  Height:  |  Size: 330 KiB

View file

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 79 KiB

694
vbm-test
View file

@ -1,694 +0,0 @@
#!/bin/bash
# vim: ft=sh ts=2 sw=2 sts=2 et
# vbm - vb-linux management utility for
# XBPS, the X Binary Package System
# original author: Armin Jenewein <a@m2m.pm>, GitHub: @netzverweigerer
# a lot used from: Dave Eddy <dave@daveeddy.com>, GitHub: @bahamas10
# this fork: zenobit from oSoWoSo <pm@osowoso.xyz>, codeberg.org: @oSoWoSo
# For more information about XBPS, see:
# https://github.com/voidlinux/xbps
# Released under the terms of the GNU general public license, version 3+
# see LICENSE file for license information.
# set version number
version="1.4.1"
# disable verbosity by default
verbose=false
# VBM color definitions
numc0=0
numc1=1
numc2=2
numc3=3
numc4=4
numc5=5
numc6=6
numc7=7
numc8=8
# second definition
c0=${numc0}
c1=${numc1}
c2=${numc2}
c3=${numc3}
c4=${numc4}
c5=${numc5}
c6=${numc6}
c7=${numc7}
c8=${numc8}
## COLORS
c=$(tput sgr0) # reset
c0=$(tput setaf 0) # black
c1=$(tput setaf 1) # red
c2=$(tput setaf 2) # green
c3=$(tput setaf 3) # yellow
c4=$(tput setaf 4) # blue
c5=$(tput setaf 5) # magenta
c6=$(tput setaf 6) # light blue
c7=$(tput setaf 7) # white
c8=$(tput setaf 8) # grey
# background
b0=$(tput setab 0)
b1=$(tput setab 1)
b2=$(tput setab 2)
b3=$(tput setab 3)
b4=$(tput setab 4)
b5=$(tput setab 5)
b6=$(tput setab 6)
b7=$(tput setab 7)
b8=$(tput setab 8)
b9=$(tput setab 9)
# colortest
echo "${c}" testclear
echo "${c0}${b1}" testblack${c}
echo "${c1}" testred
echo "${c2}" testgreen
echo "${c3}" testyellow
echo "${c4}" testblue
echo "${c5}" testmagenta
echo "${c6}" testlightblue
echo "${c7}" testwhite
echo "${c8}" testgrey
echo "${c}" testclear
# program name
progname=${0##*/}
# enable or disable colors based on the argument given, i.e.:
# setcolors on # colors on
# setcolors off # colors off
# setcolors auto # colors on or off depending on environment
declare -A COLORS
setcolors () {
local opt=$1
# determine if colors should be enabled or not
if [[ $opt == auto ]]; then
# if stdout is a TTY and the TERM looks like it supports color enable colors
if [[ -t 1 && $TERM == *color* ]]; then
opt='on'
else
opt='off'
fi
fi
case "$opt" in
on)
local i
for i in {1..11}; do
if [[ -n ${COLORS[$i]} ]]; then
continue
fi
COLORS[$i]=$(tput setaf "$i")
done
c0=${COLORS[$numc0]}
c1=${COLORS[$numc1]}
c2=${COLORS[$numc2]}
c3=${COLORS[$numc3]}
c4=${COLORS[$numc4]}
c5=${COLORS[$numc5]}
c6=${COLORS[$numc6]}
c7=${COLORS[$numc7]}
c8=${COLORS[$numc8]}
c=$(tput sgr0)
;;
off)
c0=
c1=
c2=
c3=
c4=
c5=
c6=
c7=
c8=
c=
unset COLORS
declare -A COLORS
;;
*)
rmsg 255 "unknown color option: '$opt'"
exit 255
;;
esac
}
# print the logo with brackets colorized
getlogo () {
printf '%s[%s%s%s]%s' \
"$c6" \
"$c5" "$progname" \
"$c6" \
"$c"
}
# prints a message (with vbm-prefix)
msg () {
local logo=$(getlogo)
local newline=true
if [[ $1 == '-n' ]]; then
newline=false
shift
fi
printf '%s %s%s%s' "$logo" "$c4" "$*" "$c"
$newline && echo
}
# rmsg - same (but colorized based on return status passed via $1)
rmsg () {
local code=$1
shift
local logo=$(getlogo)
local statuscolor
if ((code == 0)); then
statuscolor=$c7
else
statuscolor=$c1
fi
printf '%s %s%s%s\n' "$logo" "$statuscolor" "$*" "$c"
}
banner () {
echo -n "$c5"
echo ' __ __/|__ _ __ '
printf " \\ V / '_ \\ ' \ "
echo -n "$c2"
echo " $progname - An XBPS package management helper"
echo -n "$c5"
echo -n ' \_/|_,__/_|_|_|'
echo -n "$c2"
echo ' Source: https://codeberg.org/oSoWoSo/vbm'
echo -n "$c5"
echo -n "$c"
}
version () {
banner
msg "$progname - Version: $version (GPLv3+)"
msg "original author: Armin Jenewein <a@m2m.pm>, GitHub: @netzverweigerer"
msg "a lot used from: Dave Eddy <dave@daveeddy.com>, GitHub: @bahamas10"
msg "this fork: zenobit from oSoWoSo <pm@osowoso.xyz>, codeberg.org: @oSoWoSo"
msg "XBPS version: $(xbps-query -v --version | sed 's/GIT: UNSET//')"
}
# check if we have UID 0, exit otherwise
rootcheck () {
if [[ $EUID -gt 0 ]]; then
msg "$(tput setaf 1)This operation needs super-user privileges.$(tput sgr 0)"
SUDO=sudo
else
SUDO=''
fi
}
t () {
if [[ -n $show_translations ]]; then
tput setaf 242
echo ' ' "$@"
echo
tput setaf 109
fi
}
wrapcommand() {
local cmd ret
cmd=("$@")
echo "$c4(${cmd[*]}):$c"
"${cmd[@]}"
ret=$?
rmsg "$ret" "[${cmd[*]}], return code was: $ret"
exit "$ret"
}
usage () {
echo -n "${c}"
echo "testing-clear"
echo -n "$c0"
echo "testing-c0-black"
echo -n "$c1"
echo "testing-c1-red"
echo -n "$c2"
echo "testing-c2-"
echo -n "$c3"
echo "testing-c3-"
echo -n "$c4"
echo "testing-c4-"
echo -n "$c5"
echo "testing-c5-"
echo -n "$c6"
echo "testing-c6-"
echo -n "$c7"
echo "testing-c7-"
echo -n "$c8"
echo "testing-c8-"
echo -n "${c}"
echo "testing-clear"
echo "${c2}USAGE:
${c1}${progname} ${c8}[OPTIONS] ${c7}[SUBCOMMANDS] ${c3}[<ARGS>]"
echo "${c8}OPTIONS:"
echo "${c8}--color=<yes|no|auto>
${c4}Enable/Disable colorized output (default: auto)"
echo "${c8}--help
${c4}(same as: help)"
echo "${c8}--help-pager
${c4}(same as: helppager)"
echo "${c8}--show-translations
${c4}Show XBPS command translations for $progname sub-commands"
echo "${c8}--verbose
${c4}Verbose mode (shows XBPS command translations during execution)"
echo "${c8}--version
${c4}Show version and exit"
echo "$c2"
echo "${c2}long:${c7}SUBCOMMANDS${c1}:(short) ${c3}<ARGS>"
echo "$c4"
echo "${c2}help
${c4}Show usage information"
echo "${c2}helppager ${c1}(hp)
${c4}Show usage information (will pipe output to less/more)"
echo "${c2}about ${c1}(a) ${c3}<pkg>
${c4}Show information about <package>"
t "xbps-query -v -R"
echo "${c2}filelist ${c1}(fl) ${c3}<pkg>
${c4}Show file-list of <package>"
t "xbps-query -v -R -f"
echo "${c2}deps ${c1}(d) ${c3}<pkg>
${c4}Show dependencies for <package>"
t "xbps-query -v -R -x"
echo "${c2}reverse ${c1}(rd) ${c3}<pkg>
${c4}Show reverse dependendies of <package> (see man xbps-query)"
t "xbps-query -v -R -X"
echo "${c2}search ${c1}(s) ${c3}<pkg>
${c4}Search for package"
t "xbps-query -v -Rs"
echo "${c2}searchlib ${c1}(sl) ${c3}<pkg>
${c4}Search for package (multilib exclude)"
t "xbps-query -v -Rs"
echo "${c2}searchfile ${c1}(sf) ${c3}<file>
${c4}Search for package containing <file> (local)"
t "xbps-query -v -o \"*/$1\""
echo "${c2}whatprovides ${c1}(wp) ${c3}<file>
${c4}Search for package containing <file>"
t "xlocate ${c3}<pkg>"
echo "${c2}list ${c1}(ls)
${c4}List installed packages"
t "xbps-query -v -l"
echo "${c2}listw ${c1}(lw)
${c4}List installed packages without their version"
t "xbps-query -l | awk '{ print $2 }' | xargs -n1 xbps-uhelper getpkgname"
echo "${c2}listalternatives ${c1}(la)
${c4}List alternative candidates"
t "xbps-alternatives -l"
echo "${c2}listrepos ${c1}(lr)
${c4}List configured repositories"
echo "${c2}repolist ${c1}(rl)
${c4}Alias for listrepos"
t "xbps-query -v -L"
echo "${c2}sync ${c1}(sy)
${c4}Synchronize remote repository data"
t "xbps-install -S"
echo "${c2}update ${c1}(up)
${c4}Update the system"
t "xbps-install -Suv"
echo "${c2}addrepo ${c1}(ad) ${c3}<ARGS>
${c4}Add an additional repository"
t "xbps-install <ARGS>"
echo "${c2}install ${c1}(i) ${c3}<pkg(s)>
${c4}Install <package(s)>"
t "xbps-install"
echo "${c2}devinstall ${c1}(di) ${c3}<pkg(s)>
${c4}Install <package> and devel-<package>(s)"
t "xbps-install <package> <package>-devel"
echo "${c2}reconfigure ${c1}(rc) ${c3}<pkg>
${c4}Re-configure installed <package>"
t "xbps-reconfigure -v"
echo "${c2}forceinstall ${c1}(fi) ${c3}<pkg(s)>
${c4}Force installation of <package(s)>"
t "xbps-install -f"
echo "${c2}setalternative ${c1}(sa) ${c3}<pkg(s)>
${c4}Set alternative for <package>"
t "xbps-alternatives -s"
echo "${c2}remove ${c1}(rm) ${c3}<pkg(s)>
${c4}Remove <package(s)> from the system"
t "xbps-remove -v "
echo "${c2}removerecursive ${c1}(rr) ${c3}<pkg(s)>
${c4}Recursively remove package(s) (and its dependencies)"
t "xbps-remove -v -R"
echo "${c2}cleanup ${c1}(cl)
${c4}Remove obsolete packages in cachedir"
t "xbps-remove -v -O"
echo "${c2}autoremove ${c1}(ar)
${c4}Remove orphaned packages"
t "xbps-remove -v -o"
echo "$c2"
echo "${c2}XBPS COMPATIBILITY:"
echo "$c2"
f=(/usr/sbin/xbps-*)
echo "${c4}$progname also understands all unknown XBPS sub-commands, too:"
echo -n "${c2}Example: ${c7}"
selected=${f[$RANDOM % ${#f[@]}]}
echo "$progname ${selected##*-} <ARGS>
${c2}see also: ${c4}/usr/sbin/xbps-*"
echo -n "$c"
}
setcolors auto
case "$1" in
--color=true|--color=yes|--color=on)
setcolors on
shift
;;
--color=auto)
setcolors auto
shift
;;
--color=false|--color=off|--color=no)
setcolors off
shift
;;
--verbose=true)
shift
verbose=true
;;
--show-translations)
shift
show_translations=1
;;
--help)
shift
usage
exit 255
;;
--help-pager)
shift
"$0" --color=off --help | less
;;
--*)
msg "Unknown option: $1 (try: $progname --help)"
exit 1
;;
esac
if [[ -z $1 ]]; then
usage
exit 0
fi
cmd=$1
if [[ $arg =~ --.* ]]; then
cmd=${arg:2}
fi
shift
case "$cmd" in
about|a)
wrapcommand xbps-query -v -R "$@"
;;
filelist|fl|listfiles)
wrapcommand xbps-query -v -R -f "$@"
;;
deps|dep|dependencies|d)
wrapcommand xbps-query -v -R -x "$@"
;;
reverse|rd)
msg -n "Reverse dependencies for $* "
wrapcommand xbps-query -v -R -X "$@"
;;
searchfile|sf)
msg -n 'searchfile '
wrapcommand xbps-query -v -o "*/$1"
;;
remotesearchfile|rsf)
msg -n 'remotesearchfile '
wrapcommand xbps-query -R -v -o "*/$1"
;;
list|ls)
msg -n 'Installed packages: '
count=0
while read -r _ pkg _; do
((count++))
pkgname=${pkg%-*}
version=${pkg##*-}
printf '%s%d %s%s %s (%s%s%s) [%s%s%s]%s\n' \
"$c8" "$count" \
"$c4" "$pkgname" \
"$c6" \
"$c2" "$version" \
"$c6" \
"$c7" "$pkg" \
"$c6" \
"$c"
done < <(xbps-query -v -l)
;;
listw|lw)
xbps-query -l | awk '{ print $2 }' | xargs -n1 xbps-uhelper getpkgname
;;
listalternative|listalternatives|la)
wrapcommand xbps-alternatives -l "$@"
;;
setalternative|setalternatives|sa)
rootcheck
wrapcommand xbps-alternatives -s "$@"
echo
;;
repolist|listrepos|rl|lr)
code=0
msg -n "Configured repositories (xbps-query -v -L): "
xbps-query -v -L
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-query -v -L] return code: $ret"
echo
msg -n "Available sub-repositories (xbps-query -v -Rs void-repo): "
xbps-query -v -Rs void-repo
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-query -v -Rs void-repo] return code: $ret"
echo
msg -n "Use \"$progname addrepo <repository>\" to add a sub-repository."
echo
exit "$code"
;;
addrepo|ad)
rootcheck
echo
if (($# < 1)); then
rmsg 255 "ERROR: install: argument missing, try --help."
exit 1
fi
code=0
for repo in "$@"; do
msg "Adding repository: $repo"
$SUDO xbps-install "$repo"
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-install $arg] return code: $ret"
msg "Synchronizing remote repository data (xbps-install -S): "
$SUDO xbps-install -S
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-install -S] return code: $ret"
done
exit "$code"
;;
sync|sy)
rootcheck
msg -n 'Synchronizing remote repository data '
echo
wrapcommand $SUDO xbps-install -S
;;
install|i)
rootcheck
if (($# < 1)); then
rmsg 255 "ERROR: install: argument missing, try --help."
exit 1
fi
msg -n "Installing packages: $* "
echo
wrapcommand $SUDO xbps-install "$@"
;;
yesinstall)
rootcheck
if (($# < 1)); then
rmsg 255 "ERROR: install: argument missing, try --help."
exit 1
fi
msg -n "Installing packages (assumed yes): $* "
echo
wrapcommand $SUDO xbps-install -y "$@"
;;
devinstall)
rootcheck
if (($# < 1)); then
rmsg 255 "ERROR: devinstall: argument missing, try --help."
exit 1
fi
args=("$@")
code=0
msg "devinstall: Packages will be installed one-by-one"
msg "Use \"forceinstall\" to override this if you know what you're doing."
msg "(Note: forceinstall won't install -devel packages)"
for arg in "${args[@]}"; do
msg "Installing package: $arg (xbps-install $arg) ..."
$SUDO xbps-install "$arg"
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-install $arg] return code: $ret"
msg "installing devel package (${arg}-devel):"
$SUDO xbps-install "${arg}-devel"
ret=$?
((ret == 0)) || code=1
rmsg "$ret" "[xbps-install ${arg}-devel] return code: $ret"
done
exit "$code"
;;
forceinstall|fi)
rootcheck
msg -n "Force-Installing Package(s): $* "
echo
wrapcommand $SUDO xbps-install -f "$@"
;;
remove|rm)
rootcheck
msg -n "Removing package(s): $* "
echo
wrapcommand $SUDO xbps-remove -v "$@"
;;
removerecursive|rr)
rootcheck
msg -n "Removing package(s) recursively: $* "
echo
wrapcommand $SUDO xbps-remove -v -R "$@"
;;
reconfigure|rc)
rootcheck
msg -n 'reconfigure: Re-configuring package(s) '
echo
wrapcommand $SUDO xbps-reconfigure -v "$@"
;;
autoremove|ar)
rootcheck
msg -n 'autoremove: Removing orphaned packages '
echo
wrapcommand $SUDO xbps-remove -v -o
;;
update|upgrade|up)
rootcheck
msg -n 'Running system update '
echo
$SUDO xbps-install -Suv
if [[ $? == 16 ]]; then
msg -n "$(tput setaf 1)Updating xbps $(tput sgr 0)"
$SUDO xbps-install -u xbps
wrapcommand $SUDO xbps-install -Suv
else
if [[ $? == 1 ]]; then
msg -n 'Your system is up to date.'
else
msg -n $? 'Something goes wrong!'
fi
fi
msg -n 'Checking if something need restart...'
xcheckrestart
;;
search|s)
msg -n "Searching for: $* "
wrapcommand xbps-query -v -Rs "$*"
;;
# TODO: instead of grep use proper command
searchlib|sl)
msg -n "Searching for: $* "
wrapcommand xbps-query -v -Rs "$*" | grep -v 32bit
;;
cleanup|clean|cl)
msg -n 'Remove obsolete packages in cachedir '
rootcheck
echo
wrapcommand $SUDO xbps-remove -v -O "$@"
;;
h|help|-h|--help)
usage
;;
helppager|help-pager|hp)
pager=$PAGER
if [[ -z $pager ]]; then
if command -v less &>/dev/null; then
pager=less
else
pager=more
fi
fi
"$0" --color=off help | $pager
exit 0
;;
version|v)
version
exit 0
;;
whatprovides|wp)
if ! command -v xlocate &>/dev/null; then
rmsg 255 "xlocate not found. Try installing the xtools package."
exit 1
fi
msg -n "relaying to xlocate - use xlocate -S to (re-)build cached DB. "
wrapcommand xlocate "$@"
;;
''|*)
xbpscmd="xbps-$cmd"
if ! command -v "$xbpscmd" &>/dev/null; then
rmsg 255 "Unrecognized $progname subcommand: $cmd (and $xbpscmd does not exist) - Try: $progname help"
echo
exit 1
fi
# xbps-<subcommand> found
msg -n 'relaying to XBPS: '
wrapcommand "$xbpscmd" "$@"
;;
esac
# enjoy and make better if you can...

View file

@ -1,11 +1,11 @@
#!/bin/bash
# vim: ft=sh ts=2 sw=2 sts=2 et
# vbm - vb-linux management utility for
# vpm2 - vb-linux management utility for
# XBPS, the X Binary Package System
# original author: Armin Jenewein <a@m2m.pm>, GitHub: @netzverweigerer
# original authorof vpm: Armin Jenewein <a@m2m.pm>, GitHub: @netzverweigerer
# a lot used from: Dave Eddy <dave@daveeddy.com>, GitHub: @bahamas10
# this fork: zenobit from oSoWoSo <pm@osowoso.xyz>, codeberg.org: @oSoWoSo
# this fork vpm2: zenobit from oSoWoSo <pm@osowoso.xyz>, codeberg.org: @oSoWoSo
# For more information about XBPS, see:
# https://github.com/voidlinux/xbps
# Released under the terms of the GNU general public license, version 3+
@ -15,10 +15,10 @@
version="1.4.1"
# disable verbosity by default
verbose=false
# override color settigs
# override color settings
colors=auto
# VBM color definitions
# VPM color definitions
numc1=1
numc2=2
numc3=3
@ -27,7 +27,7 @@ numc5=5
numc6=6
numc7=7
numc8=8
# second definition
c=$(tput sgr0)
c1=${numc1}
c2=${numc2}
c3=${numc3}
@ -116,7 +116,7 @@ getlogo () {
"$c"
}
# prints a message (with vbm-prefix)
# prints a message (with vpm-prefix)
msg () {
local logo=$(getlogo)
local newline=true
@ -149,15 +149,18 @@ rmsg () {
banner () {
echo -n "$c5"
echo ' __ __/|__ _ __ '
echo ' __ ___ __ _ __ '
printf " \\ V / '_ \\ ' \ "
echo -n "$c2"
echo " $progname - An XBPS package management helper"
echo " $progname - void package management utility for XBPS"
echo -n "$c5"
echo -n ' \_/|_,__/_|_|_\'
echo -n ' \_/| .__/_|_|_\'
echo -n "$c2"
echo ' Source: https://codeberg.org/oSoWoSo/vbm'
echo ' GitHub: https://github.com/netzverweigerer/vpm'
echo -n "$c5"
echo ' |/ '
echo ' ´ '
echo -n "$c"
}
@ -203,9 +206,9 @@ wrapcommand() {
}
usage () {
echo "${c2}USAGE:
${c1}${progname} ${c8}[OPTIONS] ${c7}[SUBCOMMANDS] ${c3}[<ARGS>]
${c8}OPTIONS:
echo "${c2}USAGE:
${c1}${progname} ${c8}[OPTIONS] ${c7}[SUBCOMMANDS] ${c3}[<ARGS>]
${c8} OPTIONS :
${c8}--color=<yes|no|auto>
${c4}Enable/Disable colorized output (default: auto)
${c8}--help
@ -216,7 +219,7 @@ ${c8}--show-translations
${c4}Show XBPS command translations for $progname sub-commands
${c8}--verbose
${c4}Verbose mode (shows XBPS command translations during execution)
${c2}long:${c7}SUBCOMMANDS${c1}:${c1}(short) ${c3}<ARGS>
${c2} long : ${c7}SUBCOMMANDS${c1} : ${c1}(short) ${c3}<ARGS>
${c2}help
${c4}Show usage information
${c2}helppager ${c1}(hp)
@ -297,7 +300,7 @@ ${c2}about ${c1}(a) ${c3}<pkg>
echo "${c2}autoremove ${c1}(ar)
${c4}Remove orphaned packages"
t "xbps-remove -v -o"
echo "${c2}XBPS COMPATIBILITY${c2}:"
echo "${c2} XBPS COMPATIBILITY ${c2}: "
f=(/usr/sbin/xbps-*)
echo "${c4}$progname also understands all unknown XBPS sub-commands, too:"
echo -n "${c2}Example: ${c7}"