Author: pebender
Date: Sun Sep 14 21:08:07 2008
New Revision: 3755
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:
- Replaced MM_THEME_FILE_LIST with MM_THEME_FILE_MENU_ADD.
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 21:08:07
2008
@@ -185,7 +185,7 @@
# MM_THEME_URL
# MM_THEMEOSD_URL
# MM_THEMECACHE_URL
-# MM_THEME_FILE_LIST
+# MM_THEME_FILE_MENU_ADD
################################################################################
#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
21:08:07 2008
@@ -13,7 +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.
+ - Added MM_THEME_FILE_MENU_ADD for overriding/extending MythTV theme
menus.
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
21:08:07 2008
@@ -1620,7 +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>
+ <li><a
href="#MM_THEME_FILE_MENU_ADD">MM_THEME_FILE_MENU_ADD</a></li>
</ul>
<dl>
<dt id="MM_THEME-overview"><strong>Overview</strong></dt>
@@ -1748,29 +1748,15 @@
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>
+ <dt
id="MM_THEME_FILE_MENU_ADD"><strong>MM_THEME_FILE_MENU_ADD</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.
+ Set a colon (':') separated list of theme menu files that
will override/extend MythTV theme menus.
+ These files will be copied from the MiniMyth read-only
configuration directory.
</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.
+ by overriding the XML files that define the menu structure.
</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 21:08:07 2008
@@ -7,6 +7,8 @@
use strict;
use warnings;
+require File::Basename;
+
my %var_list;
sub var_list
@@ -164,7 +166,7 @@
},
value_none => ''
};
-$var_list{'MM_THEME_FILE_LIST'} =
+$var_list{'MM_THEME_FILE_MENU_ADD'} =
{
value_default => '',
value_clean => sub
@@ -173,18 +175,34 @@
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/:$//;
+ $value_clean = " $value_clean ";
+ $value_clean =~ s/[ \t]+/ /g;
+ $value_clean =~ s/ ([^ \/])/ \/$1/g;
+ $value_clean =~ s/\/+/\//g;
+ $value_clean =~ s/^ //;
+ $value_clean =~ s/ $//;
$minimyth->var_set($name, $value_clean);
},
- value_valid => ['', '(([^ ~]+~[^ ~]+)|(~[^ ~]+)|([^ ~]+~))(:(([^
~]+~[^ ~]+)|(~[^ ~]+)|([^ ~]+~)))*']
+ value_file => '.+',
+ file => sub
+ {
+ my $minimyth = shift;
+ my $name = shift;
+
+ my @file;
+
+ foreach (split(/ /, $minimyth->var_get($name)))
+ {
+ my $item;
+ $item->{'name_remote'} = "$_";
+ $item->{'name_local'} = '/home/minimyth/.mythtv/' .
File::Basename::basename($_);
+ $item->{'mode_local'} = '0644';
+
+ push(@file, $item);
+ }
+
+ return [EMAIL PROTECTED];
+ }
};
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 21:08:07 2008
@@ -81,51 +81,6 @@
}
}
- # 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 21:08:07 2008
@@ -124,16 +124,12 @@
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%:$%%'`
+ MM_THEME_FILE_MENU_ADD=`/bin/echo " ${MM_THEME_FILE_MENU_ADD} " |
/bin/sed \
+ -e 's%[ \t][ \t]*% %g' \
+ -e 's% \([^ /]\)% /\1%g' \
+ -e 's%//*%/%g' \
+ -e 's%^ %%' \
+ -e 's% $%%'`
return 0
}
@@ -141,16 +137,32 @@
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_FILE_LIST "${MM_THEME_FILE_LIST}"
+ 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_MENU_ADD "${MM_THEME_FILE_MENU_ADD}"
return 0
}
conf_fetch_MM_THEME() {
+ local name_remote
+ local name_local
+
+ if /usr/bin/test -n "${MM_THEME_FILE_MENU_ADD}" ; then
+ /bin/mkdir -p /home/minimyth/.mythtv
+ for name_remote in ${MM_THEME_FILE_MENU_ADD} ; do
+ name_local=`/usr/bin/basename ${name_remote}`
+ name_local="/home/minimyth/.mythtv/${name_local}"
+ /bin/rm -f ${name_local}
+ 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."
+ fi
+ done
+ fi
+
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 21:08:07 2008
@@ -74,48 +74,6 @@
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.
if /usr/bin/test -n "${MM_THEMECACHE_URL}" ; then
mm_url_mount "${MM_THEMECACHE_URL}" "/home/minimyth/.mythtv/themecache"
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---