summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/MGA/DrakISO/BuildMedia.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/MGA/DrakISO/BuildMedia.pm b/lib/MGA/DrakISO/BuildMedia.pm
index bede84b..a1ce11b 100644
--- a/lib/MGA/DrakISO/BuildMedia.pm
+++ b/lib/MGA/DrakISO/BuildMedia.pm
@@ -84,6 +84,8 @@ sub prepare_media {
# Nothing in this directory is needed after we exit this function.
mkdir_p($build->get_build_dir('tmp'));
+ read_repo_product_id($build);
+
prepare_urpmi_media($build);
get_available_packages($build);
@@ -560,6 +562,27 @@ sub check_installer_media {
# Miscellaneous File Creation
###############################################################################
+sub read_repo_product_id {
+ my ($build) = @_;
+
+ my $src_file = $build->{settings}{repository} . '/' . $build->{settings}{arch} . '/product.id';
+ my $product_id;
+ if ($src_file =~ m!^(ftp|http)://!) {
+ $product_id = `curl --silent $src_file`;
+ $? and die "ERROR: couldn't fetch product.id file from repository\n";
+ } else {
+ $product_id = cat_($src_file);
+ }
+
+ my %h = map { if_(/(.*?)=(.*)/, $1 => $2) } split(',', $product_id);
+
+ foreach my $setting (qw(type version branch product)) {
+ next if defined $build->{settings}{$setting};
+ $h{$setting} or die "ERROR: $setting field missing from product.id\n";
+ $build->{settings}{$setting} = $h{$setting};
+ }
+}
+
sub create_product_id {
my ($build, $file) = @_;