PLugin-Packs laden

Alles rund um das grafische Benutzerinterface Enigma
essu
Tuxboxer
Tuxboxer
Beiträge: 2452
Registriert: Montag 21. Oktober 2002, 10:04

PLugin-Packs laden

Beitrag von essu »

Code: Alles auswählen

--- enigma_plugins.cpp.orig	2004-11-19 08:25:48.000000000 +0100
+++ enigma_plugins.cpp	2004-11-27 02:26:43.000000000 +0100
@@ -124,7 +124,13 @@
 	
 	PluginPath[0] = "/var/tuxbox/plugins/";
 	PluginPath[1] = PLUGINDIR "/";
-	PluginPath[2] = "";
+#ifdef SQUASHFS
+	PluginPath[2] = "/lib/tuxbox/eplugins/";
+	for (int i=3; i<10; i++)
+	{
+	PluginPath[i]="";
+	}
+#endif
 	setHelpText(_("select plugin and press ok"));
 	move(ePoint(150, 100));
 #ifndef DISABLE_LCD
@@ -141,10 +147,16 @@
 	int connType=0;
 	eConfig::getInstance()->getKey("/elitedvb/network/connectionType", connType);
 	bool hasNetwork = eSystemInfo::getInstance()->hasNetwork();
-	
-
+#ifdef SQUASHFS	
+	int add_path=3;
+	for ( int i = 0; i < 10; i++ )
+	{
+		if ( PluginPath[i] == "" )
+			break;
+#else
 	for ( int i = 0; i < 2; i++ )
 	{
+#endif
 		DIR *d=opendir(PluginPath[i].c_str());
 		if (!d)
 		{
@@ -164,6 +176,25 @@
 		while (struct dirent *e=readdir(d))
 		{
 			eString FileName = e->d_name;
+#ifdef SQUASHFS
+			if ( FileName.find(".pack") != eString::npos )
+			{
+				eString p_dir=(PluginPath[i]+FileName+"dir").c_str();
+				eString cmd=("mkdir "+p_dir+" && "+"mount -t squashfs -o loop "+PluginPath[i]+FileName+" "+p_dir).c_str();
+				system(cmd.c_str());
+				DIR *dir=opendir(p_dir.c_str());
+				if (!dir || add_path > 10 )
+				{
+					eString err;
+					err.sprintf(_("Couldn't read add_plugin directory %s"), p_dir.c_str() );
+					eDebug(err.c_str());
+				}
+				else
+					PluginPath[add_path++]=p_dir;
+				closedir(d);
+				continue;
+			}
+#endif
 			if ( FileName.find(".cfg") != eString::npos )
 			{
 				eString cfgname=(PluginPath[i]+FileName).c_str();
Schon gelesen ???
ENIGMA-DOC