sysutils/pot: Update to 0.6.0

Changes: https://github.com/pizzamig/pot/releases/tag/0.6.0
This commit is contained in:
Luca Pizzamiglio 2019-06-24 08:02:18 +00:00
parent a22fcd9dda
commit e4ad57b072
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=505011
5 changed files with 53 additions and 23 deletions

View file

@ -2,7 +2,7 @@
# $FreeBSD$ # $FreeBSD$
PORTNAME= pot PORTNAME= pot
PORTVERSION= 0.5.11 PORTVERSION= 0.6.0
CATEGORIES= sysutils CATEGORIES= sysutils
MAINTAINER= pizzamig@FreeBSD.org MAINTAINER= pizzamig@FreeBSD.org

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1553877138 TIMESTAMP = 1561300420
SHA256 (pizzamig-pot-0.5.11_GH0.tar.gz) = 754e867773ce7a1dd67fb526897d11f8b1b912843ee551e217127d0b7aeb9402 SHA256 (pizzamig-pot-0.6.0_GH0.tar.gz) = 507d777c81d6d214fe522c9c914fb325138957c2a02bedd9e0becf755cc224e1
SIZE (pizzamig-pot-0.5.11_GH0.tar.gz) = 116316 SIZE (pizzamig-pot-0.6.0_GH0.tar.gz) = 122515

View file

@ -3,3 +3,10 @@ Now, before to run 'pot init', it would be wise to edit the configuration file
Do not edit pot.default.conf, but pot.conf instead. Do not edit pot.default.conf, but pot.conf instead.
Configuration files are stored in %%ETCDIR%%/ Configuration files are stored in %%ETCDIR%%/
To upgrade from prevoius versions of pot (<0.6.0) to 0.6.0+ the following steps are suggested:
* stop all your pots
* re-run `pot init`
* if needed, restart pf
The variable `pot_list` in the rc.conf file is deprecated.
Use `pot set-attr` to enable the attribute start-at-boot to your pot

View file

@ -2,7 +2,8 @@
# $FreeBSD$ # $FreeBSD$
# PROVIDE: pot # PROVIDE: pot
# REQUIRE: LOGIN # REQUIRE: NETWORKING syslogd pf
# BEFORE: ntpdate
# KEYWORD: shutdown nojail # KEYWORD: shutdown nojail
. /etc/rc.subr . /etc/rc.subr
@ -15,31 +16,45 @@ start_cmd="pot_start"
stop_cmd="pot_stop" stop_cmd="pot_stop"
restart_cmd="pot_restart" restart_cmd="pot_restart"
status_cmd="pot_status" status_cmd="pot_status"
start_precmd="pot_deprecated_start"
stop_postcmd="pot_deprecated_stop"
load_rc_config $name load_rc_config $name
: ${pot_enable:=NO} : ${pot_enable:=NO}
: ${pot_list:=""} : ${pot_list:=""}
pot_deprecated_start()
{
if [ -n "$pot_list" ]; then
echo "pot_list is deprecated! please use pot set-attr to set the start-at-boot attribute to your pot"
fi
}
pot_deprecated_stop()
{
if [ -n "$pot_list" ]; then
echo "pot_list is deprecated! please use pot set-attr to set the start-at-boot attribute to your pot"
fi
}
pot_start() pot_start()
{ {
local _pname local _pname _dyn_pot_list _start
for _pname in $pot_list ; do _dyn_pot_list=$(/usr/local/bin/pot ls -q)
if %%PREFIX%%/bin/${name} info -qp $_pname ; then for _pname in $_dyn_pot_list ; do
%%PREFIX%%/bin/${name} start $_pname if _start=$( /usr/local/bin/pot get-attr -p "$_pname" -A start-at-boot -q ) && [ "$_start" = "YES" ]; then
else /usr/local/bin/pot start "$_pname"
echo "pot start: pot $_pnmame not found"
fi fi
done done
} }
pot_stop() pot_stop()
{ {
local _pname local _pname _dyn_pot_list _start
for _pname in $pot_list ; do _dyn_pot_list=$(/usr/local/bin/pot ls -q)
if %%PREFIX%%/bin/${name} info -qp $_pname ; then for _pname in $_dyn_pot_list ; do
%%PREFIX%%/bin/${name} stop $_pname if _start=$( /usr/local/bin/pot get-attr -p "$_pname" -A start-at-boot -q ) && [ "$_start" = "YES" ]; then
else /usr/local/bin/pot stop "$_pname"
echo "pot stop: pot $_pname not found"
fi fi
done done
} }
@ -47,18 +62,22 @@ pot_stop()
pot_restart() pot_restart()
{ {
pot_stop pot_stop
pot_deprecated_stop
sleep 5 sleep 5
pot_start pot_start
pot_deprecated_start
} }
pot_status() pot_status()
{ {
local _p local _pname _dyn_pot_list _start
for _p in $pot_list ; do for _pname in $_dyn_pot_list ; do
if %%PREFIX%%/bin/${name} info -qrp $_p ; then if _start=$( /usr/local/bin/pot get-attr -p "$_pname" -A start-at-boot -q ) && [ "$_start" = "YES" ]; then
echo "pot $_p is up and running" if /usr/local/bin/pot info -qrp "$_pname" ; then
else echo "pot $_pname is up and running"
echo "pot $_p is not running" else
echo "pot $_pname is not running"
fi
fi fi
done done
} }

View file

@ -3,6 +3,7 @@ bin/pot
@sample %%ETCDIR%%/pot.conf.sample @sample %%ETCDIR%%/pot.conf.sample
%%ETCDIR%%/pot.default.conf %%ETCDIR%%/pot.default.conf
%%DATADIR%%/add-dep.sh %%DATADIR%%/add-dep.sh
%%DATADIR%%/add-file.sh
%%DATADIR%%/add-fscomp.sh %%DATADIR%%/add-fscomp.sh
%%DATADIR%%/clone-fscomp.sh %%DATADIR%%/clone-fscomp.sh
%%DATADIR%%/clone.sh %%DATADIR%%/clone.sh
@ -14,8 +15,10 @@ bin/pot
%%DATADIR%%/create.sh %%DATADIR%%/create.sh
%%DATADIR%%/de-init.sh %%DATADIR%%/de-init.sh
%%DATADIR%%/destroy.sh %%DATADIR%%/destroy.sh
%%DATADIR%%/execute.sh
%%DATADIR%%/export.sh %%DATADIR%%/export.sh
%%DATADIR%%/export-ports.sh %%DATADIR%%/export-ports.sh
%%DATADIR%%/get-attribute.sh
%%DATADIR%%/help.sh %%DATADIR%%/help.sh
%%DATADIR%%/import.sh %%DATADIR%%/import.sh
%%DATADIR%%/info.sh %%DATADIR%%/info.sh
@ -26,6 +29,7 @@ bin/pot
%%DATADIR%%/purge-snapshots.sh %%DATADIR%%/purge-snapshots.sh
%%DATADIR%%/rename.sh %%DATADIR%%/rename.sh
%%DATADIR%%/revert.sh %%DATADIR%%/revert.sh
%%DATADIR%%/set-attribute.sh
%%DATADIR%%/set-cmd.sh %%DATADIR%%/set-cmd.sh
%%DATADIR%%/set-rss.sh %%DATADIR%%/set-rss.sh
%%DATADIR%%/show.sh %%DATADIR%%/show.sh