From 9a1e777b068084dd4d420dd2a4db5d8a701ac1d2 Mon Sep 17 00:00:00 2001 From: Flavio Poletti Date: Fri, 8 Aug 2008 16:53:26 +0200 Subject: [PATCH] Fixed documentation, added auto-generation of remote-at from remote if needed. --- deployable | 60 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/deployable b/deployable index 266b9f8..39577aa 100755 --- a/deployable +++ b/deployable @@ -25,14 +25,20 @@ my %config = ( deploy => [], ); GetOptions( - \%config, 'usage', - 'help', 'man', - 'version', 'output|o=s', - 'deploy|exec|d=s@', 'workdir|work-directory|deploy-directory|w=s', - 'cleanup|c!', - 'heredir|H=s@', 'bundle|all-exec|X!', - 'rootdir|R=s@', 'root|r=s@', - 'include-archive-tar|T!', + \%config, + qw( + usage! help! man! version! + + bundle|all-exec|X! + cleanup|c! + deploy|exec|d=s@ + heredir|H=s@ + include-archive-tar|T! + output|o=s + root|r=s@ + rootdir|R=s@ + workdir|work-directory|deploy-directory|w=s + ), ); pod2usage(message => "$0 $VERSION", -verbose => 99, -sections => '') if $config{version}; @@ -48,9 +54,16 @@ pod2usage( ) if exists $config{workdir} && !file_name_is_absolute($config{workdir}); -$config{remote} = catfile(dirname(realpath(__FILE__)), 'remote-at') - if $config{'include-archive-tar'}; - +if ($config{'include-archive-tar'}) { + $config{remote} = catfile(dirname(realpath(__FILE__)), 'remote-at'); + if (! -e $config{remote}) { # "make" it + print {*STDERR} "### Making remote-at...\n"; + my $startdir = cwd(); + chdir dirname realpath __FILE__; + system {'make'} qw( make remote-at ); + chdir $startdir; + } +} # Where all the data will be kept my $tar = Archive::Tar->new(); @@ -178,8 +191,8 @@ See version at beginning of script, variable $VERSION, or call deployable [--bundle|--all-exec|-X] [--cleanup|-c] [--deploy|--exec|d ] [--heredir|-H ] - [--output|-o ] [--root|-r ] - [--rootdir|-R ] [--tarfile|-T ] + [--include-archive-tar|-T] [--output|-o ] + [--root|-r ] [--rootdir|-R ] [--workdir|-w ] [ files or directories... ] @@ -187,10 +200,6 @@ See version at beginning of script, variable $VERSION, or call shell$ deployable - # Create script.pl embedding distro.tar.gz. When executed, this - # tar file will be extracted, and script.sh will be executed. - shell$ deployable -o script.pl --exec script.sh -T distro.tar.gz - # Use a directory's contents as elements for the target root shell$ ls -1 /path/to/target/root etc @@ -247,11 +256,6 @@ be re-created under I when extraction is performed. =item * -give the name of an already available gzipped C archive, using the -C<--tarfile|-T> option. This lets you have the maximum flexibility. - -=item * - give the name of a directory to be used as a "here directory", using the C<--heredir|-H> option. This is much the same as giving the directory name (see above), but in this case C will be told to change into the @@ -409,6 +413,13 @@ multiple program names, they will be executed in the same order. Set the name of a "here directory" (see L). You can use this option multiple times to provide multiple directories. +=item B<< --include-archive-tar | -T >> + +Embed L (with its dependencies L and +L) inside the final script. Use this when you know (or +aren't sure) that L will not be available in the target +machine. + =item B<< --output | -o >> Set the output file name. By default the I will be given @@ -435,11 +446,6 @@ C. During deployment, hop into C and extract the tarball. This is useful if you have a directory (or a group of directories) that you want to deploy directly under the root. -=item B<< --tarfile | -T > - -Set the name of a B file, see L. You can use this option -multiple times to provide multiple B archives. - =item B<< --workdir | --deploy-directory | -w >> Set the working directory for the deploy. -- 2.11.4.GIT