From f4845450b04de18b9a5080d960c2f02657d3481f Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Sat, 22 Jul 2000 19:45:07 +0000 Subject: Add the -o option to only process docdir and mandir --- macroszification | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'macroszification') diff --git a/macroszification b/macroszification index 99909be..5ca1cf5 100644 --- a/macroszification +++ b/macroszification @@ -1,16 +1,17 @@ #!/bin/bash # -*- Mode: shell-script -*- -# Copyright (C) 2000 by Chmouel Boudjnah +# Copyright (C) 2000 by Chmouel Boudjnah , +# MandrakeSoft # Redistribution of this file is permitted under the terms of the GNU # Public License (GPL) ## description: # Macroszification of files to be mandrake compliant, also do some check. - function usage () { rval=$1 echo "Usage: $(basename $0) -d --help --nodiff --nocheck --clean SPEC-FILE" echo -e "\t-d: Product only a diff don't change nothing" + echo -e '\t-o: Only change the mandir/infodir' echo -e "\t--nocheck: Don't try do check about Prefix %configure" echo -e "\t--clean: remove the old files after" echo -e "\t--nodiff: I don't want to see the diff output" @@ -23,6 +24,10 @@ while [[ $1 == -* ]];do only_diff=1; shift; ;; + -o) + only_fhs=1; + shift; + ;; --nocheck) nocheck=1; shift; @@ -61,6 +66,8 @@ egrep -q "^%configure" $file && { } mv -f $file $file.old + +if [[ -z $only_fhs ]];then cat $file.old | perl -e " while (<>) { s@[/]?(usr|%{[_]?prefix})/bin@%{_bindir}@g; @@ -76,6 +83,15 @@ while (<>) { print; } " > $file +else +cat $file.old | perl -e " +while (<>) { + s@[/]?(usr|%{[_]?prefix})/man@%{_mandir}@g; + s@[/]?(usr|%{[_]?prefix})/info@%{_infodir}@g; + print; +} +" > $file +fi if [[ -z $nodiff ]];then diff -u $file.old $file -- cgit v1.2.1