change option name  to --skipCopy; begin to add logic for including .repo file
@@ -22,7 +22,7 @@ sub usage {
print "\n";
print "Usage: mk_dist [OPTIONS]\n\n";
print "OPTIONS:\n";
- print " --skip-assembly skip reassembly of repo tarball\n";
+ print " --skip-copy skip copying of repo data (for debug only)\n";
print " --help generate help message and exit\n";
print "\n";
exit 0;
@@ -32,10 +32,10 @@ sub usage {
$| = 1;
# Command-line parsing
-my $skipAssembly = 0;
+my $skipCopy = 0;
my $help = 0;
-GetOptions('skip-assembly' => \$skipAssembly,
+GetOptions('skip-copy' => \$skipCopy,
"h" => \$help,
"help" => \$help);
@@ -64,12 +64,12 @@ 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);
+if( !$skipCopy) {
+
# copy base repo contents
print "\nCopying base repo contents from OBS...\n";
unless(dircopy("$base_repo_path/$base_release", $tmp_dir)) {
@@ -86,6 +86,7 @@ if( !$skipAssembly) {
("$base_repo_path/$base_release:/Update$micro/*", "$tmp_dir/updates") ||
die "Unable to copy update repo: $!";
}
+}
# build dist + TODO: md5s
@@ -149,6 +150,20 @@ if( !$skipAssembly) {
}
$tar_args .= "--exclude $tmp_dir/$distro/iso \\\n";
$tar_args .= " $tmp_dir/$distro";
+
+ # add .repo file(s)
+
+ print "Adding [base] repofile contents\n";
+ copy("repo.base.in","$tmp_dir/$distro/OpenHPC.local.repo") || die "Unable to copy repo.base.in\n";
+ if($micro) {
+ print "Adding [update] repofile contents\n";
+ open (BASE, ">>","$tmp_dir/$distro/OpenHPC.local.repo") || die "Unable to append to repo file\n";
+ open (UPDATE,"<","repo.update.in") || die "Unable to access repo.update.in\n";
+ print BASE <UPDATE>;
+ close BASE;
+ close UPDATE;
+ }
+
print "dist for $distro:src -- \n";
system("tar $tar_args");
@@ -168,8 +183,4 @@ if( !$skipAssembly) {
die "Unable to remove $tmp_dir: $!\n";
}
-# TODO: write sed script for repo files
-
-}
-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
