]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/tool/lib/L4/ModList.pm
update
[l4.git] / l4 / tool / lib / L4 / ModList.pm
index 8053c66b48acee7cc1e2ffd383f620d8e9f800de..928d32a6537b9bab190c206fc3ed0f87d3c5504e 100644 (file)
@@ -272,6 +272,33 @@ sub search_file_or_die($$)
   $f;
 }
 
+sub get_file_uncompressed_or_die($$$)
+{
+  my $command = shift;
+  my $paths   = shift;
+  my $tmpdir  = shift;
+
+  my $fp = L4::ModList::search_file_or_die($command, $paths);
+
+  open F, $fp || die "connot open '$fp': $!";
+  my $buf;
+  read F, $buf, 2;
+  close F;
+
+  if (unpack("n", $buf) == 0x1f8b) {
+    (my $tf = $fp) =~ s|.*/||;
+    $tf = $tmpdir.'/'.$tf;
+    print "'$fp' is a zipped file, uncompressing to '$tf'\n";
+    system("zcat $fp >$tf");
+    $fp = $tf;
+  }
+
+  $fp;
+}
+
+
+
+
 sub generate_grub1_entry($$%)
 {
   my $entryname = shift;