Compare commits
3 commits
c41594ef62
...
382581136e
Author | SHA1 | Date | |
---|---|---|---|
382581136e | |||
2d6ec73e73 | |||
ed588bd7d7 |
6 changed files with 43 additions and 20 deletions
|
@ -10,8 +10,9 @@ can be installed into `/usr/ports/` by root.
|
||||||
|
|
||||||
#### CLI: setup-portzap
|
#### CLI: setup-portzap
|
||||||
|
|
||||||
This command should be run after installing portzap for
|
`setup-portzap` should be run after installing portzap for
|
||||||
the first time:
|
the first time. <br> There is no harm in running `setup-portzap`
|
||||||
|
multiple times:
|
||||||
|
|
||||||
# Add the '_portzap' user, group and home directory
|
# Add the '_portzap' user, group and home directory
|
||||||
# This command requires root privileges
|
# This command requires root privileges
|
||||||
|
|
|
@ -13,16 +13,7 @@ libexec="${localbase}"/libexec/portzap
|
||||||
##
|
##
|
||||||
# main
|
# main
|
||||||
if [ "$(id -u)" = "0" ]; then
|
if [ "$(id -u)" = "0" ]; then
|
||||||
if id -u _portzap > /dev/null 2>&1; then
|
"${libexec}"/setup/setup-user
|
||||||
printok "_portzap user exists"
|
|
||||||
else
|
|
||||||
pw useradd -n _portzap \
|
|
||||||
-c "portzap user" \
|
|
||||||
-m \
|
|
||||||
-s /sbin/nologin
|
|
||||||
chmod u=rwX,g=rX,o= /home/_portzap/
|
|
||||||
printok "_portzap user created"
|
|
||||||
fi
|
|
||||||
"${libexec}"/setup/setup-doas
|
"${libexec}"/setup/setup-doas
|
||||||
else
|
else
|
||||||
printerr "you must be root"
|
printerr "you must be root"
|
||||||
|
|
|
@ -34,5 +34,5 @@ fi
|
||||||
"${git}" clone "${giturl}" "${gitdir}"
|
"${git}" clone "${giturl}" "${gitdir}"
|
||||||
cd "${gitdir}"
|
cd "${gitdir}"
|
||||||
"${git}" config core.filemode off
|
"${git}" config core.filemode off
|
||||||
"${git}" checkout -t origin/"${branch}"
|
"${git}" checkout -t origin/"${branch}" || true
|
||||||
printok "clone complete"
|
printok "clone complete"
|
||||||
|
|
|
@ -45,13 +45,13 @@ perform_update()
|
||||||
perform_install()
|
perform_install()
|
||||||
{
|
{
|
||||||
find -s . \
|
find -s . \
|
||||||
-maxdepth 1 \
|
-maxdepth 1 \
|
||||||
! -name "." \
|
! -name "." \
|
||||||
! -name ".git" \
|
! -name ".git" \
|
||||||
! -name ".gitignore" \
|
! -name ".gitignore" \
|
||||||
! -name ".hooks" \
|
! -name ".hooks" \
|
||||||
! -name ".arcconfig" \
|
! -name ".arcconfig" \
|
||||||
-exec cp -Rpv {} "${installdir}" \;
|
-exec cp -Rpv {} "${installdir}" \;
|
||||||
chown -Rv root "${installdir}"
|
chown -Rv root "${installdir}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
26
libexec/portzap/setup/setup-user
Normal file
26
libexec/portzap/setup/setup-user
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
##
|
||||||
|
# variables
|
||||||
|
localbase=${LOCALBASE:-$(realpath "$(dirname "$0")"/../../..)}
|
||||||
|
libexec="${localbase}"/libexec/portzap
|
||||||
|
user="_portzap"
|
||||||
|
|
||||||
|
##
|
||||||
|
# functions
|
||||||
|
. "${libexec}"/functions/print.sh
|
||||||
|
|
||||||
|
##
|
||||||
|
# main
|
||||||
|
if id -u "${user}" > /dev/null 2>&1; then
|
||||||
|
printok "${user} user exists"
|
||||||
|
else
|
||||||
|
pw useradd
|
||||||
|
-n "${user}" \
|
||||||
|
-c "portzap user" \
|
||||||
|
-m \
|
||||||
|
-s /sbin/nologin
|
||||||
|
chmod u=rwX,g=rX,o= /home/"${user}"/
|
||||||
|
printok "${user} user created"
|
||||||
|
fi
|
|
@ -1,5 +1,10 @@
|
||||||
v?.?.?
|
v?.?.?
|
||||||
|
|
||||||
|
| Add libexec/portzap/setup/setup-user
|
||||||
|
Move the code that handles the creation of the '_portzap'
|
||||||
|
user from bin/setup-portzap to the libexec/portzap/setup/
|
||||||
|
directory
|
||||||
|
|
||||||
| Set "diff.renameLimit" to unlimited
|
| Set "diff.renameLimit" to unlimited
|
||||||
After this change, portzap forwards "-l0" to "git diff"
|
After this change, portzap forwards "-l0" to "git diff"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue