added usage routine and --skip-assembly option
@@ -5,6 +5,7 @@ use warnings;
use Digest::MD5 qw(md5);
use File::Path;
use File::Copy::Recursive qw(dircopy);
+use Getopt::Long;
#my @arches = ('aarch64', 'x86_64');
#my @distros = ('CentOS_7.2', 'SLE_12_SP1');
@@ -16,9 +17,33 @@ my $base_repo_path = "/srv/obs/repos/OpenHPC:";
my $dest_dir = "/srv/www/dist";
my $tmp_dir = "/srv/tmp/dist/mk_dist.$$";
+# basic usage
+sub usage {
+ print "\n";
+ print "Usage: mk_isos [OPTIONS]\n\n";
+ print "OPTIONS:\n";
+ print " --skip-assembly skip reassembly of repo tarball\n";
+ print " --help generate help message and exit\n";
+ print "\n";
+ exit 0;
+}
+
# enable autoflush
$| = 1;
+# Command-line parsing
+my $skipAssembly = 0;
+my $help = 0;
+
+GetOptions('skip-assembly' => \$skipAssembly,
+ "h" => \$help,
+ "help" => \$help);
+
+usage() if ($help);
+
+
+exit 0;
+
# query expected environment variables
my $release;
my $overwrite=0;
@@ -41,6 +66,8 @@ print "--> Overwrite existing dists = $overwrite\n";
my ($major, $minor, $micro) = split(/\./, $release);
my $base_release = "$major.$minor";
+if( !$skipAssembly) {
+
# stage repo in tmp
print "\nStaging dist creation in $tmp_dir...\n";
die "Unable to create $tmp_dir: $!\n" unless(mkdir $tmp_dir);
@@ -139,10 +166,12 @@ foreach my $distro (@distros) {
close(MD5);
-# TODO: write sed script for repo files
-
unless(rmtree $tmp_dir) {
die "Unable to remove $tmp_dir: $!\n";
}
+# TODO: write sed script for repo files
+
+}
+
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
