mirror of
				https://github.com/rofafor/vdr-plugin-iptv.git
				synced 2023-10-10 11:37:03 +00:00 
			
		
		
		
	Fixed installation target bugs (Thanks to Alexander Grothe).
This commit is contained in:
		
							
								
								
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -225,3 +225,7 @@ VDR Plugin 'iptv' Revision History | |||||||
|  |  | ||||||
| - Made devices to shutdown already in cPluginManager::Stop() | - Made devices to shutdown already in cPluginManager::Stop() | ||||||
|   to prevent possible crashes while VDR shutdown. |   to prevent possible crashes while VDR shutdown. | ||||||
|  |  | ||||||
|  | 2014-03-09: Version 2.0.3 | ||||||
|  |  | ||||||
|  | - Fixed installation target bugs (Thanks to Alexander Grothe). | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							| @@ -32,6 +32,7 @@ PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(s | |||||||
| LIBDIR = $(call PKGCFG,libdir) | LIBDIR = $(call PKGCFG,libdir) | ||||||
| LOCDIR = $(call PKGCFG,locdir) | LOCDIR = $(call PKGCFG,locdir) | ||||||
| PLGCFG = $(call PKGCFG,plgcfg) | PLGCFG = $(call PKGCFG,plgcfg) | ||||||
|  | RESDIR = $(call PKGCFG,resdir) | ||||||
| CFGDIR = $(call PKGCFG,configdir) | CFGDIR = $(call PKGCFG,configdir) | ||||||
| # | # | ||||||
| TMPDIR ?= /tmp | TMPDIR ?= /tmp | ||||||
| @@ -147,7 +148,8 @@ install-lib: $(SOFILE) | |||||||
|  |  | ||||||
| install-conf: | install-conf: | ||||||
| 	@mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN) | 	@mkdir -p $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN) | ||||||
| 	@cp -pn $(PLUGIN)/* $(DESTDIR)$(CFGDIR)/plugins/$(PLUGIN)/ | 	@mkdir -p $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN) | ||||||
|  | 	@cp -pn $(PLUGIN)/* $(DESTDIR)$(RESDIR)/plugins/$(PLUGIN)/ | ||||||
|  |  | ||||||
| install: install-lib install-i18n install-conf | install: install-lib install-i18n install-conf | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										7
									
								
								config.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								config.c
									
									
									
									
									
								
							| @@ -19,6 +19,7 @@ cIptvConfig::cIptvConfig(void) | |||||||
|   for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i) |   for (unsigned int i = 0; i < ARRAY_SIZE(disabledFiltersM); ++i) | ||||||
|       disabledFiltersM[i] = -1; |       disabledFiltersM[i] = -1; | ||||||
|   memset(configDirectoryM, 0, sizeof(configDirectoryM)); |   memset(configDirectoryM, 0, sizeof(configDirectoryM)); | ||||||
|  |   memset(resourceDirectoryM, 0, sizeof(resourceDirectoryM)); | ||||||
| } | } | ||||||
|  |  | ||||||
| unsigned int cIptvConfig::GetDisabledFiltersCount(void) const | unsigned int cIptvConfig::GetDisabledFiltersCount(void) const | ||||||
| @@ -45,3 +46,9 @@ void cIptvConfig::SetConfigDirectory(const char *directoryP) | |||||||
|   debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP); |   debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP); | ||||||
|   ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory"); |   ERROR_IF(!realpath(directoryP, configDirectoryM), "Cannot canonicalize configuration directory"); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | void cIptvConfig::SetResourceDirectory(const char *directoryP) | ||||||
|  | { | ||||||
|  |   debug("cIptvConfig::%s(%s)", __FUNCTION__, directoryP); | ||||||
|  |   ERROR_IF(!realpath(directoryP, resourceDirectoryM), "Cannot canonicalize resource directory"); | ||||||
|  | } | ||||||
|   | |||||||
							
								
								
									
										3
									
								
								config.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								config.h
									
									
									
									
									
								
							| @@ -21,6 +21,7 @@ private: | |||||||
|   unsigned int sectionFilteringM; |   unsigned int sectionFilteringM; | ||||||
|   int disabledFiltersM[SECTION_FILTER_TABLE_SIZE]; |   int disabledFiltersM[SECTION_FILTER_TABLE_SIZE]; | ||||||
|   char configDirectoryM[PATH_MAX]; |   char configDirectoryM[PATH_MAX]; | ||||||
|  |   char resourceDirectoryM[PATH_MAX]; | ||||||
|  |  | ||||||
| public: | public: | ||||||
|   cIptvConfig(); |   cIptvConfig(); | ||||||
| @@ -30,6 +31,7 @@ public: | |||||||
|   unsigned int GetUseBytes(void) const { return useBytesM; } |   unsigned int GetUseBytes(void) const { return useBytesM; } | ||||||
|   unsigned int GetSectionFiltering(void) const { return sectionFilteringM; } |   unsigned int GetSectionFiltering(void) const { return sectionFilteringM; } | ||||||
|   const char *GetConfigDirectory(void) const { return configDirectoryM; } |   const char *GetConfigDirectory(void) const { return configDirectoryM; } | ||||||
|  |   const char *GetResourceDirectory(void) const { return resourceDirectoryM; } | ||||||
|   unsigned int GetDisabledFiltersCount(void) const; |   unsigned int GetDisabledFiltersCount(void) const; | ||||||
|   int GetDisabledFilters(unsigned int indexP) const; |   int GetDisabledFilters(unsigned int indexP) const; | ||||||
|   void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; } |   void SetTsBufferSize(unsigned int sizeP) { tsBufferSizeM = sizeP; } | ||||||
| @@ -39,6 +41,7 @@ public: | |||||||
|   void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; } |   void SetSectionFiltering(unsigned int onOffP) { sectionFilteringM = onOffP; } | ||||||
|   void SetDisabledFilters(unsigned int indexP, int numberP); |   void SetDisabledFilters(unsigned int indexP, int numberP); | ||||||
|   void SetConfigDirectory(const char *directoryP); |   void SetConfigDirectory(const char *directoryP); | ||||||
|  |   void SetResourceDirectory(const char *directoryP); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| extern cIptvConfig IptvConfig; | extern cIptvConfig IptvConfig; | ||||||
|   | |||||||
							
								
								
									
										5
									
								
								iptv.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								iptv.c
									
									
									
									
									
								
							| @@ -21,7 +21,7 @@ | |||||||
| #define GITVERSION "" | #define GITVERSION "" | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|        const char VERSION[]     = "2.0.2" GITVERSION; |        const char VERSION[]     = "2.0.3" GITVERSION; | ||||||
| static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); | static const char DESCRIPTION[] = trNOOP("Experience the IPTV"); | ||||||
|  |  | ||||||
| class cPluginIptv : public cPlugin { | class cPluginIptv : public cPlugin { | ||||||
| @@ -99,7 +99,8 @@ bool cPluginIptv::Initialize(void) | |||||||
| { | { | ||||||
|   debug("cPluginIptv::%s()", __FUNCTION__); |   debug("cPluginIptv::%s()", __FUNCTION__); | ||||||
|   // Initialize any background activities the plugin shall perform. |   // Initialize any background activities the plugin shall perform. | ||||||
|   IptvConfig.SetConfigDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); |   IptvConfig.SetConfigDirectory(cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)); | ||||||
|  |   IptvConfig.SetResourceDirectory(cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)); | ||||||
|   return cIptvDevice::Initialize(deviceCountM); |   return cIptvDevice::Initialize(deviceCountM); | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -5,10 +5,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" | "Last-Translator: Tobias Grimm <tg@e-tobi.net>\n" | ||||||
| "Language-Team: German <vdr@linuxtv.org>\n" | "Language-Team: German <vdr@linuxtv.org>\n" | ||||||
| "Language: de\n" | "Language: de\n" | ||||||
|   | |||||||
| @@ -5,10 +5,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: Rolf Ahrenberg\n" | "Last-Translator: Rolf Ahrenberg\n" | ||||||
| "Language-Team: Finnish <vdr@linuxtv.org>\n" | "Language-Team: Finnish <vdr@linuxtv.org>\n" | ||||||
| "Language: fi\n" | "Language: fi\n" | ||||||
|   | |||||||
| @@ -6,10 +6,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" | "Last-Translator: NIVAL Michaël <mnival@club-internet.fr>\n" | ||||||
| "Language-Team: French <vdr@linuxtv.org>\n" | "Language-Team: French <vdr@linuxtv.org>\n" | ||||||
| "Language: fr\n" | "Language: fr\n" | ||||||
|   | |||||||
| @@ -5,10 +5,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" | "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" | ||||||
| "Language-Team: Italian <vdr@linuxtv.org>\n" | "Language-Team: Italian <vdr@linuxtv.org>\n" | ||||||
| "Language: it\n" | "Language: it\n" | ||||||
|   | |||||||
| @@ -5,10 +5,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: Carel\n" | "Last-Translator: Carel\n" | ||||||
| "Language-Team: Dutch <vdr@linuxtv.org>\n" | "Language-Team: Dutch <vdr@linuxtv.org>\n" | ||||||
| "Language: nl\n" | "Language: nl\n" | ||||||
|   | |||||||
| @@ -5,10 +5,10 @@ | |||||||
| # | # | ||||||
| msgid "" | msgid "" | ||||||
| msgstr "" | msgstr "" | ||||||
| "Project-Id-Version: vdr-iptv 2.0.2\n" | "Project-Id-Version: vdr-iptv 2.0.3\n" | ||||||
| "Report-Msgid-Bugs-To: <see README>\n" | "Report-Msgid-Bugs-To: <see README>\n" | ||||||
| "POT-Creation-Date: 2014-01-08 01:18+0200\n" | "POT-Creation-Date: 2014-03-09 03:09+0200\n" | ||||||
| "PO-Revision-Date: 2014-01-08 01:18+0200\n" | "PO-Revision-Date: 2014-03-09 03:09+0200\n" | ||||||
| "Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n" | "Last-Translator: Alexander Gross <Bikalexander@gmail.com>\n" | ||||||
| "Language-Team: Russian <vdr@linuxtv.org>\n" | "Language-Team: Russian <vdr@linuxtv.org>\n" | ||||||
| "Language: ru\n" | "Language: ru\n" | ||||||
|   | |||||||
| @@ -158,7 +158,7 @@ bool cIptvProtocolExt::Set(const char* locationP, const int parameterP, const in | |||||||
|   if (!isempty(locationP)) { |   if (!isempty(locationP)) { | ||||||
|      struct stat stbuf; |      struct stat stbuf; | ||||||
|      // Update script file and parameter |      // Update script file and parameter | ||||||
|      scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetConfigDirectory(), locationP); |      scriptFileM = cString::sprintf("%s/%s", IptvConfig.GetResourceDirectory(), locationP); | ||||||
|      if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) { |      if ((stat(*scriptFileM, &stbuf) != 0) || (strstr(*scriptFileM, "..") != 0)) { | ||||||
|         error("Non-existent or relative path script '%s'", *scriptFileM); |         error("Non-existent or relative path script '%s'", *scriptFileM); | ||||||
|         return false; |         return false; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user