annotate TOOLS/binary_codecs.sh @ 30391:2a33c1c37e6b

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