Re: [PATCH] Re: Problem while viewing rotated log files



Hi,

On Fri, 2005-07-01 at 01:06, Leonard den Ottolander wrote:
> Checking a Makefile.in this indeed seems to be the case :) .
> 
> More specific cases of course should come first.

Some improvements:
- Don't match capital letters in the man regexs. There are no such man
pages on my system (Linux). Please correct me if they are on other
systems.
- Also match multiple letters for plain and bzipped man pages (not only
gzipped).
- Also match local man pages (.l).

Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research

--- mc.ext.in.orig	2005-06-07 22:43:15.000000000 +0200
+++ mc.ext.in	2005-07-01 01:05:16.000000000 +0200
@@ -184,27 +184,6 @@ regex/(^|\.)ls-?lR(\.g?z|Z|bz2)?$
 # patch
 regex/\.(diff|patch)(\.(bz2|gz|Z))?$
         Open=%cd %p#patchfs
-
-# gzip
-type/^gzip
-	Open=gzip -dc %f | %var{PAGER:more}
-	View=%view{ascii} gzip -dc %f 2>/dev/null
-
-# bzip2
-type/^bzip2
-	Open=bzip2 -dc %f | %var{PAGER:more}
-	View=%view{ascii} bzip2 -dc %f 2>/dev/null
-
-# bzip
-type/^bzip
-	Open=bzip -dc %f | %var{PAGER:more}
-	View=%view{ascii} bzip -dc %f 2>/dev/null
-
-# compress
-type/^compress
-	Open=gzip -dc %f | %var{PAGER:more}
-	View=%view{ascii} gzip -dc %f 2>/dev/null
-
 # ar library
 regex/\.s?a$
 	Open=%cd %p#uar
@@ -280,8 +259,8 @@ regex/\.(so|so\.[0-9\.]*)$
 	View=%view{ascii} file %f && nm %f
 
-regex/(([^0-9]|^[^\.]*)\.([1-9][A-Za-z]*|n)|\.man)$
-	Open=nroff @MAN_FLAGS@ @MANDOC@ %f | %var{PAGER:more}
-	View=%view{ascii,nroff} nroff @MAN_FLAGS@ @MANDOC@ %f
+regex/(([^0-9]|^[^\.]*)\.([1-9][a-z]*|[ln])|\.man)$
+	Open=case %d in @localstatedir@/log*) cat %f ;; *) nroff @MAN_FLAGS@ @MANDOC@ %f ;; esac | %var{PAGER:more}
+	View=%view{ascii,nroff} case %d in @localstatedir@/log*) cat %f ;; *) nroff @MAN_FLAGS@ @MANDOC@ %f ;; esac
 
 # Troff with me macros.
 # Exception - "read.me" is not a nroff file.
@@ -300,16 +279,16 @@ shell/.ms
 
 # Manual page - compressed
-regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.g?[Zz]$
-	Open=gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more}
-	View=%view{ascii,nroff} case %d in /var/log*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
+regex/([^0-9]|^[^\.]*)\.([1-9][a-z]*|[ln])\.g?[Zz]$
+	Open=case %d in @localstatedir@/log*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
+	View=%view{ascii,nroff} case %d in @localstatedir@/log*) gzip -dc %f ;; *) gzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
 
-regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz$
-	Open=bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more}
-	View=%view{ascii,nroff} bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@
+regex/([^0-9]|^[^\.]*)\.([1-9][a-z]*|[ln])\.bz$
+	Open=case %d in @localstatedir@/log*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
+	View=%view{ascii,nroff} case %d in @localstatedir@/log*) bzip -dc %f ;; *) bzip -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
 
-regex/([^0-9]|^[^\.]*)\.([1-9][a-z]?|n)\.bz2$
-	Open=bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ | %var{PAGER:more}
-	View=%view{ascii,nroff} bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@
+regex/([^0-9]|^[^\.]*)\.([1-9][a-z]*|[ln])\.bz2$
+	Open=case %d in @localstatedir@/log*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac | %var{PAGER:more}
+	View=%view{ascii,nroff} case %d in @localstatedir@/log*) bzip2 -dc %f ;; *) bzip2 -dc %f | nroff @MAN_FLAGS@ @MANDOC@ ;; esac
 
 
 ### Images ###
@@ -521,6 +500,27 @@ regex/\.([dD][bB][fF])$
 regex/\.(rexx?|cmd)$
        Open=rexx %f %{Enter parameters};echo "Press ENTER";read y
 
+# gzip
+type/^gzip
+	Open=gzip -dc %f | %var{PAGER:more}
+	View=%view{ascii} gzip -dc %f 2>/dev/null
+
+# bzip2
+type/^bzip2
+	Open=bzip2 -dc %f | %var{PAGER:more}
+	View=%view{ascii} bzip2 -dc %f 2>/dev/null
+
+# bzip
+type/^bzip
+	Open=bzip -dc %f | %var{PAGER:more}
+	View=%view{ascii} bzip -dc %f 2>/dev/null
+
+# compress
+type/^compress
+	Open=gzip -dc %f | %var{PAGER:more}
+	View=%view{ascii} gzip -dc %f 2>/dev/null
+
+
 
 ### Default ###
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]