Added installer/uninstaller scripts

git-svn-id: file:///home/anna/Desktop/ocarina-legacy/mithos/ocarina@62 1daee41c-8060-4895-b1f0-2197c00d777a
This commit is contained in:
bjschuma 2009-09-07 15:59:58 +00:00
parent 072f5e38a9
commit 5fee94c7f9
3 changed files with 83 additions and 7 deletions

40
trunk/install.sh Executable file
View File

@ -0,0 +1,40 @@
# This script is called to install ocarina to INSTALLDIR
# Default install location is /opt/ocarina
INSTALLDIR=/opt/ocarina/
LAUNCHER=$INSTALLDIR/ocarina
RSYNC="rsync -aqz --progress"
# We need root access to install to /opt/
if [ "$(id -u)" != "0" ]; then
echo "Attempting to run script as root"
sudo sh $0
exit 1
fi
# if $INSTALLDIR doesn't exist, create it
if [ ! -d $INSTALLDIR ];then
echo "Creating directory $INSTALLDIR"
mkdir $INSTALLDIR
fi
# Rsync over all files
echo "Copying program to $INSTALLDIR"
$RSYNC src/ $INSTALLDIR/src/
echo "Copying examples to $INSTALLDIR"
$RSYNC images/ $INSTALLDIR/images/
$RSYNC uninstall.sh $INSTALLDIR/
# Create launcher
echo "#/bin/bash" > $LAUNCHER
echo "cd $INSTALLDIR && \`which python\` src/ocarina.py $*" >> $LAUNCHER
chmod +x $LAUNCHER
echo ""
echo ""
echo "Ocarina has been installed to $INSTALLDIR"
echo "To uninstall, remove $INSTALLDIR"
echo "Don't forget to add $INSTALLDIR to your path"

View File

@ -183,10 +183,13 @@ class List(gtk.ScrolledWindow):
for line in split:
line = line.strip()
if len(line) > 0:
self.search+=[line]
self.search+=[line.split()]
# Returns true if the row is visible
# False otherwise
def hideRows(self,list,iter,string):
#return True
if list:
file = self.data.library.files[list[iter][0]]
else:
@ -195,13 +198,29 @@ class List(gtk.ScrolledWindow):
# return True
if len(self.search) == 0:
return True
for term in self.search:
if re.search(term,file.titlel):
return True
elif re.search(term,file.artistl):
return True
elif re.search(term,file.albuml):
#print self.search
for terms in self.search:
foundAll = True
for substr in terms:
foundSS = False
if re.search(substr,file.titlel):
foundSS = True
elif re.search(substr,file.artistl):
foundSS = True
elif re.search(substr,file.albuml):
foundSS = True
if foundSS == False:
foundAll = False
if foundAll == True:
return True
#if re.search(term,file.titlel):
# return True
#elif re.search(term,file.artistl):
# return True
#elif re.search(term,file.albuml):
# return True
return False

17
trunk/uninstall.sh Normal file
View File

@ -0,0 +1,17 @@
# Short script to uninstall Ocarina
INSTALLDIR=/opt/ocarina
if [ "$(id -u)" != "0" ]; then
#echo "This script must be run as root"
echo "Attempting to run script as root"
sudo sh $0
exit 1
fi
if [ -d $INSTALLDIR ]; then
echo "Removing $INSTALLDIR"
rm -rf $INSTALLDIR
else
echo "$INSTALLDIR does not seem to exist..."
fi