summaryrefslogtreecommitdiffstats
path: root/lib/MDV/Distribconf/Build.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/MDV/Distribconf/Build.pm')
-rw-r--r--lib/MDV/Distribconf/Build.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/MDV/Distribconf/Build.pm b/lib/MDV/Distribconf/Build.pm
index 756ddb8..7983ca3 100644
--- a/lib/MDV/Distribconf/Build.pm
+++ b/lib/MDV/Distribconf/Build.pm
@@ -308,6 +308,30 @@ sub write_version {
return 1;
}
+=item $distrib->write_productid($productid)
+
+Write the productid file. Returns 0 on error, 1 on success.
+
+=cut
+
+sub write_productid {
+ my ($distrib, $productid) = @_;
+ my $h_productid;
+ if (ref($productid) eq 'GLOB') {
+ $h_productid = $productid;
+ } else {
+ $productid ||= $distrib->getfullpath(undef, 'product.id');
+ open($h_productid, ">", $productid) or return 0;
+ }
+
+ print $h_productid $distrib->getvalue(undef, 'productid') . "\n";
+
+ if (ref($productid) ne 'GLOB') {
+ close($h_productid);
+ }
+
+ return 1;
+}
1;