rpms/totem/devel totem-bin-backend-ondemand.sh, 1.3, 1.4 totem.spec, 1.183, 1.184

Stewart Adam (firewing) fedora-extras-commits at redhat.com
Tue Apr 8 20:41:39 UTC 2008


Author: firewing

Update of /cvs/extras/rpms/totem/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28732

Modified Files:
	totem-bin-backend-ondemand.sh totem.spec 
Log Message:
* Tue Apr 08 2008 Stewart Adam <s.adam at diffingo.com> - 2.23.1-2
- Fix error when only a single backend has been installed (#439634)




Index: totem-bin-backend-ondemand.sh
===================================================================
RCS file: /cvs/extras/rpms/totem/devel/totem-bin-backend-ondemand.sh,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- totem-bin-backend-ondemand.sh	19 Mar 2008 18:10:31 -0000	1.3
+++ totem-bin-backend-ondemand.sh	8 Apr 2008 20:40:37 -0000	1.4
@@ -16,35 +16,42 @@
 	exit 1
 }
 
-set_backend() {
+check_exists() {
+  # We've already run checks, this value is valid.
 	TOTEM_BACKEND=$1
-	# Default to GStreamer if there's no config
-	if [ -z $TOTEM_BACKEND ] ; then
-		echo "*** No backend name passed ***"
-		usage
-	fi
-	# Default to GStreamer if the backend is invalid
-	if [ $TOTEM_BACKEND != "xine" -a $TOTEM_BACKEND != "gstreamer" ] ; then
-		echo "*** Invalid backend name ***"
-		usage
-	fi
-  _LIBDIR="$(rpm --eval '%{_libdir}')"
-  if [ -f $_LIBDIR/libbaconvideowidget-gstreamer.so.0.0.0 ];then
-    if [ -f $_LIBDIR/libbaconvideowidget-xine.so.0.0.0 ];then
-      # only if both files exist
-      /usr/sbin/alternatives --set totem-backend $_LIBDIR/libbaconvideowidget-$TOTEM_BACKEND.so.0.0.0
-    else
-      echo -e 'Error: The xine backend was not found! Please check your totem installation.'
-      exit 1
-    fi
-  else
-    echo -e 'Error: The gstreamer backend was not found! Please check your totem installation.'
+  # Are we missing the requested backend?
+  if [ ! -f $_LIBDIR/libbaconvideowidget-$TOTEM_BACKEND.so.0.0.0 ];then
+    echo -e "Error: Cannot use backend $TOTEM_BACKEND, it is not installed."
+    echo -e "Please verify your installation";
     exit 1
   fi
-	exit 0
+}
+
+set_backend() {
+  # We've already run checks, this value is valid and it exists
+	TOTEM_BACKEND=$1
+  /usr/sbin/alternatives --set totem-backend $_LIBDIR/libbaconvideowidget-$TOTEM_BACKEND.so.0.0.0
 }
 # end functions
 
+_LIBDIR="$(rpm --eval '%{_libdir}')"
+TOTEM_BACKEND=$2
+BIN=$3
+# Check for valid backend
+# Default to GStreamer if there's no config
+if [ -z $TOTEM_BACKEND ] ; then
+	echo "Error: No backend name passed."
+	usage
+fi
+# Default to GStreamer if the backend is invalid
+if [ $TOTEM_BACKEND != "xine" -a $TOTEM_BACKEND != "gstreamer" ] ; then
+	echo "Error: Invalid backend name."
+	usage
+fi
+
+# Does the requested backend exist?
+check_exists $2
+
 # If root, just try to set the default backend
 if [ "$UID" -eq "0" ] ; then
 	if [ "$1" != "-b" -o -z "$2" ] ; then
@@ -55,20 +62,16 @@
 	if [ "$1" != "-b" -o -z "$2" ] ; then
 		usage;
 	fi
-	TOTEM_BACKEND=$2
-
 	if [ $TOTEM_BACKEND != "xine" -a $TOTEM_BACKEND != "gstreamer" ] ; then
-		echo "*** Invalid backend name passed ***"
+		echo "Error: Invalid backend name."
 		usage
 	fi
-
-	BIN=$3
 	if [ -z "$BIN" ] ; then
-		echo "*** No program name passed ***"
+		echo "Error: No program name passed."
 		usage
 	fi
 	if [ $BIN != "totem" -a $BIN != "totem-audio-preview" -a $BIN != "totem-video-indexer" -a $BIN != "totem-video-thumbnailer" ] ; then
-		echo "*** Wrong program name ***"
+		echo "Error: Wrong program name."
 		usage
 	fi
 	shift 3


Index: totem.spec
===================================================================
RCS file: /cvs/extras/rpms/totem/devel/totem.spec,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- totem.spec	8 Apr 2008 14:06:58 -0000	1.183
+++ totem.spec	8 Apr 2008 20:40:37 -0000	1.184
@@ -10,7 +10,7 @@
 Summary: Movie player for GNOME
 Name: totem
 Version: 2.23.1
-Release: 1%{?dist} 
+Release: 2%{?dist}
 License: GPLv2 with exception
 Group: Applications/Multimedia
 URL: http://www.gnome.org/projects/totem/
@@ -427,6 +427,9 @@
 %endif
 
 %changelog
+* Tue Apr 08 2008 Stewart Adam <s.adam at diffingo.com> - 2.23.1-2
+- Fix error when only a single backend has been installed (#439634)
+
 * Tue Apr 08 2008 - Bastien Nocera <bnocera at redhat.com> - 2.23.1-1
 - Update to 2.23.1
 




More information about the fedora-extras-commits mailing list