mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:42:57 +00:00
PackageManager: Cmdline fix
svn path=/trunk/; revision=14580
This commit is contained in:
parent
0ba6cce82a
commit
c1a2f01875
4 changed files with 28 additions and 11 deletions
|
@ -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);
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue