/[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 13 - (hide annotations)
Sun Sep 25 16:40:12 2005 UTC (18 years, 6 months ago) by dpavlin
File MIME type: application/x-sh
File size: 1199 byte(s)
fixed version handling

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

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26