From e796f563c4af7a265a1f8ecd94e7f3f795a78839 Mon Sep 17 00:00:00 2001 From: David Steele Date: Fri, 3 Jun 2016 20:07:28 -0400 Subject: [PATCH] Add cmd-extra field. Allow hidden options to be added to a command. This allows certain commands (like apt-get) to be forced during the build without making that a part of the documentation. --- doc/lib/BackRestDoc/Common/DocExecute.pm | 14 ++++++++++---- doc/xml/dtd/doc.dtd | 3 ++- doc/xml/release.xml | 6 ++++++ doc/xml/user-guide.xml | 15 ++++++++------- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/doc/lib/BackRestDoc/Common/DocExecute.pm b/doc/lib/BackRestDoc/Common/DocExecute.pm index 11e78e398..3a87348db 100644 --- a/doc/lib/BackRestDoc/Common/DocExecute.pm +++ b/doc/lib/BackRestDoc/Common/DocExecute.pm @@ -115,6 +115,11 @@ sub executeKey output => JSON::PP::false, }; + if (defined($oCommand->fieldGet('exe-cmd-extra', false))) + { + $$hCacheKey{'cmd-extra'} = $oCommand->fieldGet('exe-cmd-extra'); + } + if (defined($oCommand->paramGet('err-expect', false))) { $$hCacheKey{'err-expect'} = $oCommand->paramGet('err-expect'); @@ -211,10 +216,11 @@ sub execute confess &log(ERROR, "cannot execute on host ${strHostName} because the host does not exist"); } - my $oExec = $oHost->execute($strCommand, - {iExpectedExitStatus => $$hCacheKey{'err-expect'}, - bSuppressError => $oCommand->paramTest('err-suppress', 'y'), - iRetrySeconds => $oCommand->paramGet('retry', false)}); + my $oExec = $oHost->execute( + $strCommand . (defined($$hCacheKey{'cmd-extra'}) ? ' ' . $$hCacheKey{'cmd-extra'} : ''), + {iExpectedExitStatus => $$hCacheKey{'err-expect'}, + bSuppressError => $oCommand->paramTest('err-suppress', 'y'), + iRetrySeconds => $oCommand->paramGet('retry', false)}); $oExec->begin(); $oExec->end(); diff --git a/doc/xml/dtd/doc.dtd b/doc/xml/dtd/doc.dtd index 7fa1e9d22..c5e15c8c2 100644 --- a/doc/xml/dtd/doc.dtd +++ b/doc/xml/dtd/doc.dtd @@ -55,7 +55,7 @@ - @@ -69,6 +69,7 @@ + diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 3829ee387..572a4fd84 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -86,6 +86,12 @@ + + +

Allow hidden options to be added to a command. This allows certain commands (like apt-get) to be forced during the build without making that a part of the documentation.

+
+
+

Recommended install location for modules is now /usr/share/perl5 since /usr/lib/perl5 has been removed from the search path in newer versions of Perl.

diff --git a/doc/xml/user-guide.xml b/doc/xml/user-guide.xml index f75c96b71..fdf05c481 100644 --- a/doc/xml/user-guide.xml +++ b/doc/xml/user-guide.xml @@ -156,24 +156,26 @@ -

is written in Perl which is included with {[user-guide-os]} by default. A few additional modules are required which are all available as packages.

+

is written in Perl which is included with {[user-guide-os]} by default. The DBD::Pg module must also be installed.

- Install required Perl packages + Install the <id>DBD::Pg</id> module - apt-get install libdbd-pg-perl libdbi-perl libnet-daemon-perl libplrpc-perl + apt-get install libdbd-pg-perl + -y -

is written in Perl which is not included with {[user-guide-os]} by default, however all required modules are all available as standard packages.

+

is written in Perl which is not included with {[user-guide-os]} by default, however all required modules are available as standard packages.

Install required Perl packages - yum -y install perl perl-Time-HiRes perl-parent perl-JSON + yum install perl perl-Time-HiRes perl-parent perl-JSON perl-Digest-SHA perl-DBD-Pg + -y @@ -1397,8 +1399,7 @@ - apt-get -y install libdbd-pg-perl libdbi-perl - libnet-daemon-perl libplrpc-perl + apt-get -y install libdbd-pg-perl