From aa8bfed1286f6bae6ba01cfdd9ee2750eada8a684744c612afb18d467d231f4a Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 3 Feb 2015 13:39:06 +0000 Subject: [PATCH] Accepting request 283857 from home:olh:branches:openSUSE:Tools - 2015.02.03 - Trim .TH also in perl man pages (bnc#915941) - Trim first line of man page to catch overly verbose tools OBS-URL: https://build.opensuse.org/request/show/283857 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Tools/build-compare?expand=0&rev=162 --- build-compare.changes | 7 +++++ build-compare.spec | 2 +- rpm-check.sh | 73 ++++++++++++++++++++++++++++--------------- 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/build-compare.changes b/build-compare.changes index fc68f3c..3ed89eb 100644 --- a/build-compare.changes +++ b/build-compare.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Feb 3 11:34:39 UTC 2015 - olaf@aepfle.de + +- 2015.02.03 +- Trim .TH also in perl man pages (bnc#915941) +- Trim first line of man page to catch overly verbose tools + ------------------------------------------------------------------- Mon Feb 2 10:05:40 UTC 2015 - olaf@aepfle.de diff --git a/build-compare.spec b/build-compare.spec index c1ddd38..ebdb15a 100644 --- a/build-compare.spec +++ b/build-compare.spec @@ -20,7 +20,7 @@ Name: build-compare Summary: Build Result Compare Script License: GPL-2.0+ Group: Development/Tools/Building -Version: 2015.01.21 +Version: 2015.02.03 Release: 0 Source1: COPYING Source2: same-build-result.sh diff --git a/rpm-check.sh b/rpm-check.sh index df58c01..4e6d7d7 100644 --- a/rpm-check.sh +++ b/rpm-check.sh @@ -146,6 +146,47 @@ diff_two_files() return 0 } +trim_man_first_line() +{ + # Handles the first line if it is like: + #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28) + #.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3. + local f=$1 + sed -i -e '1{ + s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man| + s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man| + }' $f +} + +trim_man_TH() +{ + # Handles lines like: + # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper" + # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard" + # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3" + # .TH QEMU-IMG 1 "2010-03-14" " " " " + # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1" + # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual" + # .TH gv 3guile "13 May 2010" + #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual" + # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation" + # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7" + # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- + # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands" + # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" "" + #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools" + local f=$1 + # (.TH quoted section) (quoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f + # (.TH unquoted section) (quoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f + # (.TH quoted section) (unquoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f + # (.TH unquoted section) (unquoted_date)(*) + sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f +} strip_numbered_anchors() { @@ -421,37 +462,17 @@ check_single_file() /usr/share/man/man3/*3pm) for f in old/$file new/$file; do sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f + trim_man_TH $f + trim_man_first_line $f done ;; /usr/share/man/man*/*|/usr/lib/texmf/doc/man/*/*) - # Handles lines like: - # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper" - # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard" - # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3" - # .TH QEMU-IMG 1 "2010-03-14" " " " " - # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1" - # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- - # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- - # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual" - # .TH gv 3guile "13 May 2010" - #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual" - # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation" - # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7" - # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*- - # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands" - # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" "" for f in old/$file new/$file; do - # (.TH quoted section) (quoted_date)(*) - sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f - # (.TH unquoted section) (quoted_date)(*) - sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f - # (.TH quoted section) (unquoted_date)(*) - sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f - # (.TH unquoted section) (unquoted_date)(*) - sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f - # generated by docbook xml: - #.\" Date: 09/13/2010 + trim_man_TH $f + trim_man_first_line $f + # generated by docbook xml: + #.\" Date: 09/13/2010 sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f done ;;