update Sat Sep 12 12:37:01 PDT 2009
[pkgsrc.git] / wip / emboss-base / files / digestchange
1 #! /bin/sh
2 # David Price
3 # 06-29-2004
4 # this script reads the working directory, and changes documentation files which
5 # reference digest to refer to edigest it is passed the location of the working directory
6 # as an argument.  this allows the program digest to be placed into the pkg/bin directory
7 # without overwriting the pkgtool program digest
8
9 pdirs() {
10 #function to switch directories based on a passed variable
11
12   DIR=$1
13   ABSDIR=$2
14
15   case $DIR in
16
17
18         html) cd ${ABSDIR}/${DIR}
19               phtml html
20               cd ${ABSDIR}
21         ;;
22         text) cd ${ABSDIR}/text
23               ptext txt
24               cd ${ABSDIR}
25         ;;
26
27         *)      echo "ERROR: bad directory given to digestchange script, directory was: $DIR"
28                 exit 1
29         ;;
30   esac
31
32
33 }
34
35 phtml() {
36
37
38     for HFILE in *html ; do
39
40         sed -e 's|digest\.html|edigest\.html|g' \
41             -e 's/>digest/>edigest/g' \
42             -e 's/^digest/edigest/g' \
43             -e 's|EMBOSS: digest|EMBOSS: edigest|g' \
44             -e 's|session with digest|session with edigest|g' \
45             -e 's|opsd_human.digest|opsd_human.edigest|g' \
46             -e 's|Program: digest|Program: edigest|g' \
47             -e 's|% digest|% edigest|g' \
48             -e 's|digest[ ]\{10,13\}Protein|edigest             Protein|g' \
49             ${HFILE} > ${HFILE}.new ;
50
51         mv ${HFILE}.new ${HFILE}
52         echo "digestchange modified ${HFILE}"
53
54     done
55
56   
57
58     for HMFILE in Makefile* ; do 
59
60         sed -e 's| digest\.html| edigest\.html|g' ${HMFILE} > ${HMFILE}.new ;
61
62         mv ${HMFILE}.new ${HMFILE}
63         echo "digestchange modified ${HMFILE}"
64
65
66     done
67
68 }
69
70 ptext() {
71     
72     
73     for TFILE in *txt ; do
74
75
76
77         sed -e 's|session with digest|session with edigest|g' \
78             -e 's|opsd_human.digest|opsd_human.edigest|g' \
79             -e 's/rogram. digest/rogram edigest/g' \
80             -e 's|% digest|% edigest|g' \
81             -e 's/ \{30,40\}digest/                             edigest/g' \
82             -e 's/digest \{6,13\}Protein/edigest                Protein/g' \
83             -e 's/digest(       )\{1,3\}Protein/edigest         Protein/g' \
84             -e 's| digest finds| edigest finds|g' \
85             ${TFILE} > ${TFILE}.new ;
86             
87         mv ${TFILE}.new ${TFILE}
88
89         echo "digestchange modified ${TFILE}"
90
91     done
92
93
94     for TMFILE in Makefile* ; do 
95
96         sed -e 's| digest\.txt| edigest\.txt|g' ${TMFILE} > ${TMFILE}.new ;
97
98         mv ${TMFILE}.new ${TMFILE}
99
100         echo "digestchange modified ${TMFILE}"
101
102     done
103
104
105 }
106
107 # Main body of the script
108
109 WRKINGDIR=$1
110
111 BASEDIR=${WRKINGDIR}/doc/programs
112
113 pdirs html $BASEDIR
114 pdirs text $BASEDIR
115
116 cd $WRKINGDIR
117
118
119
120 #emboss/Makefile.in
121 #emboss/Makefile.am
122 #emboss/acd/Makefile.am
123 #emboss/acd/Makefile.in
124 #emboss/acd/digest.acd
125 #emboss/acd/Makefile
126 #emboss/digest.c