PackageManager: Cmdline fix

svn path=/trunk/; revision=14580
This commit is contained in:
Maarten Bosma 2005-04-10 17:03:40 +00:00
parent 0ba6cce82a
commit c1a2f01875
4 changed files with 28 additions and 11 deletions

View file

@ -91,6 +91,25 @@ int Help (void)
return 0; return 0;
} }
int Ask (const WCHAR* question)
{
char answer[255];
wprintf(question);
cout << " [y/n] ";
cin >> answer;
cout << endl;
if (answer[0]=='y')
return 1;
else if (answer[0]=='n')
return 0;
return Ask(question);
}
int SetStatus (int status1, int status2, WCHAR* text) int SetStatus (int status1, int status2, WCHAR* text)
{ {
if(text) if(text)
@ -125,14 +144,14 @@ int Install (void)
int id = PML_FindItem(tree, cmdline[i].c_str()); int id = PML_FindItem(tree, cmdline[i].c_str());
if(id) if(id)
PML_SetAction(tree, id, 1, NULL); PML_SetAction(tree, id, 1, NULL, Ask);
else else
cout << "Could not find the Package \"" << cmdline[i] << "\"\n"; cout << "Could not find the Package \"" << cmdline[i] << "\"\n";
} }
// do it // do it
error = PML_DoIt (tree, SetStatus); error = PML_DoIt (tree, SetStatus, Ask);
if(error) if(error)
{ {
wprintf(L"%s\n", PML_TransError(error)); wprintf(L"%s\n", PML_TransError(error));
@ -168,15 +187,12 @@ int Show (void)
{ {
int id = PML_FindItem(tree, cmdline[i].c_str()); int id = PML_FindItem(tree, cmdline[i].c_str());
cout << i << "<" << cmdline.size() << endl;
if(id) if(id)
cout << PML_GetDescription (tree, id) << "\n"; cout << PML_GetDescription (tree, id) << "\n";
else else
cout << "Could not find the Package \"" << cmdline[i] << "\"\n"; cout << "Could not find the Package \"" << cmdline[i] << "\"\n";
} }
cout << i << "<" << cmdline.size() << endl;
// clean up // clean up
PML_CloseTree (tree); PML_CloseTree (tree);

View file

@ -16,7 +16,7 @@
#include <wine/urlmon.h> #include <wine/urlmon.h>
// Server there all the files lie // Server there all the files lie
const char* tree_server = "http://maarten-online.de/xml/"; const char* tree_server = "http://svn.reactos.com/viewcvs/*checkout*/trunk/rosapps/packmgr/tree/";
HRESULT WINAPI URLDownloadToFileA( HRESULT WINAPI URLDownloadToFileA(
LPUNKNOWN pCaller, LPUNKNOWN pCaller,

View file

@ -99,6 +99,7 @@ void tree_start (void* usrdata, const char* tag, const char** arg)
// do some manipulation at the parent // do some manipulation at the parent
else else
{ {
if(tree->addItem)
tree->addItem(id, tree->packages[id].name, parents.back(), icon); tree->addItem(id, tree->packages[id].name, parents.back(), icon);
// list as child in the parent node // list as child in the parent node

View file

@ -1,7 +1,7 @@
<package> <package>
<name>MozillaControl</name> <name>MozillaControl</name>
<description>Provide the Gekko Engine for ReactOS.</description> <description>Provide the Gekko Engine for ReactOS.</description>
<scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/> <scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/>
<depent>abiword</depent>
</package> </package>