PackageManager: Bug fix
Modified: trunk/rosapps/packmgr/lib/download.cpp
Modified: trunk/rosapps/packmgr/lib/es.rc
Modified: trunk/rosapps/packmgr/lib/functions.cpp
Modified: trunk/rosapps/packmgr/lib/main.cpp
Modified: trunk/rosapps/packmgr/lib/package.cpp
Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml
_____
Modified: trunk/rosapps/packmgr/lib/download.cpp
--- trunk/rosapps/packmgr/lib/download.cpp 2005-04-11 17:28:14 UTC
(rev 14589)
+++ trunk/rosapps/packmgr/lib/download.cpp 2005-04-11 17:59:52 UTC
(rev 14590)
@@ -26,35 +26,48 @@
LPBINDSTATUSCALLBACK lpfnCB
);
+int FindCount (string What, string Where, int start = 0, int end = -1);
+
// Download a file
-char* PML_Download (const char* name, const char* local_name =
"packmgr.txt", const char* server = tree_server, BOOL totemp = TRUE)
+char* PML_Download (const char* url, const char* server = "tree", const
char* filename = NULL)
{
- char url [MAX_PATH];
- static char path [MAX_PATH];
+ char downl [MAX_PATH];
+ static char path [MAX_PATH];
// get temp dir
- if(totemp)
+ if(!filename)
GetTempPathA (200, path);
+
+ else if(!strstr(filename, "\\"))
+ GetTempPathA (200, path);
// create the local file name
- if(local_name)
- strcat(path, local_name);
+ if(filename)
+ {
+ strcat(path, filename);
+ DeleteFileA (path);
+ }
else
- strcat(path, "tmp.tmp");
+ GetTempFileNameA (path, "pml", 0, path);
// get the url
- if(server) strcpy(url, server);
- strcat(url, name);
- // make sure there is no old file
- DeleteFileA (path);
+ if (!server);
+ else if(!strcmp(server, "tree"))
+ strcpy(downl, tree_server);
+
+ else
+ strcpy(downl, server);
+
+ strcat(downl, url);
+
// download the file
- if(URLDownloadToFileA (NULL, url, path, 0, NULL) != S_OK)
+ if(URLDownloadToFileA (NULL, downl, path, 0, NULL) != S_OK)
{
Log("! ERROR: Unable to download ");
- LogAdd(url);
+ LogAdd(downl);
return NULL;
}
_____
Modified: trunk/rosapps/packmgr/lib/es.rc
--- trunk/rosapps/packmgr/lib/es.rc 2005-04-11 17:28:14 UTC (rev
14589)
+++ trunk/rosapps/packmgr/lib/es.rc 2005-04-11 17:59:52 UTC (rev
14590)
@@ -14,6 +14,10 @@
ERR_SYNATX "Error durante la ejecuci¾n del Script.\nSintaxis
err¾nea."
ERR_CALL "Error durante la ejecuci¾n del Script.\nNo se pudo
encontrar la funci¾n."
ERR_PARAMETER "Error durante la ejecuci¾n del
Script.\nParametro(s) err¾neo."
+
+ ERR_DEP1 "To install this package you have to install the
following package(s) as well:\n\n"
+ ERR_DEP2 "\nDo you want this ?"
+ ERR_READY "You choosen to install %d package(s). To install
them you have to read and agree with each of thier licences.\n\n Do you
want still want to ?"
END
/* EOF */
_____
Modified: trunk/rosapps/packmgr/lib/functions.cpp
--- trunk/rosapps/packmgr/lib/functions.cpp 2005-04-11 17:28:14 UTC
(rev 14589)
+++ trunk/rosapps/packmgr/lib/functions.cpp 2005-04-11 17:59:52 UTC
(rev 14590)
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////
//
-// script.cpp
+// functions.cpp
//
// Script Functions
//
@@ -15,7 +15,7 @@
#include "log.h"
extern const char* tree_server;
-char* PML_Download (const char* name, const char* local_name, const
char* server, BOOL totemp = TRUE);
+char* PML_Download (const char* url, const char* server, const char*
filename);
int debuglog (int argc, char* argv[])
@@ -31,10 +31,10 @@
char* result;
if (argc==3)
- result = PML_Download(argv[1], argv[2], argv[3]);
+ result = PML_Download(argv[1], argv[3], argv[2]);
else if (argc==2)
- result = PML_Download(argv[1], argv[2], NULL);
+ result = PML_Download(argv[1], NULL, argv[2]);
else
return ERR_GENERIC;
_____
Modified: trunk/rosapps/packmgr/lib/main.cpp
--- trunk/rosapps/packmgr/lib/main.cpp 2005-04-11 17:28:14 UTC (rev
14589)
+++ trunk/rosapps/packmgr/lib/main.cpp 2005-04-11 17:59:52 UTC (rev
14590)
@@ -19,8 +19,7 @@
HANDLE hThread = NULL;
BOOL thread_abort = FALSE;
-extern const char* tree_server;
-char* PML_Download (const char* name, const char* local_name =
"packmgr.txt", const char* server = tree_server, BOOL totemp = TRUE);
+char* PML_Download (const char* url, const char* server = "tree",
const char* filename = NULL);
// Abort other thread
_____
Modified: trunk/rosapps/packmgr/lib/package.cpp
--- trunk/rosapps/packmgr/lib/package.cpp 2005-04-11 17:28:14 UTC
(rev 14589)
+++ trunk/rosapps/packmgr/lib/package.cpp 2005-04-11 17:59:52 UTC
(rev 14590)
@@ -169,7 +169,7 @@
UINT count = pack->depencies.size();
WCHAR buffer[2000], buffer2[200];
wcscpy(buffer, PML_TransError(ERR_DEP1));
-
+
for (i=0; i<pack->depencies.size(); i++)
{
int item = PML_FindItem(tree,
pack->depencies[i]);
@@ -190,16 +190,18 @@
wcscat(buffer, PML_TransError(ERR_DEP2));
if(count)
+ {
if(!Ask(buffer))
return ERR_GENERIC;
- for (i=0; i<pack->depencies.size(); i++)
- {
- int item = PML_FindItem(tree,
pack->depencies[i]);
+ for (i=0; i<pack->depencies.size(); i++)
+ {
+ int item = PML_FindItem(tree,
pack->depencies[i]);
- tree->packages[item].neededBy.push_back(id);
+
tree->packages[item].neededBy.push_back(id);
- PML_SetAction(tree, item, action, SetIcon, Ask);
+ PML_SetAction(tree, item, action,
SetIcon, Ask);
+ }
}
}
_____
Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml
--- trunk/rosapps/packmgr/tree/mozcontrol.xml 2005-04-11 17:28:14 UTC
(rev 14589)
+++ trunk/rosapps/packmgr/tree/mozcontrol.xml 2005-04-11 17:59:52 UTC
(rev 14590)
@@ -2,6 +2,5 @@
<name>MozillaControl</name>
<description>Provide the Gekko Engine for ReactOS.</description>
<scripts inst="mozillacontrol.inst.rps"
srcinst="mozillacontrol.inst.rps"/>
- <depent>abiword</depent>
</package>