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
printerr()
{
"${libexec}"/utils/printerr "$1"
}
. "${libexec}"/functions/print.sh
require_dependency()
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -10,6 +10,8 @@ installdir=$2
##
# functions
. "${libexec}"/functions/print.sh
erase()
{
dir="${1}"
@ -24,10 +26,6 @@ erase()
echo
}
printerr() {
"${libexec}"/utils/printerr "${1}"
}
##
# main
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
printok()
{
"${libexec}"/utils/printok "$1"
}
printerr()
{
"${libexec}"/utils/printerr "$1"
}
. "${libexec}"/functions/print.sh
verify_allowfile()
{

View file

@ -9,15 +9,7 @@ sharedir="${localbase}/share/portzap"
##
# functions
printok()
{
"${libexec}"/utils/printok "$1"
}
printerr()
{
"${libexec}"/utils/printerr "$1"
}
. "${libexec}"/functions/print.sh
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"
After this change, portzap emits less output
| Remove scripts
Remove "utils/printok", "utils/printerr", and "utils/git-rev"