When I was working on the emacs24 port, I was struggling with
''make update-plist'' not respecting my @info annotations.
Currently there is no PLIST in the ports tree that defines @info gzipped
entries, but I guess this may become desirable in the future.
--
Jérémie Courrèges-Anglas
GPG Fingerprint: 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494
Index: FS.pm
===================================================================
RCS file: /cvs/ports/infrastructure/lib/OpenBSD/FS.pm,v
retrieving revision 1.1
diff -u -p -r1.1 FS.pm
--- FS.pm 20 Aug 2010 15:22:22 -0000 1.1
+++ FS.pm 16 Dec 2012 03:13:34 -0000
@@ -15,6 +15,7 @@
use strict;
use warnings;
+use IO::Uncompress::Gunzip;
package OpenBSD::FS::File;
@@ -150,9 +151,14 @@ sub is_plugin
sub is_info
{
my $filename = shift;
- return 0 unless $filename =~ m/\.info$/ or $filename =~
m/info\/[^\/]+$/;
+ return 0 unless $filename =~ m/\.info(?:\.gz)$/ or $filename =~
m/info\/[^\/]+$/;
$filename = resolve_link($filename);
- open my $fh, '<', $filename or return 0;
+ my $fh;
+ if ($filename =~ m/\.gz$/) {
+ $fh = IO::Uncompress::Gunzip->new($filename) or return 0;
+ } else {
+ open $fh, '<', $filename or return 0;
+ }
my $tag = <$fh>;
return 0 unless defined $tag;
$tag .= <$fh>;
@@ -205,10 +211,11 @@ sub is_dir
sub is_subinfo
{
my $filename = shift;
- if ($filename =~ m/^(.*\.info)\-\d+$/ or
- $filename =~ m/^(.*info\/[^\/]+)\-\d+$/) {
+ if ($filename =~ m/^(.*\.info)\-\d+(?:\.gz)$/ or
+ $filename =~ m/^(.*info\/[^\/]+)\-\d+(?:\.gz)$/) {
return is_info($1);
}
+ # XXX: should we handle gzipped pages here too?
if ($filename =~ m/^(.*)\.\d+in$/) {
return is_info("$1.info");
}