preJailUpdate hook
Joe Marcus Clarke
marcus at marcuscom.com
Sat Aug 6 14:29:46 EDT 2011
On 7/26/11 1:16 PM, Mark Johnston wrote:
> I have a pair of patches for the preJailUpdate hook that I was hoping to
> have committed. The first addresses the fact that the UPDATE_CMD
> variable is supposed to be passed, but isn't. The second is just to add
> the jail arch to the hook. I've found this useful when using custom
> update scripts.
>
> Would anyone be willing to review and commit these patches?
Why didn't you pass JAIL_ARCH to the first invocation?
Joe
>
> Thanks,
> -Mark
>
> diff --git a/lib/tc_command.sh b/lib/tc_command.sh
> index 4aa537e..961fffc 100644
> --- a/lib/tc_command.sh
> +++ b/lib/tc_command.sh
> @@ -606,7 +606,9 @@ updateJail () {
> return 1
> fi
>
> - execute_hook "preJailUpdate" "JAIL=${jailName} PB=${pb}"
> + updateCmd=$($(tinderLoc scripts tc) getUpdateCmd -j ${jailName})
> +
> + execute_hook "preJailUpdate" "JAIL=${jailName} UPDATE_CMD=${updateCmd} PB=${pb}"
> if [ $? -ne 0 ]; then
> echo "updateJail: hook preJailUpdate failed. Terminating."
> return 1
> diff --git a/lib/tc_command.sh b/lib/tc_command.sh
> index 961fffc..624c0f6 100644
> --- a/lib/tc_command.sh
> +++ b/lib/tc_command.sh
> @@ -607,8 +607,9 @@ updateJail () {
> fi
>
> updateCmd=$($(tinderLoc scripts tc) getUpdateCmd -j ${jailName})
> + jailArch=$($(tinderLoc scripts tc) getJailArch -j ${jailArch})
>
> - execute_hook "preJailUpdate" "JAIL=${jailName} UPDATE_CMD=${updateCmd} PB=${pb}"
> + execute_hook "preJailUpdate" "JAIL=${jailName} UPDATE_CMD=${updateCmd} PB=${pb} JAIL_ARCH=${jailArch}"
> if [ $? -ne 0 ]; then
> echo "updateJail: hook preJailUpdate failed. Terminating."
> return 1
> diff --git a/sql/values.hooks b/sql/values.hooks
> index 79405df..e51bc03 100644
> --- a/sql/values.hooks
> +++ b/sql/values.hooks
> @@ -8,7 +8,7 @@ INSERT INTO hooks VALUES ('prePortsTreeUpdate', NULL, 'Hook to run prior to upda
> INSERT INTO hooks VALUES ('postPortsTreeUpdate', NULL, 'Hook to run after a PortsTree has been updated.\nThe following environment will be passed to the hook command:\n\tPORTSTREE : PortsTree name\n\tUPDATE_CMD : Update command\n\tPB : Tinderbox root\n\tRC : Result code of the update command');
> INSERT INTO hooks VALUES ('preBuildExtract', NULL, 'Hook to run prior to extracting a Build.\nIf this hook returns a non-zero value, the Build will not be extracted.\nThe following environment will be passed to the hook command:\n\tBUILD : Build name\n\tDESTDIR : Extract destination\n\tJAIL : Jail for this Build\n\tPB : Tinderbox root');
> INSERT INTO hooks VALUES ('postBuildExtract', NULL, 'Hook to run after a Build has been extracted.\nThe following environment will be passed to the hook command:\n\tBUILD : Build name\n\tDESTDIR : Extract destination\n\tJAIL : Jail for this Build\n\tPB : Tinderbox root\n\tRC : Result code of the extraction');
> -INSERT INTO hooks VALUES ('preJailUpdate', NULL, 'Hook to run prior to updating a Jail.\nIf this hook returns a non-zero value, the Jail will not be updated.\nThe following environment will be passed to the hook command:\n\tJAIL : Jail name\n\tUPDATE_CMD : Update command\n\tPB : Tinderbox root');
> +INSERT INTO hooks VALUES ('preJailUpdate', NULL, 'Hook to run prior to updating a Jail.\nIf this hook returns a non-zero value, the Jail will not be updated.\nThe following environment will be passed to the hook command:\n\tJAIL : Jail name\n\tUPDATE_CMD : Update command\n\tPB : Tinderbox root\n\tJAIL_ARCH : Jail architecture target');
> INSERT INTO hooks VALUES ('postJailUpdate', NULL, 'Hook to run after a Jail has been updated.\nThe following environment will be passed to the hook command:\n\tJAIL : Jail name\n\tUPDATE_CMD : Update command\n\tPB : Tinderbox root\n\tRC : Result code of the update command');
> INSERT INTO hooks VALUES ('preJailBuild', NULL, 'Hook to run before building a Jail.\nIf this hook returns a non-zero value, the Jail will not be built.\nThe following environment will be passed to the hook command:\n\tJAIL : Jail name\n\tJAIL_ARCH : Jail architecture target\n\tMY_ARCH : Current host architecture\n\tJAIL_OBJDIR : Object directory for Jail\n\tSRCBASE : Source code location for Jail\n\tPB : Tinderbox root');
> INSERT INTO hooks VALUES ('postJailBuild', NULL, 'Hook to run after building a Jail.\nThe following environment will be passed to the hook command:\n\tJAIL : Jail name\n\tJAIL_ARCH : Jail architecture target\n\tMY_ARCH : Current host architecture\n\tJAIL_OBJDIR : Object directory for Jail\n\tSRCBASE : Source code location for Jail\n\tPB : Tinderbox root\n\tRC : Result code of the build');
> _______________________________________________
> tinderbox-list at marcuscom.com mailing list
> http://marcuscom.com/mailman/listinfo/tinderbox-list
> To unsubscribe, send any mail to "tinderbox-list-unsubscribe at marcuscom.com"
>
--
PGP Key : http://www.marcuscom.com/pgp.asc
More information about the tinderbox-list
mailing list