/[scripts]/trunk/update_extension_ver.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/update_extension_ver.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (hide annotations)
Fri Oct 22 19:54:13 2004 UTC (19 years, 5 months ago) by dpavlin
Original Path: trunk/update_ver.sh
File MIME type: application/x-sh
File size: 1120 byte(s)
update version of Firefox maxVersion in extension (by default to 1.0 so you
can use old extensions with Firefox 1.0)

1 dpavlin 5 #!/bin/sh
2    
3     jar="$1" ; shift
4    
5     if [ ! -e "$jar" ] ; then
6     echo "usage: $0 extension.jar [version]"
7     echo " default version is 1.0"
8     exit 1
9     fi
10    
11     # default version
12     if [ -z "$version" ] ; then
13     version=1.0
14     fi
15    
16     basename=`basename $jar`
17     name=`echo $basename | cut -d. -f1`
18    
19     echo "converting $basename"
20    
21     # default tmp dir (add $$ here?)
22     tmp="/tmp/xpi"
23     mkdir $tmp
24    
25     dir="$tmp/$name"
26    
27     test -e "$tmp/$name" && rm -Rf "$tmp/$name"
28    
29     unzip $jar -d $dir
30     echo "unpacked to $dir"
31    
32     #chrome=`grep urn:mozilla:extension:file: $dir/install.rdf | sed -e 's/^.*urn:mozilla:extension:file://' -e 's/".*$//'`
33    
34     #unzip "$dir/chrome/$chrome" -d "$dir/$chrome"
35     #echo "unpacked chrome to $dir/$chrome"
36    
37     cat $dir/install.rdf | sed \
38     -e 's#</em:version>#+ver1fix</em:version>#' \
39     -e 's#<em:maxVersion>[^<]*</em:maxVersion>#<em:maxVersion>'$version'</em:maxVersion>#' \
40     > $dir/install.rdf.new && \
41     mv $dir/install.rdf.new $dir/install.rdf && \
42     echo "updated version to $version in $dir/install.rdf"
43    
44     cd $dir && zip -9 -r $jar * && cd - && \
45     echo "created new jar $dir/$jar"
46    
47     mv "$dir/$jar" $jar && echo "replaced jar with new version"
48     rm -Rf "$dir"

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26