#! /bin/sh

#
#  Skript zum Aktualisieren der fnchange.lst
#
#  fnchange.lst:      ist alte Liste
#  fnchange.neu.lst:  ist neu Liste
#  Liste is aktuell und braucht keine Anpassung bis 4.0.8.
#


# /html/man-Verzeichnis.
PRODUCT_VER="@PRODUCT_VER@"
sed "/tiff-${PRODUCT_VER}\/html\/man\// !d;s,/,\\\\/,g" ./fnchange.lst > ./html_man.tmp
cat > script.sed << EOF
s/html   .*$/html/
s|^.*\\\\/html\\\\/man\\\\/|\\\\/html\\\\/man\\\\/|
s|^|/|
s|$|/d|
EOF
sed -f ./script.sed ./html_man.tmp > ./html_man.sed
sed "/tiff-${PRODUCT_VER}\/html\/man\// d" ./fnchange.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.lst

PRODUCT_VER="4.0.1"
sed "/tiff-${PRODUCT_VER}\/html\/man\// !d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
sed -f ./html_man.sed ./fnchange.neu.1.txt > ./fnchange.neu.2.txt

cat > script.sed << EOF
/html$/!d
s/^.* tiff-/tiff-/
s/tiff-${PRODUCT_VER}/tiff-@PRODUCT_VER@/g
s/^.*$/&   &/
s/.1.html$/_1.html/
s/.3tiff.html$/_3tiff.html/
EOF
sed -f ./script.sed ./fnchange.neu.2.txt > ./fnchange.neu.html_man.txt
sed "/.1.html/!d" ./fnchange.neu.html_man.txt > ./fnchange.neu.html_man_1.txt
sed "/.3tiff.html/!d" ./fnchange.neu.html_man.txt > ./fnchange.neu.html_man_3tiff.txt
sed "/tiff-${PRODUCT_VER}\/html\/man\// d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.neu.lst
rm ./script.sed ./html_man.* ./fnchange.neu.2.txt ./fnchange.neu.html_man.txt



# /man-Verzeichnis.
PRODUCT_VER="@PRODUCT_VER@"
sed "/tiff-${PRODUCT_VER}\/man\// !d;s,/,\\\\/,g" ./fnchange.lst > ./man.tmp
cat > script.sed << EOF
s/tiff   .*$/tiff/
s|^.*\\\\/man\\\\/|\\\\/man\\\\/|
s|^|/|
s|$|/d|
EOF
sed -f ./script.sed ./man.tmp > ./man.sed
sed "/tiff-${PRODUCT_VER}\/man\// d" ./fnchange.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.lst

PRODUCT_VER="4.0.3"
sed "/tiff-${PRODUCT_VER}\/man\// !d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
sed -f ./man.sed ./fnchange.neu.1.txt > ./fnchange.neu.2.txt

cat > script.sed << EOF
/tiff$/!d
s/^.* tiff-/tiff-/
s/tiff-${PRODUCT_VER}/tiff-@PRODUCT_VER@/g
s/^.*$/&   &/
EOF
sed -f ./script.sed ./fnchange.neu.2.txt > ./fnchange.neu.man.txt
sed "/tiff-${PRODUCT_VER}\/man\// d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.neu.lst
rm ./script.sed ./man.* ./fnchange.neu.2.txt



# /html-Verzeichnis.
PRODUCT_VER="@PRODUCT_VER@"
sed "/tiff-${PRODUCT_VER}\/html\// !d;s,/,\\\\/,g" ./fnchange.lst > ./html.tmp
cat > script.sed << EOF
s/html   .*$/html/
s|^.*\\\\/html\\\\/|\\\\/html\\\\/|
s|^|/|
s|$|/d|
EOF
sed -f ./script.sed ./html.tmp > ./html.sed
sed "/tiff-${PRODUCT_VER}\/html\// d" ./fnchange.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.lst

PRODUCT_VER="4.0.3"
sed "/tiff-${PRODUCT_VER}\/html\// !d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
sed -f ./html.sed ./fnchange.neu.1.txt > ./fnchange.neu.2.txt

cat > script.sed << EOF
/html$/!d
s/^.* tiff-/tiff-/
s/tiff-${PRODUCT_VER}/tiff-@PRODUCT_VER@/g
s/^.*$/&   &/
EOF
sed -f ./script.sed ./fnchange.neu.2.txt > ./fnchange.neu.html.txt
sed "/tiff-${PRODUCT_VER}\/html\// d" ./fnchange.neu.lst > ./fnchange.neu.1.txt
mv ./fnchange.neu.1.txt ./fnchange.neu.lst
rm ./script.sed ./html.* ./fnchange.neu.2.txt
