Author: pebender
Date: Sun Sep 14 19:05:01 2008
New Revision: 3753

Modified:
    trunk/gar-minimyth/html/minimyth/conf/minimyth.conf
    trunk/gar-minimyth/html/minimyth/document-changelog.txt
    trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf/MM_THEME.pm
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/mythtv.pm
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/conf.d/MM_THEME
     
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/mythtv

Log:
- Added MM_THEME_FILE_LIST for updating theme files.



Modified: trunk/gar-minimyth/html/minimyth/conf/minimyth.conf
==============================================================================
--- trunk/gar-minimyth/html/minimyth/conf/minimyth.conf (original)
+++ trunk/gar-minimyth/html/minimyth/conf/minimyth.conf Sun Sep 14 19:05:01  
2008
@@ -185,6 +185,7 @@
  # MM_THEME_URL
  # MM_THEMEOSD_URL
  # MM_THEMECACHE_URL
+# MM_THEME_FILE_LIST
   
################################################################################
  #MM_THEME_NAME='G.A.N.T.'
  #MM_THEMEOSD_NAME='Titivillus-OSD'

Modified: trunk/gar-minimyth/html/minimyth/document-changelog.txt
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-changelog.txt     (original)
+++ trunk/gar-minimyth/html/minimyth/document-changelog.txt     Sun Sep 14  
19:05:01 2008
@@ -13,6 +13,7 @@
  Modified MiniMyth configuration
      - Added MM_PLUGIN_INFORMATION_CENTER_ENABLED for disabling (i.e.  
removing)
        the 'Information Center' menu.
+    - Added MM_THEME_FILE_LIST for updating theme files.

  Modified MiniMyth commands
      - Changed mm_slpeed so that is saves the system clock to the hardware

Modified: trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html
==============================================================================
--- trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html        
(original)
+++ trunk/gar-minimyth/html/minimyth/document-minimyth_conf.html        Sun Sep 
14  
19:05:01 2008
@@ -1620,6 +1620,7 @@
              <li><a href="#MM_THEME_URL">MM_THEME_URL</a></li>
              <li><a href="#MM_THEMEOSD_URL">MM_THEMEOSD_URL</a></li>
              <li><a href="#MM_THEMECACHE_URL">MM_THEMECACHE_URL</a></li>
+            <li><a href="#MM_THEME_FILE_LIST">MM_THEME_FILE_LIST</a></li>
            </ul>
            <dl>
              <dt id="MM_THEME-overview"><strong>Overview</strong></dt>
@@ -1745,6 +1746,31 @@
                  The name of the themecache squashfs image will be
                  "${<a  
href="#MM_THEME_NAME">MM_THEME_NAME</a>}.{GuiWidth}.{GuiHeight}.sfs",
                  where {GuiWidth} is the MythTV GUI width and {GuiHeight}  
is the MythTV GUI height.
+              </p>
+            </dd>
+            <dt  
id="MM_THEME_FILE_LIST"><strong>MM_THEME_FILE_LIST</strong></dt>
+            <dd>
+              <p>
+                Set a colon (':') separated list of theme files to update.
+                Each list item is a tilde ('~') separated 2-tuple,
+                with the first field the file in the MiniMyth read-only  
configuration directory and
+                the second field the file in the MiniMyth  
frontend's '/usr/share/mythtv' directory.
+                If the first field is empty, then the file on the frontend  
is deleted.
+                If the second field is empty, then the file on the  
frontend is assumed to have the same name
+                as the file in the configuration directory.
+                In each list item, trailing field separators may be  
omitted.
+                List items for which all fields are empty are ignored.
+                Whitespace surrounding the item and fields separators is  
ignored.
+              </p>
+              <p>
+                You can use this variable to do things such as change the  
frontend's menu structure
+                by replacing the XML files that define the menu structure.
+              </p>
+              <p>
+                The files are updated after the MythTV theme directory and  
MythTV OSD theme directory are mounted,
+                which allows you to update files in the MythTV theme  
directory and MythTV OSD theme directory.
+                However, if the MythTV theme directory or MythTV theme OSD  
directory is a read only remote directory
+                then files in the directory cannot be deleted.
                </p>
              </dd>
            </dl>

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf/MM_THEME.pm
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf/MM_THEME.pm
  
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/conf/MM_THEME.pm
  
Sun Sep 14 19:05:01 2008
@@ -164,6 +164,27 @@
      },
      value_none     => ''
  };
+$var_list{'MM_THEME_FILE_LIST'} =
+{
+    value_default  => '',
+    value_clean    => sub
+    {
+        my $minimyth = shift;
+        my $name     = shift;

+        my $value_clean = $minimyth->var_get($name);
+        $value_clean = ":$value_clean:";
+        $value_clean =~ s/[ \t]*~[ \t]*/~/g;
+        $value_clean =~ s/[ \t]*:[ \t]*/:/g;
+        $value_clean =~ s/(:~)+:/:/g;
+        $value_clean =~ s/::+/::/g;
+        $value_clean =~ s/:([^~:]+):/:$1~:/g;
+        $value_clean =~ s/:+/:/g;
+        $value_clean =~ s/^://;
+        $value_clean =~ s/:$//;
+        $minimyth->var_set($name, $value_clean);
+    },
+    value_valid    => ['', '(([^ ~]+~[^ ~]+)|(~[^ ~]+)|([^ ~]+~))(:(([^  
~]+~[^ ~]+)|(~[^ ~]+)|([^ ~]+~)))*']
+};

  1;

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/mythtv.pm
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/mythtv.pm
         
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d.perl/init/mythtv.pm
         
Sun Sep 14 19:05:01 2008
@@ -81,6 +81,51 @@
          }
      }

+    # Update theme files.
+    foreach (split(/:/, $minimyth->var_get('MM_THEME_FILE_LIST')))
+    {
+        if (/([^ ~]*)~([^ ~]*)/)
+        {
+            if ($1)
+            {
+                my $name_remote = "/$1";
+                my $name_local  =  
$2 ? "/usr/share/mythtv/$2" : "/usr/share/mythtv/$1";
+
+                $name_remote =~ s/\/\/+/\//g;
+                $name_remote =~ s/^\///;
+
+                $name_local  =~ s/\/\/+/\//g;
+
+                my $result = $minimyth->confro_get($name_remote,  
$name_local);
+                if (! -e $name_local)
+                {
+                    $minimyth->message_log('err', qq(error: failed to  
fetch MiniMyth read-only configuration file ') . $name_remote . qq('));
+                    return 1;
+                }
+                else
+                {
+                    $minimyth->message_log('info', qq(fetched MiniMyth  
read-only configuration file ') . $name_remote . qq('));
+                    $minimyth->message_log('info', qq(  by fetching ') .  
$result . qq('));
+                    $minimyth->message_log('info', qq(  to local file ') .  
$name_local . qq('.));
+                    chmod(oct('0644'), $name_local);
+                }
+            }
+            else
+            {
+                my $name_local = "/usr/share/mythtv/$2";
+
+                $name_local  =~ s/\/\/+/\//g;
+
+                unlink($name_local);
+                if (-e $name_local)
+                {
+                    $minimyth->message_log('err', qq(error: failed to  
delete file ') . $name_local . qq('));
+                    return 1;
+                }
+            }
+        }
+    }
+
      my $themecache_url  = $minimyth->var_get('MM_THEMECACHE_URL');
      # Mount themecache directory.
      if ($themecache_url)

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/conf.d/MM_THEME
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/conf.d/MM_THEME
      
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/conf.d/MM_THEME
      
Sun Sep 14 19:05:01 2008
@@ -124,17 +124,29 @@
          mm_message_output err "error: 'MM_THEMEOSD_NAME' is not set."
      fi

+    MM_THEME_FILE_LIST=":${MM_THEME_FILE_LIST}:"
+    MM_THEME_FILE_LIST=`/bin/echo ${MM_THEME_FILE_LIST} | /bin/sed \
+       -e 's%[ \t]*:[ \t]*%:%g' \
+       -e 's%[ \t]*~[ \t]*%~%g' \
+        -e 's%\(:~\)\(:~\)*:%:%g' \
+        -e 's%:::*%::%g' \
+        -e 's%:\([^~:][^~:]*\):%:\1~:%g' \
+        -e 's%::*%:%g' \
+        -e 's%^:%%'  \
+        -e 's%:$%%'`
+
      return 0
  }

  conf_write_MM_THEME() {
      local conf_file=$1

-    conf_variable_write "${conf_file}" MM_THEME_NAME     "${MM_THEME_NAME}"
-    conf_variable_write "${conf_file}"  
MM_THEMEOSD_NAME  "${MM_THEMEOSD_NAME}"
-    conf_variable_write "${conf_file}" MM_THEME_URL      "${MM_THEME_URL}"
-    conf_variable_write "${conf_file}"  
MM_THEMEOSD_URL   "${MM_THEMEOSD_URL}"
-    conf_variable_write "${conf_file}"  
MM_THEMECACHE_URL "${MM_THEMECACHE_URL}"
+    conf_variable_write "${conf_file}"  
MM_THEME_NAME      "${MM_THEME_NAME}"
+    conf_variable_write "${conf_file}"  
MM_THEMEOSD_NAME   "${MM_THEMEOSD_NAME}"
+    conf_variable_write "${conf_file}" MM_THEME_URL       "${MM_THEME_URL}"
+    conf_variable_write "${conf_file}"  
MM_THEMEOSD_URL    "${MM_THEMEOSD_URL}"
+    conf_variable_write "${conf_file}"  
MM_THEMECACHE_URL  "${MM_THEMECACHE_URL}"
+    conf_variable_write "${conf_file}"  
MM_THEME_FILE_LIST "${MM_THEME_FILE_LIST}"

      return 0
  }

Modified:  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/mythtv
==============================================================================
---  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/mythtv
       
(original)
+++  
trunk/gar-minimyth/script/meta/minimyth/files/source/rootfs/etc/rc.d/init.d/mythtv
       
Sun Sep 14 19:05:01 2008
@@ -8,6 +8,9 @@

  start() {

+    local dir
+    local file
+    local found
      local jumppoints
      local jumppoints_destination
      local jumppoints_keylist
@@ -15,13 +18,13 @@
      local keybindings_actions
      local keybindings_context
      local keybindings_keylist
+    local MTD
+    local name_local
+    local name_remote
      local settings
      local settings_data
      local settings_value
      local TRANSCODE
-    local file
-    local dir
-    local found

      mm_message_output info "configuring MythTV ..."

@@ -69,6 +72,48 @@
              mm_message_output err "error: mount  
of 'MM_THEMEOSD_URL=${MM_THEMEOSD_URL}' failed."
              exit 1
          fi
+    fi
+
+    # Update theme files.
+    if /usr/bin/test -n "${MM_THEME_FILE_LIST}" ; then
+        IFS_SAVE=${IFS}
+        IFS=:
+        for item in ${MM_THEME_FILE_LIST} ; do
+            name_remote=`/bin/echo ${item} | /usr/bin/cut -d '~' -f 1`
+            name_local=`/bin/echo ${item} | /usr/bin/cut -d '~' -f 2`
+            if /usr/bin/test -n "${name_remote}" || /usr/bin/test  
-n "${name_local}"  ; then
+                if /usr/bin/test -n "${name_remote}" ; then
+                    name_remote="/${name_remote}"
+                    if /usr/bin/test -z "${name_local}" ; then
+                        name_local=${name_remote}
+                    fi
+                    name_local="/usr/share/mythtv/${name_local}"
+
+                    name_remote=`/bin/echo ${name_remote} | /bin/sed  
-e 's%//*%/%g' -e 's%^//*%/%'`
+
+                    name_local=`/bin/echo ${name_local} | /bin/sed  
-e 's%//*%/%g'`
+
+                    mm_confro_get ${name_remote} ${name_local}
+                    if /usr/bin/test ! -e ${name_local} ; then
+                        mm_message_output err "error: failed to  
fetch '${name_remote}' file."
+                        exit 1
+                    else
+                        /bin/chmod 0644 ${name_local}
+                    fi
+                else
+                    name_local="/usr/share/mythtv/${name_local}"
+
+                    name_local=`/bin/echo ${name_local} | /bin/sed  
-e 's%//*%/%g'`
+
+                    /bin/rm -f ${name_local}
+                    if /usr/bin/test -e ${name_local} ; then
+                        mm_message_output err "error: failed to  
delete '${name_local}' file."
+                        exit 1
+                    fi
+                fi
+            fi
+        done
+        IFS=${IFS_SAVE}
      fi

      # Mount themecache directory.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"minimyth-commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/minimyth-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to