cc-2666: try separating compononents

-moved python-virtualenv install to separate install file,
 so each component can install virtualenv
This commit is contained in:
martin 2011-08-23 12:31:27 -04:00
parent 078aa1d05d
commit 4fe3baf591
7 changed files with 2 additions and 37 deletions

Binary file not shown.

View file

@ -13,47 +13,12 @@ SCRIPT=`readlink -f $0`
# Absolute directory this script is in
SCRIPTPATH=`dirname $SCRIPT`
VIRTUAL_ENV_DIR="/usr/lib/airtime/airtime_virtualenv"
VIRTUAL_ENV_SHARE="/usr/share/python-virtualenv/"
if [ ! -d "$VIRTUAL_ENV_DIR" ]; then
echo -e "\n*** Creating Virtualenv for Airtime ***"
EXTRAOPTION=$(virtualenv --help | grep extra-search-dir)
if [ "$?" -eq "0" ]; then
sudo virtualenv --extra-search-dir=${SCRIPTPATH}/3rd_party --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv
else
# copy distribute-0.6.10.tar.gz to /usr/share/python-virtualenv/
# this is due to the bug in virtualenv 1.4.9
if [ -d "$VIRTUAL_ENV_SHARE" ]; then
cp ${SCRIPTPATH}/3rd_party/distribute-0.6.10.tar.gz /usr/share/python-virtualenv/
fi
sudo virtualenv --no-site-package -p /usr/bin/python2.6 /usr/lib/airtime/airtime_virtualenv
fi
echo -e "\n*** Installing Python Libraries ***"
sudo /usr/lib/airtime/airtime_virtualenv/bin/pip install ${SCRIPTPATH}/airtime_virtual_env.pybundle -E /usr/lib/airtime/airtime_virtualenv
echo -e "\n*** Patching Python Libraries ***"
PACHES=${SCRIPTPATH}/patches/*
for file in $(find $PACHES -print); do
if [ -d $file ]; then
DIRNAME=$(basename $file)
echo -e "\n ---Applying Patches for $DIRNAME---"
else
sudo patch -N -p0 -i $file
fi
done
else
echo -e "\n*** Existing Airtime Virtualenv Found ***"
fi
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
. ${virtualenv_bin}activate
#Cause bash script to exit if any of the installers
#return with a non-zero return value.
set -e
${SCRIPTPATH}/../python_apps/python-virtualenv/virtualenv-install.sh
echo -e "\n*** Creating Pypo User ***"
python ${SCRIPTPATH}/../python_apps/create-pypo-user.py

View file

@ -1,35 +0,0 @@
Index: /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py
===================================================================
--- /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (revision 108)
+++ /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (working copy)
@@ -151,15 +151,16 @@
self.sample_rate = self.__RATES[self.version][sample_rate]
if self.layer == 1:
- frame_length = (12 * self.bitrate / self.sample_rate + padding) * 4
+ padding *= 4
frame_size = 384
elif self.version >= 2 and self.layer == 3:
- frame_length = 72 * self.bitrate / self.sample_rate + padding
frame_size = 576
else:
- frame_length = 144 * self.bitrate / self.sample_rate + padding
frame_size = 1152
+ frame_length = frame_size / 8 * \
+ self.bitrate / self.sample_rate + padding
+
if check_second:
possible = frame_1 + frame_length
if possible > len(data) + 4:
@@ -172,9 +173,7 @@
if frame_data & 0xFFE0 != 0xFFE0:
raise HeaderNotFoundError("can't sync to second MPEG frame")
- frame_count = real_size / float(frame_length)
- samples = frame_size * frame_count
- self.length = samples / self.sample_rate
+ self.length = 8 * real_size / float(self.bitrate)
# Try to find/parse the Xing header, which trumps the above length
# and bitrate calculation.

View file

@ -1,20 +0,0 @@
Index: /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py
===================================================================
--- /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (revision 108)
+++ /usr/lib/airtime/airtime_virtualenv/lib/python2.6/site-packages/mutagen/mp3.py (working copy)
@@ -209,15 +209,6 @@
bytes = struct.unpack('>I', data[xing + 12:xing + 16])[0]
self.bitrate = int((bytes * 8) // self.length)
- # If the bitrate * the length is nowhere near the file
- # length, recalculate using the bitrate and file length.
- # Don't do this for very small files.
- fileobj.seek(2, 0)
- size = fileobj.tell()
- expected = (self.bitrate / 8) * self.length
- if not (size / 2 < expected < size * 2) and size > 2**16:
- self.length = size / float(self.bitrate * 8)
-
def pprint(self):
s = "MPEG %s layer %d, %d bps, %s Hz, %.2f seconds" % (
self.version, self.layer, self.bitrate, self.sample_rate,