From 1dbb59aab559f250818ea15c834fbd2228849dce Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 9 Jun 2010 16:01:12 -0500
Subject: LinHES-system: Update mythbackup and mythrestore to show OSD status
 during backup and restore. Adds description to the menu item showing the last
 backup and restore. Only displays in themes that show description line in
 menu items. Closes #173

---
 abs/core-testing/LinHES-system/PKGBUILD        |   2 +-
 abs/core-testing/LinHES-system/bin/mythbackup  |  33 +++++++++++++++++++++++++
 abs/core-testing/LinHES-system/bin/mythrestore |  33 +++++++++++++++++++++++++
 abs/mv-core/local-website/contents/header.jpg  | Bin
 4 files changed, 67 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 abs/mv-core/local-website/contents/header.jpg

diff --git a/abs/core-testing/LinHES-system/PKGBUILD b/abs/core-testing/LinHES-system/PKGBUILD
index 017984f..5ac73ea 100644
--- a/abs/core-testing/LinHES-system/PKGBUILD
+++ b/abs/core-testing/LinHES-system/PKGBUILD
@@ -1,6 +1,6 @@
 pkgname=LinHES-system
 pkgver=1.1
-pkgrel=30
+pkgrel=31
 arch=('i686')
 MVDIR=$startdir/pkg/usr/LH
 BINDIR=$startdir/pkg/usr/bin
diff --git a/abs/core-testing/LinHES-system/bin/mythbackup b/abs/core-testing/LinHES-system/bin/mythbackup
index d0d028d..cf4d491 100755
--- a/abs/core-testing/LinHES-system/bin/mythbackup
+++ b/abs/core-testing/LinHES-system/bin/mythbackup
@@ -7,6 +7,21 @@
 }
 #----------------------------------------------------------------------------
 
+# Function to display status onscreen
+osd()
+# Arg_1 = display text Arg_2 = delay time Arg_3 = line num
+{
+    TEXT=$1
+    killall -9 osd_cat
+    if [ $3 -gt 1 ]; then
+        for ((i=2; i <= $3 ; i++))
+        do
+            TEXT="\n"$TEXT
+        done
+    fi
+    printf "$TEXT" | osd_cat --lines=6 --pos=middle --align=center --delay=$2 --color white -O 2 -u black -f -adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-* &
+}
+
 # Prevent mythshutdown from shutting down the system in the middle...
 lock_myth
 
@@ -14,12 +29,15 @@ lock_myth
 play_sound init.wav
 
 # Keep a chain of recent backups,
+export DISPLAY=:0.0
+osd "Rolling over old backups..." 0 1
 echo "Starting rollover of old backups, this may take a while..."
 [ -f "$BACKUP_SQL" ] && shrink $BACKUP_SQL
 [ -f "$BACKUP_TAR" ] && shrink $BACKUP_TAR
 backup_roller .19 .18 .17 .16 .15 .14 .13 .12 .11 .10 .9 .8 .7 .6 .5 .4 .3 .2 .1 ''
 echo "Rollover completed."
 
+osd "Checking the database..." 0 2
 # Start with the database backup, first we make sure it's healthy, and
 # then we can dump it.
 # Doing this while the backend is active would be BAD.
@@ -31,10 +49,12 @@ cd $DATABASE_DIR
 $MYISAMCHK -f *.MYI
 start_mysqld
 
+osd "Backing up database..." 0 3
 # Dumps the $DATABASE database
 $MYSQLDUMP -v -c -u root $DATABASE > $BACKUP_SQL
 shrink $BACKUP_SQL
 
+osd "Backing up files..." 0 4
 # Now to backup the other files, no fooling around, grab everything in the
 # list because you never know what you'll want, and we can always get clever
 # about what to restore later...
@@ -49,19 +69,32 @@ shrink $BACKUP_TAR
 $CHOWN root:root $BACKUP_TAR* $BACKUP_SQL*
 $CHMOD go-rwx $BACKUP_TAR* $BACKUP_SQL*
 
+osd "Testing backup..." 0 5
 echo "Sanity checking your backup..."
 play_sound testing.wav
 # Play a sound to let you know the outcome.
 if check_files_and_tables $BACKUP_LIST ; then
+    osd "Backup completed successfully." 5 6
     echo "Backup passes all checks."
+    COMPLETE_MSG="Last backup completed on `date '+%D @ %-I:%M %p'`"
     play_sound complete.wav
     STATUS=0
 else
+    osd "Backup FAILED." 5 6
     echo "The backup is bad or already out of date!"
+    COMPLETE_MSG="Last backup FAILED on `date '+%D @ %-I:%M %p'`"
     play_sound fail.wav
     STATUS=1
 fi
 
+# Add Last backup status to menu item
+if grep "<description>" /usr/share/mythtv/themes/defaultmenu/mythbackup.xml >/dev/null 2>&1
+then
+    sed -i "s_\<description\>.*\<description\>_description\>$COMPLETE_MSG\<\/description_" /usr/share/mythtv/themes/defaultmenu/mythbackup.xml
+else
+    sed -i.orig " /NONE/ i\     \<description\>$COMPLETE_MSG\<\/description\>" /usr/share/mythtv/themes/defaultmenu/mythbackup.xml
+fi
+
 # Now we can restart the backend.
 start_mythbackend
 
diff --git a/abs/core-testing/LinHES-system/bin/mythrestore b/abs/core-testing/LinHES-system/bin/mythrestore
index 76b76a3..0ab5c86 100755
--- a/abs/core-testing/LinHES-system/bin/mythrestore
+++ b/abs/core-testing/LinHES-system/bin/mythrestore
@@ -7,6 +7,21 @@
 }
 #----------------------------------------------------------------------------
 
+# Function to display status onscreen
+osd()
+# Arg_1 = display text Arg_2 = delay time Arg_3 = line num
+{
+    TEXT=$1
+    killall -9 osd_cat
+    if [ $3 -gt 1 ]; then
+        for ((i=2; i <= $3 ; i++))
+        do
+            TEXT="\n"$TEXT
+        done
+    fi
+    printf "$TEXT" | osd_cat --lines=6 --pos=middle --align=center --delay=$2 --color white -O 2 -u black -f -adobe-helvetica-bold-*-*-*-34-*-*-*-*-*-*-* &
+}
+
 do_file_updates() {  # A function because we need to do this in two places
     echo "Doing any needed file updates..."
     [ -n "$UPDATE_FILES" -a -f "$UPDATE_FILES" -a -x "$UPDATE_FILES" ] &&
@@ -39,6 +54,7 @@ lock_myth
 
 # Play a sound to let you know I'm starting.
 play_sound restore.wav
+export DISPLAY=:0.0
 
 # Doing this while the backend is active could be BAD.
 stop_mythbackend
@@ -46,6 +62,7 @@ stop_mythbackend
 # If the standard backup file exists we try to restore the files based
 # on our restore list.
 if compression=$(compression_type "$BACKUP_TAR") ; then
+    osd "Restoring files..." 0 1
     echo "Starting the restore of files..."
     cd /
     expand -c $BACKUP_TAR$compression |
@@ -59,8 +76,11 @@ if compression=$(compression_type "$BACKUP_SQL") ; then
     echo "Starting the DB restore, this can take a while..."
     echo "Clearing out the existing skeleton..."
     #mysql_stdin < $DROP_SQL
+    osd "Recreating database..." 0 2
     echo "Recreating the db..."
+    sleep 1
     $MYSQLADMIN -u root create $DATABASE
+    osd "Restoring database..." 0 3
     echo "Restoring the data (long)..."
     expand -c $BACKUP_SQL$compression | mysql_stdin
     echo "Doing any needed db updates..."
@@ -69,19 +89,32 @@ if compression=$(compression_type "$BACKUP_SQL") ; then
     echo "Completed the DB restore."
 fi
 
+osd "Testing restore..." 0 4
 echo "Sanity checking your restore..."
 play_sound vr.wav
 # Play a sound to let you know the outcome.
 if check_files_and_tables $RESTORE_LIST ; then
+    osd "Restore completed successfully." 5 5
     echo "Restore passes all checks."
+    COMPLETE_MSG="Last restore completed on `date '+%D @ %-I:%M %p'`"
     play_sound restored.wav
     STATUS=0
 else
+    osd "Restore FAILED." 5 5
     echo "The restore failed or was already modified!"
+    COMPLETE_MSG="Last restore FAILED on `date '+%D @ %-I:%M %p'`"
     play_sound rf.wav
     STATUS=1
 fi
 
+# Add Last restore status to menu item
+if grep "<description>" /usr/share/mythtv/themes/defaultmenu/mythrestore.xml >/dev/null 2>&1
+then
+    sed -i "s_\<description\>.*\<description\>_description\>$COMPLETE_MSG\<\/description_" /usr/share/mythtv/themes/defaultmenu/mythrestore.xml
+else
+    sed -i.orig " /NONE/ i\     \<description\>$COMPLETE_MSG\<\/description\>" /usr/share/mythtv/themes/defaultmenu/mythrestore.xml
+fi
+
 # Make any updates _after_ we verify the backup...
 do_db_updates
 do_file_updates
diff --git a/abs/mv-core/local-website/contents/header.jpg b/abs/mv-core/local-website/contents/header.jpg
old mode 100755
new mode 100644
-- 
cgit v0.12


From edca650261be27daa9c5d46a002edcb53c6edc6b Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 9 Jun 2010 18:12:47 -0500
Subject: setuptools: update to latest

---
 abs/core-testing/setuptools/PKGBUILD | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/abs/core-testing/setuptools/PKGBUILD b/abs/core-testing/setuptools/PKGBUILD
index 53c26a9..022f939 100644
--- a/abs/core-testing/setuptools/PKGBUILD
+++ b/abs/core-testing/setuptools/PKGBUILD
@@ -4,8 +4,8 @@
 # Contributor: Todd Maynard <arch@toddmaynard.com>
 
 pkgname=setuptools
-pkgver=0.6c9
-pkgrel=2
+pkgver=0.6c11
+pkgrel=1
 pkgdesc="setuptools is a collection of enhancements to the Python distutils"
 license=('PSF')
 arch=(i686 x86_64)
@@ -13,11 +13,11 @@ url="http://peak.telecommunity.com/DevCenter/setuptools"
 depends=('python')
 source=(http://cheeseshop.python.org/packages/source/s/$pkgname/$pkgname-$pkgver.tar.gz)
 
-md5sums=('3864c01d9c719c8924c455714492295e')
-
 build() {
   cd $startdir/src/$pkgname-$pkgver
   mkdir -p $startdir/pkg/usr/lib/python2.6/site-packages
   python setup.py install --root=$startdir/pkg
   echo "/usr/lib/python2.6/site-packages/$pkgname-$pkgver-py2.6.egg" > $startdir/pkg/usr/lib/python2.6/site-packages/setuptools.pth
 }
+
+md5sums=('7df2a529a074f613b509fb44feefe74e')
-- 
cgit v0.12


From 1e3831b1a242472e032122b1fcf7c574d8789d7d Mon Sep 17 00:00:00 2001
From: Britney Fransen <brfransen@gmail.com>
Date: Wed, 9 Jun 2010 18:16:44 -0500
Subject: imdbpy: update to latest to fixes error with jamu

---
 abs/extra-testing/imdbpy/PKGBUILD | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/abs/extra-testing/imdbpy/PKGBUILD b/abs/extra-testing/imdbpy/PKGBUILD
index 4b84e8e..337c8a0 100644
--- a/abs/extra-testing/imdbpy/PKGBUILD
+++ b/abs/extra-testing/imdbpy/PKGBUILD
@@ -4,7 +4,7 @@
 # Contributor: lang2 <wenzhi.liang@gmail.com>
 
 pkgname=imdbpy
-pkgver=4.3
+pkgver=4.5.1
 pkgrel=1
 pkgdesc="Python bindings for imdb"
 url="http://imdbpy.sourceforge.net/"
@@ -14,7 +14,6 @@ depends=('python')
 makedepends=('setuptools')
 optdepends=('python-lxml' 'python-sqlalchemy' 'python-sqlobject')
 source=(http://downloads.sourceforge.net/$pkgname/IMDbPY-$pkgver.tar.gz)
-md5sums=('faf32115d861dc8a8de6b584dceb488d')
 
 build(){
   cd "$srcdir/IMDbPY-$pkgver"
@@ -26,3 +25,5 @@ build(){
   mv ${pkgdir}/usr/imdb ${pkgdir}/usr/share
   mv ${pkgdir}/usr/doc ${pkgdir}/usr/share/imdb/
 }
+
+md5sums=('2bd76171aeacb609af5dd39ad7ac6144')
-- 
cgit v0.12

