PackageManager: Cmdline fix
Modified: trunk/rosapps/packmgr/cmd-line/main.cpp
Modified: trunk/rosapps/packmgr/lib/download.cpp
Modified: trunk/rosapps/packmgr/lib/tree.cpp
Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml

Modified: trunk/rosapps/packmgr/cmd-line/main.cpp
--- trunk/rosapps/packmgr/cmd-line/main.cpp	2005-04-10 16:45:30 UTC (rev 14579)
+++ trunk/rosapps/packmgr/cmd-line/main.cpp	2005-04-10 17:03:40 UTC (rev 14580)
@@ -90,6 +90,25 @@
 
 	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)
 {
@@ -125,14 +144,14 @@
 		int id = PML_FindItem(tree, cmdline[i].c_str());
 
 		if(id)
-			PML_SetAction(tree, id, 1, NULL);
+			PML_SetAction(tree, id, 1, NULL, Ask);
 
 		else 
 			cout << "Could not find the Package \"" << cmdline[i] << "\"\n";
 	}
 
 	// do it
-	error = PML_DoIt (tree, SetStatus);
+	error = PML_DoIt (tree, SetStatus, Ask);
 	if(error)
 	{
 		wprintf(L"%s\n", PML_TransError(error));
@@ -168,15 +187,12 @@
 	{
 		int id = PML_FindItem(tree, cmdline[i].c_str());
 
-		cout << i << "<" << cmdline.size() << endl;
-
 		if(id)
 			cout << PML_GetDescription (tree, id) << "\n";
 
 		else 
 			cout << "Could not find the Package \"" << cmdline[i] << "\"\n";
 	}
-		cout << i << "<" << cmdline.size() << endl;
 
 	// clean up
 	PML_CloseTree (tree);

Modified: trunk/rosapps/packmgr/lib/download.cpp
--- trunk/rosapps/packmgr/lib/download.cpp	2005-04-10 16:45:30 UTC (rev 14579)
+++ trunk/rosapps/packmgr/lib/download.cpp	2005-04-10 17:03:40 UTC (rev 14580)
@@ -16,7 +16,7 @@
 #include <wine/urlmon.h>
 
 // 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(      
     LPUNKNOWN pCaller,

Modified: trunk/rosapps/packmgr/lib/tree.cpp
--- trunk/rosapps/packmgr/lib/tree.cpp	2005-04-10 16:45:30 UTC (rev 14579)
+++ trunk/rosapps/packmgr/lib/tree.cpp	2005-04-10 17:03:40 UTC (rev 14580)
@@ -99,7 +99,8 @@
 	// do some manipulation at the parent
 	else
 	{
-		tree->addItem(id, tree->packages[id].name, parents.back(), icon);
+	   if(tree->addItem)
+	       tree->addItem(id, tree->packages[id].name, parents.back(), icon);
 
 	   // list as child in the parent node
 	   tree->packages[parents.back()].children.push_back(id);

Modified: trunk/rosapps/packmgr/tree/mozcontrol.xml
--- trunk/rosapps/packmgr/tree/mozcontrol.xml	2005-04-10 16:45:30 UTC (rev 14579)
+++ trunk/rosapps/packmgr/tree/mozcontrol.xml	2005-04-10 17:03:40 UTC (rev 14580)
@@ -1,7 +1,7 @@
 <package>
-<name>MozillaControl</name>
-<description>Provide the Gekko Engine for ReactOS.</description>
-<scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/>
- 
+  <name>MozillaControl</name>
+  <description>Provide the Gekko Engine for ReactOS.</description>
+  <scripts inst="mozillacontrol.inst.rps" srcinst="mozillacontrol.inst.rps"/>
+  <depent>abiword</depent>
 </package>