From 41772bfd42d7d1093bea6f84e69124450955bfe4 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 16 Oct 2014 19:31:17 +0000 Subject: added ability to lock update from dev version to stable git-svn-id: http://svn.miranda-ng.org/main/trunk@10801 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Utils.cpp | 38 +++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) (limited to 'plugins/PluginUpdater/src/Utils.cpp') diff --git a/plugins/PluginUpdater/src/Utils.cpp b/plugins/PluginUpdater/src/Utils.cpp index 15b50d05ae..fb24329b92 100644 --- a/plugins/PluginUpdater/src/Utils.cpp +++ b/plugins/PluginUpdater/src/Utils.cpp @@ -246,21 +246,31 @@ bool ParseHashes(const TCHAR *ptszUrl, ptrT &baseUrl, SERVLIST &arHashes) char str[200]; while(fgets(str, SIZEOF(str), fp) != NULL) { rtrim(str); - Netlib_Logf(hNetlibUser,"Update: %s", str); - char *p = strchr(str, ' '); - if (p != NULL) { - *p++ = 0; - _strlwr(p); - - int dwCrc32; - char *p1 = strchr(p, ' '); - if (p1 == NULL) - dwCrc32 = 0; - else { - *p1++ = 0; - sscanf(p1, "%08x", &dwCrc32); + if (str[0] == ';') { + db_unset(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE); + continue; + } + if (!strcmp(str, "DoNotSwitchToStable")) { + db_set_b(NULL, MODNAME, DB_SETTING_DONT_SWITCH_TO_STABLE, 1); + db_set_b(NULL, MODNAME, DB_SETTING_UPDATE_MODE, UPDATE_MODE_TRUNK); + } + else { + Netlib_Logf(hNetlibUser, "Update: %s", str); + char *p = strchr(str, ' '); + if (p != NULL) { + *p++ = 0; + _strlwr(p); + + int dwCrc32; + char *p1 = strchr(p, ' '); + if (p1 == NULL) + dwCrc32 = 0; + else { + *p1++ = 0; + sscanf(p1, "%08x", &dwCrc32); + } + arHashes.insert(new ServListEntry(str, p, dwCrc32)); } - arHashes.insert(new ServListEntry(str, p, dwCrc32)); } } fclose(fp); -- cgit v1.2.3