Hi,

Steve O'Hara and me are putting together a freevo port for the FreeBSD ports tree. I think we'll have something useful shortly.

In the process of doing this, we've found some Linux-isms in the source tree that we had to fix, and it looks likely we'll find some more as things progress.

I've received a private email by one of the committers indicating that I should join the list and then post the patches. Thus, attached to this email are the first couple of diffs against the CVS tree. They should all be no-ops for Linux users:

        runapp.c.patch is simple, only adds some includes so runapp
        compiles on FreeBSD.

        freevo.patch makes the freevo shell script conform to basic sh
        syntax. I think the sh variant on Linux is actually bash, which
        is more expressive than FreeBSD's basic sh.

        config.py.patch enables auto-detection of CD and DVD drives
        under the FreeBSD device naming scheme. More work will be
        required to use them though.

These are just the first three patches, but they get us to a state where freevo displays its main menu, and at least sees optical drives. More changes will definitly be required, and I'll patch diffs here as we progress.

Please review these patches and let us know whether they can be committed as-is, or if not, what changes we should make.

Thanks,
Lars
--
Lars Eggert <[EMAIL PROTECTED]>           USC Information Sciences Institute

Index: runapp.c
===================================================================
RCS file: /cvsroot/freevo/freevo/runapp.c,v
retrieving revision 1.19
diff -u -r1.19 runapp.c
--- runapp.c    1 Jul 2003 01:50:47 -0000       1.19
+++ runapp.c    20 Aug 2003 04:27:21 -0000
@@ -23,8 +23,13 @@
 #include <sched.h>
 #include <time.h>
 #include <errno.h>
+#ifdef __FreeBSD__
+#include <unistd.h>
+#include <sys/imgact_aout.h>
+#define N_MAGIC(x) N_GETMAGIC(x)
+#else
 #include <linux/a.out.h>
-
+#endif
 
 #define LOG(str, args...) {                                             \
   static char tmp1[1000];                                               \
Index: freevo
===================================================================
RCS file: /cvsroot/freevo/freevo/freevo,v
retrieving revision 1.66
diff -u -r1.66 freevo
--- freevo      17 Aug 2003 13:46:54 -0000      1.66
+++ freevo      20 Aug 2003 04:26:34 -0000
@@ -37,7 +37,7 @@
 export 
PYTHONPATH=$FREEVO_HOME:$FREEVO_HOME/$src:$FREEVO_HOME/$src/www:$FREEVO_HOME/$src/tv
 
 # Is runapp present? If not it needs to be compiled
-if ! [ -e "$FREEVO_HOME/runapp" ]; then
+if [ ! -e "$FREEVO_HOME/runapp" ]; then
     echo
     echo "*************************************************************"
     echo "* Please note that there is a standalone binary release     *"
@@ -52,7 +52,7 @@
 fi
 
 # call new x session if needed
-if [ "$call" == "freevo" ] && [ "$1" == "-fs" ]; then
+if [ "$call" = "freevo" -a "$1" = "-fs" ]; then
     servernum=0
 
     while true; do
@@ -64,7 +64,7 @@
 fi
 
 # call helper if the script is called as wrapper
-if [ "$call" == "freevo" ]; then
+if [ "$call" = "freevo" ]; then
     script="$FREEVO_HOME/$helpers/$1.py"
     if [ -e "$script" ]; then
        shift
@@ -86,7 +86,7 @@
 fi
 
 # cd to the freevo directory if necessary
-if ! [ -e src/identifymedia.py ]; then
+if [ ! -e src/identifymedia.py ]; then
     cd $FREEVO_HOME
     unset FREEVO_HOME
 fi
@@ -108,7 +108,7 @@
 
 
 # Help
-if [ "$1" = "--help" ] || [ "$1" = "-" ] ; then
+if [ "$1" = "--help" -o "$1" = "-" ] ; then
     echo "freevo [ script | options]"
     echo "options:"
     echo "  -fs            start freevo in a new x session in fullscreen"
@@ -146,10 +146,10 @@
 
 # Is freevo.conf present? If not, ./configure is needed
 # Check the possible locations in prio order
-if ! [ -e $FREEVO_STARTDIR/freevo.conf ]; then
-    if ! [ -e $HOME/.freevo/freevo.conf ]; then
-        if ! [ -e /etc/freevo/freevo.conf ]; then
-            if ! [ -e ./freevo.conf ]; then
+if [ ! -e $FREEVO_STARTDIR/freevo.conf ]; then
+    if [ ! -e $HOME/.freevo/freevo.conf ]; then
+        if [ ! -e /etc/freevo/freevo.conf ]; then
+            if [ ! -e ./freevo.conf ]; then
                 echo "Please run 'freevo setup' first (freevo.conf not found)"
                 exit 1
             fi
@@ -197,7 +197,7 @@
     if [ -f $PID_FILE ] ; then
         PID=`cat $PID_FILE`
         RUNNING=`ps -ef | grep " $PID " | grep $APP`
-        if ! [ "$RUNNING" = "" ] ; then
+        if [ ! "$RUNNING" = "" ] ; then
           echo "Freevo's $APP is already running as process $PID."
           exit 0
         fi
@@ -231,7 +231,7 @@
 if [ -f $PID_FILE ] ; then
     PID=`cat $PID_FILE`
     RUNNING=`ps -ef | grep " $PID " | grep main`
-    if ! [ "$RUNNING" = "" ] ; then
+    if [ ! "$RUNNING" = "" ] ; then
       echo "Freevo is already running as process $PID."
       exit 0
     fi
Index: src/config.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/config.py,v
retrieving revision 1.37
diff -u -r1.37 config.py
--- src/config.py       15 Aug 2003 19:25:14 -0000      1.37
+++ src/config.py       20 Aug 2003 04:34:39 -0000
@@ -341,7 +341,7 @@
 # Autodetect the CD/DVD drives in the system if not given in local_conf.py
 if not ROM_DRIVES:
     if os.path.isfile('/etc/fstab'):
-        RE_CD = '^(/dev/cdrom)[ \t]+([^ \t]+)[ \t]+'
+        RE_CD = '^(/dev/cdrom|/dev/a?cd\dc?)[ \t]+([^ \t]+)[ \t]+'
         RE_CDREC ='^(/dev/cdrecorder)[ \t]+([^ \t]+)[ \t]+'
         RE_DVD ='^(/dev/dvd)[ \t]+([^ \t]+)[ \t]+'
         RE_ISO ='^([^ \t]+)[ \t]+([^ \t]+)[ \t]+iso9660'
@@ -382,6 +382,10 @@
                 else:
                     mntdir = devname = dispname = ''
 
+           # FreeBSD mount point is device name + "c"
+            if os.uname()[0] == 'FreeBSD':
+                devname = devname[:-1]
+ 
             # Weed out duplicates
             for rd_mntdir, rd_devname, rd_dispname in ROM_DRIVES:
                 if os.path.realpath(rd_devname) == os.path.realpath(devname):

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Reply via email to