Replace script

Remove scripts that have been replaced by alternatives
This commit is contained in:
0x1eef 2024-07-21 21:41:12 -03:00
parent c2a3578a55
commit af917c0649
13 changed files with 29 additions and 92 deletions

View file

@ -13,10 +13,7 @@ revfile="${installdir}"/.portzap
## ##
# functions # functions
printerr() . "${libexec}"/functions/print.sh
{
"${libexec}"/utils/printerr "$1"
}
require_dependency() require_dependency()
{ {

View file

@ -8,15 +8,7 @@ libexec="${localbase}"/libexec/portzap
## ##
# functions # functions
printok() . "${libexec}"/functions/print.sh
{
"${libexec}"/utils/printok "$1"
}
printerr()
{
"${libexec}"/utils/printerr "$1"
}
## ##
# main # main

View file

@ -5,23 +5,13 @@ set -e
# variables # variables
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)} localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
libexec="${localbase}"/libexec/portzap libexec="${localbase}"/libexec/portzap
git="${libexec}"/utils/git/run
gitdir=$1 gitdir=$1
branch=$2 branch=$2
## ##
# functions # functions
gitexec() . "${libexec}"/functions/print.sh
{
"${libexec}"/utils/gitexec "${1}"
}
printok() {
"${libexec}"/utils/printok "${1}"
}
printerr() {
"${libexec}"/utils/printerr "${1}"
}
## ##
# main # main
@ -41,7 +31,7 @@ if [ ! -e "${gitdir}/.git" ]; then
fi fi
cd "${gitdir}" cd "${gitdir}"
gitexec "fetch origin" "${git}" fetch origin
gitexec "checkout ${branch}" || "${git}" checkout "${branch}" ||
gitexec "checkout -t origin/${branch}" "${git}" checkout -t origin/"${branch}"
printok "${branch} checked out" printok "${branch} checked out"

View file

@ -12,13 +12,7 @@ branch=$3
## ##
# functions # functions
printok() { . "${libexec}"/functions/print.sh
"${libexec}"/utils/printok "${1}"
}
printerr() {
"${libexec}"/utils/printerr "${1}"
}
## ##
# main # main

View file

@ -13,6 +13,8 @@ revfile=$3
## ##
# functions # functions
. "${libexec}"/functions/print.sh
perform_update() perform_update()
{ {
rev=$(cat "${revfile}") rev=$(cat "${revfile}")
@ -58,14 +60,6 @@ run_install()
install -o root -g _portzap -m "${mode}" -v "${@}" install -o root -g _portzap -m "${mode}" -v "${@}"
} }
printok() {
"${libexec}"/utils/printok "${1}"
}
printerr() {
"${libexec}"/utils/printerr "${1}"
}
## ##
# main # main
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then

View file

@ -10,13 +10,7 @@ gitdir=$1
## ##
# functions # functions
printok() { . "${libexec}"/functions/print.sh
"${libexec}"/utils/printok "${1}"
}
printerr() {
"${libexec}"/utils/printerr "${1}"
}
## ##
# main # main

View file

@ -10,6 +10,8 @@ installdir=$2
## ##
# functions # functions
. "${libexec}"/functions/print.sh
erase() erase()
{ {
dir="${1}" dir="${1}"
@ -24,10 +26,6 @@ erase()
echo echo
} }
printerr() {
"${libexec}"/utils/printerr "${1}"
}
## ##
# main # main
if [ "$(id -u)" != "0" ]; then if [ "$(id -u)" != "0" ]; then

View file

@ -0,0 +1,11 @@
#!/bin/sh
printok()
{
printf "ok: %s\n" "${1}" > /dev/stdout
}
printerr()
{
printf "error: %s\n" "${1}" > /dev/stderr
}

View file

@ -10,15 +10,7 @@ sharedir="${localbase}"/share/portzap
## ##
# functions # functions
printok() . "${libexec}"/functions/print.sh
{
"${libexec}"/utils/printok "$1"
}
printerr()
{
"${libexec}"/utils/printerr "$1"
}
verify_allowfile() verify_allowfile()
{ {

View file

@ -9,15 +9,7 @@ sharedir="${localbase}/share/portzap"
## ##
# functions # functions
printok() . "${libexec}"/functions/print.sh
{
"${libexec}"/utils/printok "$1"
}
printerr()
{
"${libexec}"/utils/printerr "$1"
}
install_doasconf() install_doasconf()
{ {

View file

@ -1,10 +0,0 @@
#!/bin/sh
set -e
##
# variables
err="${1}"
##
# main
printf "error: %s\n" "${err}" > /dev/stderr

View file

@ -1,10 +0,0 @@
#!/bin/sh
set -e
##
# variables
msg="${1}"
##
# main
printf "ok: %s\n" "${msg}" > /dev/stdout

View file

@ -8,3 +8,6 @@ v?.?.?
| Remove "set -x" | Remove "set -x"
After this change, portzap emits less output After this change, portzap emits less output
| Remove scripts
Remove "utils/printok", "utils/printerr", and "utils/git-rev"