summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/ipkg.cpp
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 6d0edad..02d4258 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -41,7 +41,7 @@ Ipkg :: ~Ipkg()
41{ 41{
42} 42}
43 43
44// Option is what we are going to do - install, upgrade, download 44// Option is what we are going to do - install, upgrade, download, reinstall
45// package is the package name to install - either a fully qualified path and ipk 45// package is the package name to install - either a fully qualified path and ipk
46// file (if stored locally) or just the name of the package (for a network package) 46// file (if stored locally) or just the name of the package (for a network package)
47// packageName is the package name - (for a network package this will be the same as 47// packageName is the package name - (for a network package this will be the same as
@@ -89,7 +89,6 @@ bool Ipkg :: runIpkg( )
89 if ( destDir == "/" ) 89 if ( destDir == "/" )
90 flags ^= MAKE_LINKS; 90 flags ^= MAKE_LINKS;
91 } 91 }
92
93 } 92 }
94 93
95#ifdef X86 94#ifdef X86
@@ -97,16 +96,23 @@ bool Ipkg :: runIpkg( )
97 cmd += IPKG_CONF; 96 cmd += IPKG_CONF;
98#endif 97#endif
99 98
99
100 if ( option == "reinstall" )
101 cmd += " install";
102 else
100 cmd += " " + option; 103 cmd += " " + option;
101 if ( option != "upgrade" ) 104 if ( option != "upgrade" )
102 cmd += " " + package; 105 cmd += " " + package;
103 cmd += " 2>&1"; 106 cmd += " 2>&1";
104 107
108
109 emit outputText( QString( "Dealing with package " ) + package );
110
105 qApp->processEvents(); 111 qApp->processEvents();
106 112
107 // If we are removing packages and make links option is selected 113 // If we are removing packages and make links option is selected
108 // create the links 114 // create the links
109 if ( option == "remove" ) 115 if ( option == "remove" || option == "reinstall" )
110 { 116 {
111 createLinks = false; 117 createLinks = false;
112 if ( flags & MAKE_LINKS ) 118 if ( flags & MAKE_LINKS )
@@ -125,7 +131,7 @@ bool Ipkg :: runIpkg( )
125 131
126 ret = executeIpkgCommand( cmd, option ); 132 ret = executeIpkgCommand( cmd, option );
127 133
128 if ( option == "install" ) 134 if ( option == "install" || option == "reinstall" )
129 { 135 {
130 // If we are not removing packages and make links option is selected 136 // If we are not removing packages and make links option is selected
131 // create the links 137 // create the links
@@ -153,6 +159,7 @@ bool Ipkg :: runIpkg( )
153 delete dependantPackages; 159 delete dependantPackages;
154 160
155 emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") ); 161 emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") );
162 emit outputText( "" );
156 return ret; 163 return ret;
157} 164}
158 165
@@ -182,7 +189,7 @@ int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
182 if ( lineStr != lineStrOld ) 189 if ( lineStr != lineStrOld )
183 { 190 {
184 //See if we're finished 191 //See if we're finished
185 if ( option == "install" ) 192 if ( option == "install" || option == "reinstall" )
186 { 193 {
187 // Need to keep track of any dependant packages that get installed 194 // Need to keep track of any dependant packages that get installed
188 // so that we can create links to them as necessary 195 // so that we can create links to them as necessary
@@ -242,11 +249,11 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des
242 QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list"; 249 QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list";
243 QFile f( packageFileDir ); 250 QFile f( packageFileDir );
244 251
245 cout << "Try to open " << packageFileDir.latin1() << endl; 252 cout << "Try to open " << packageFileDir << endl;
246 if ( !f.open(IO_ReadOnly) ) 253 if ( !f.open(IO_ReadOnly) )
247 { 254 {
248 // Couldn't open from dest, try from / 255 // Couldn't open from dest, try from /
249// cout << "Could not open:" << packageFileDir << endl; 256 cout << "Could not open:" << packageFileDir << endl;
250 f.close(); 257 f.close();
251 258
252 packageFileDir = "/usr/lib/ipkg/info/"+packageFilename+".list"; 259 packageFileDir = "/usr/lib/ipkg/info/"+packageFilename+".list";