annotate TOOLS/binary_codecs.sh @ 35410:1c991ec0e6da

Change declaration to use proper type to avoid a ridiculous number of casts.
author reimar
date Wed, 28 Nov 2012 19:43:03 +0000
parents 6d06be50007f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
1 #!/bin/sh
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
2 set -e
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
3
29181
641ccdaad342 Part 2 of syncing binary_codecs.sh with Debian
siretart
parents: 29179
diff changeset
4 # avoid insecure tempfile creation
641ccdaad342 Part 2 of syncing binary_codecs.sh with Debian
siretart
parents: 29179
diff changeset
5 umask 0022
641ccdaad342 Part 2 of syncing binary_codecs.sh with Debian
siretart
parents: 29179
diff changeset
6
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
7 # This script will download binary codecs for MPlayer unto a Debian system.
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
8
29184
5f1e8f1b3c30 whitespace cosmetics
diego
parents: 29182
diff changeset
9 # Author: thuglife, mennucc1
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
10 #
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
11
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
12 CODECDIR=/usr/lib/codecs
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
13 PREFDIR=/var/lib/mplayer/prefs
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
14 MYSITE='http://people.debian.org/~mennucc1/mplayer'
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
15
32398
68722c75c922 use 'dpkg --print-architecture'
siretart
parents: 29187
diff changeset
16 dpkgarch=$(dpkg --print-architecture)
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
17
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
18 [ -d $PREFDIR ] || mkdir -v $PREFDIR
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
19 [ -d $CODECDIR ] || mkdir -v $CODECDIR
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
20 cd $CODECDIR
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
21 [ -d mplayer_binary_codecs ] || mkdir -v mplayer_binary_codecs
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
22
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
23 choosemirror ()
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
24 {
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
25 cd $PREFDIR
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
26
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
27 #if [ ! -r mirrors ] || find mirrors -mtime +20 ; then
29185
a99dc500088f more cosmetics
siretart
parents: 29184
diff changeset
28 echo "Downloading mirrors list"
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
29 wget -nv -c -N $MYSITE/mirrors || true
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
30 #fi
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
31 if [ ! -r bestsites ] || [ mirrors -nt bestsites ] || \
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
32 find bestsites -mtime +20 | grep -q bestsites ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
33 if which netselect > /dev/null ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
34 echo Choosing best mirrors using netselect
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
35 netselect -s 5 -t 5 $( cat mirrors ) | awk '{print $2}' > bestsites
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
36 elif which fping > /dev/null ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
37 fping -C 1 $( sed 's#.*//##;s#/.*##' mirrors ) 2>&1 | \
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
38 egrep -v 'bytes.*loss' | sort -n -k3 | \
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
39 grep -v ': *-' | awk '/:/{print $1}' | head -5 | ( while read mainsite ; do
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
40 grep $mainsite $PREFDIR/mirrors ; done ) > bestsites
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
41 else
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
42 echo "(If you install 'netselect' or 'fping', it will select the best mirror for you"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
43 echo " you may wish to stop this script and rerun after installation)"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
44 sleep 3
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
45 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
46 fi
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
47 }
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
48
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
49 INSTALL () {
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
50 filename="$3"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
51 dir="$2"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
52 url="$1"
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
53
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
54 cd $CODECDIR/mplayer_binary_codecs
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
55
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
56 if [ -r $filename ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
57 cp $filename $filename.bak
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
58 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
59
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
60 if [ "$url" = @MAINSITE@ ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
61 list=$PREFDIR/bestsites
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
62 test -r $list || list=$PREFDIR/mirrors
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
63 cat $list | while read mainsite ; do
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
64 echo Downloading $filename from $mainsite ...
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
65 wget -c -N $mainsite/$dir/$filename || true
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
66 if [ -r "$filename" ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
67 UNPACK "$filename"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
68 return 0
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
69 fi
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
70 done
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
71 else
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
72 wget -c -N $url/$dir/$filename || true
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
73 if [ -r "$filename" ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
74 UNPACK "$filename"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
75 return 0
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
76 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
77 fi
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
78 }
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
79
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
80
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
81 UNPACK ()
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
82 {
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
83 filename="$1"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
84 if [ -r $filename.bak ] && cmp $filename.bak $filename && [ -r $filename.list ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
85 echo It appears that $filename was already succesfully installed
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
86 [ -r $filename.bak ] && rm $filename.bak
29187
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
87 else
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
88 if grep -q " $filename$" $PREFDIR/MD5SUMS ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
89 echo Checking MD5 for $filename
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
90 grep " $filename$" $PREFDIR/MD5SUMS | md5sum -c -
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
91 else
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
92 echo Warning: no MD5 for $filename were found. Hit enter to continue.
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
93 read dummy
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
94 fi
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
95 echo Installing $filename ...
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
96 if [ -r $filename.list ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
97 tr '\n' '\000' < $filename.list | xargs -r0 rm || true
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
98 UNLINK $filename.list
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
99 rm $filename.list
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
100 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
101
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
102 tarfail () { echo FAILED $filename ; rm $filename.list ; exit 1 ; }
29181
641ccdaad342 Part 2 of syncing binary_codecs.sh with Debian
siretart
parents: 29179
diff changeset
103
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
104 case "$filename" in
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
105 *.tar.gz)
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
106 tar xvzf $filename > $filename.list || tarfail
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
107 #rm $filename
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
108 ;;
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
109 *.tgz)
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
110 tar xvzf $filename > $filename.list || tarfail
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
111 #rm $filename
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
112 ;;
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
113 *.tar.bz2)
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
114 tar --bzip2 -xvf $filename > $filename.list || tarfail
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
115 #rm $filename
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
116 ;;
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
117 esac
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
118 [ -r $filename.bak ] && rm $filename.bak
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
119 LINK $filename.list
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
120 echo "Installed $filename Succesfully!"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
121 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
122 }
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
123
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
124 LINK () {
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
125 cd $CODECDIR/
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
126 cat $CODECDIR/mplayer_binary_codecs/$1 | while read f ; do
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
127 ln -sbf mplayer_binary_codecs/"$f" .
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
128 done
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
129 }
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
130
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
131 UNLINK () {
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
132 ### FIXME
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
133 # cd $CODECDIR
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
134 # cat $CODECDIR/mplayer_binary_codecs/$1 | while f do
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
135 # ln -sbf mplayer_binary_codecs/"$f"
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
136 # done
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
137 if which symlinks > /dev/null ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
138 symlinks -d $CODECDIR
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
139 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
140 }
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
141
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
142 if [ `whoami` != root ]; then
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
143 echo "You must be 'root' to use this script. Login as root first!"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
144 exit 1
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
145 fi
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
146
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
147 case "$1" in
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
148 install)
29184
5f1e8f1b3c30 whitespace cosmetics
diego
parents: 29182
diff changeset
149 if test -x /bin/bzip2 || test -x /usr/bin/bzip2 ; then : ; else
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
150 echo You need to install bzip2
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
151 exit 1
29181
641ccdaad342 Part 2 of syncing binary_codecs.sh with Debian
siretart
parents: 29179
diff changeset
152 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
153 choosemirror
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
154 cd $PREFDIR
29182
ecb3c5f2fdd1 Part 3 of syncing binary_codecs.sh with Debian
siretart
parents: 29181
diff changeset
155 #if [ ! -r codecs_list ] || find codecs_list -mtime +20 ; then
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
156 echo "Getting codecs list"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
157 wget -nv -c -N $MYSITE/codecs_list || true
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
158 #fi
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
159
29187
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
160 cd $PREFDIR
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
161 echo Downloading MD5 sums from main site
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
162 [ -r MD5SUMS ] && mv MD5SUMS MD5SUMS.bak
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
163 if wget -nv -N http://www.mplayerhq.hu/MPlayer/releases/codecs/MD5SUMS ; then
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
164 [ -r MD5SUMS.bak ] && rm MD5SUMS.bak
29187
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
165 else
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
166 echo "failed"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
167 if [ -r MD5SUMS.bak ] ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
168 echo "trying to use backup"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
169 mv MD5SUMS.bak MD5SUMS
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
170 fi
29187
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
171 fi
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
172
e227d7137dc0 commit remaining binary_codecs.sh changes from debian.
siretart
parents: 29186
diff changeset
173 if grep -q "^$dpkgarch" $PREFDIR/codecs_list ; then
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
174 egrep -v "^[[:space:]]*(#|$)" $PREFDIR/codecs_list | \
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
175 while read arch url dir file info ; do
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
176 if [ "$dpkgarch" = "$arch" ]; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
177 echo Downloading and installing $file $info...
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
178 INSTALL "$url" "$dir" "$file"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
179 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
180 done
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
181 needlibstd=no
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
182 test "$dpkgarch" = "powerpc" && needlibstd=yes
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
183 test "$dpkgarch" = "i386" && needlibstd=yes
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
184 if test "$needlibstd" = "yes" && ! test -r /usr/lib/libstdc++.so.5 ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
185 echo "Warning: you need to install libstdc++ 5 libraries"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
186 echo -n "Do it now? "
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
187 read R
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
188 case $R in
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
189 y*) apt-get install libstdc++5 ;;
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
190 *) echo "If you change your mind, use the command"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
191 echo " apt-get install libstdc++5" ;;
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
192 esac
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
193 fi
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
194 else
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
195 echo "Sorry, no codecs for your arch '$dpkgarch'. Sorry dude :("
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
196 exit 1
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
197 fi
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
198 ;;
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
199
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
200 uninstall)
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
201 cd $CODECDIR/
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
202 rm -rf mplayer_binary_codecs
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
203 #FIXME we need a better clean system
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
204 if which symlinks > /dev/null ; then
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
205 symlinks -d .
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
206 else
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
207 echo "please install the package 'symlinks' and run 'symlinks -d $CODECDIR' "
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
208 fi
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
209 echo "Uninstalled Succesfully!"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
210 ;;
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
211
32474
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
212 *)
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
213 echo "Usage: {install|uninstall}"
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
214 echo "This program will install binary codecs for MPlayer."
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
215 exit 1
6d06be50007f make indentation consistent (no content changes)
siretart
parents: 32399
diff changeset
216 ;;
27351
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
217 esac
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
218
4f0fa46528ff Revert previous broken rename of binary-codecs.sh that had random changes.
diego
parents:
diff changeset
219 exit 0