summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-29 18:33:34 (UTC)
committer andyq <andyq>2002-10-29 18:33:34 (UTC)
commit45d9a30ec17b5146ffdac8e776003752fe2deeea (patch) (unidiff)
treefeeefaa97320466bd704c3b8253cfa5970616571
parent2c3aa49e64a63f475bd60707c8cc105829691ab1 (diff)
downloadopie-45d9a30ec17b5146ffdac8e776003752fe2deeea.zip
opie-45d9a30ec17b5146ffdac8e776003752fe2deeea.tar.gz
opie-45d9a30ec17b5146ffdac8e776003752fe2deeea.tar.bz2
Removed crap status message after ipkg finishes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 731a336..c762633 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -112,97 +112,98 @@ bool Ipkg :: runIpkg( )
112 // If we are removing packages and make links option is selected 112 // If we are removing packages and make links option is selected
113 // create the links 113 // create the links
114 if ( option == "remove" || option == "reinstall" ) 114 if ( option == "remove" || option == "reinstall" )
115 { 115 {
116 createLinks = false; 116 createLinks = false;
117 if ( flags & MAKE_LINKS ) 117 if ( flags & MAKE_LINKS )
118 { 118 {
119 emit outputText( QString( "Removing symbolic links...\n" ) ); 119 emit outputText( QString( "Removing symbolic links...\n" ) );
120 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); 120 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
121 emit outputText( QString( " " ) ); 121 emit outputText( QString( " " ) );
122 } 122 }
123 } 123 }
124 124
125 emit outputText( cmd ); 125 emit outputText( cmd );
126 126
127 // Execute command 127 // Execute command
128 dependantPackages = new QList<QString>; 128 dependantPackages = new QList<QString>;
129 dependantPackages->setAutoDelete( true ); 129 dependantPackages->setAutoDelete( true );
130 130
131 ret = executeIpkgCommand( cmd, option ); 131 ret = executeIpkgCommand( cmd, option );
132 132
133 if ( option == "install" || option == "reinstall" ) 133 if ( option == "install" || option == "reinstall" )
134 { 134 {
135 // If we are not removing packages and make links option is selected 135 // If we are not removing packages and make links option is selected
136 // create the links 136 // create the links
137 createLinks = true; 137 createLinks = true;
138 if ( flags & MAKE_LINKS ) 138 if ( flags & MAKE_LINKS )
139 { 139 {
140 emit outputText( " " ); 140 emit outputText( " " );
141 emit outputText( QString( "Creating symbolic links for " )+ package ); 141 emit outputText( QString( "Creating symbolic links for " )+ package );
142 142
143 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); 143 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
144 144
145 // link dependant packages that were installed with this release 145 // link dependant packages that were installed with this release
146 QString *pkg; 146 QString *pkg;
147 for ( pkg = dependantPackages->first(); pkg != 0; pkg = dependantPackages->next() ) 147 for ( pkg = dependantPackages->first(); pkg != 0; pkg = dependantPackages->next() )
148 { 148 {
149 if ( *pkg == package ) 149 if ( *pkg == package )
150 continue; 150 continue;
151 emit outputText( " " ); 151 emit outputText( " " );
152 emit outputText( QString( "Creating symbolic links for " )+ (*pkg) ); 152 emit outputText( QString( "Creating symbolic links for " )+ (*pkg) );
153 linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); 153 linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir );
154 } 154 }
155 } 155 }
156 } 156 }
157 157
158 delete dependantPackages; 158 delete dependantPackages;
159 159
160 emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") ); 160// emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") );
161 emit outputText( "Finished" );
161 emit outputText( "" ); 162 emit outputText( "" );
162 return ret; 163 return ret;
163} 164}
164 165
165 166
166int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) 167int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
167{ 168{
168 FILE *fp = NULL; 169 FILE *fp = NULL;
169 char line[130]; 170 char line[130];
170 QString lineStr, lineStrOld; 171 QString lineStr, lineStrOld;
171 int ret = false; 172 int ret = false;
172 173
173 fp = popen( (const char *) cmd, "r"); 174 fp = popen( (const char *) cmd, "r");
174 if ( fp == NULL ) 175 if ( fp == NULL )
175 { 176 {
176 cout << "Couldn't execute " << cmd << "! err = " << fp << endl; 177 cout << "Couldn't execute " << cmd << "! err = " << fp << endl;
177 QString text; 178 QString text;
178 text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd ); 179 text.sprintf( "Couldn't execute %s! See stdout for error code", (const char *)cmd );
179 emit outputText( text ); 180 emit outputText( text );
180 } 181 }
181 else 182 else
182 { 183 {
183 while ( fgets( line, sizeof line, fp) != NULL ) 184 while ( fgets( line, sizeof line, fp) != NULL )
184 { 185 {
185 lineStr = line; 186 lineStr = line;
186 lineStr=lineStr.left( lineStr.length()-1 ); 187 lineStr=lineStr.left( lineStr.length()-1 );
187 188
188 if ( lineStr != lineStrOld ) 189 if ( lineStr != lineStrOld )
189 { 190 {
190 //See if we're finished 191 //See if we're finished
191 if ( option == "install" || option == "reinstall" ) 192 if ( option == "install" || option == "reinstall" )
192 { 193 {
193 // Need to keep track of any dependant packages that get installed 194 // Need to keep track of any dependant packages that get installed
194 // so that we can create links to them as necessary 195 // so that we can create links to them as necessary
195 if ( lineStr.startsWith( "Installing " ) ) 196 if ( lineStr.startsWith( "Installing " ) )
196 { 197 {
197 int start = lineStr.find( " " ) + 1; 198 int start = lineStr.find( " " ) + 1;
198 int end = lineStr.find( " ", start ); 199 int end = lineStr.find( " ", start );
199 QString *package = new QString( lineStr.mid( start, end-start ) ); 200 QString *package = new QString( lineStr.mid( start, end-start ) );
200 dependantPackages->append( package ); 201 dependantPackages->append( package );
201 } 202 }
202 } 203 }
203 204
204 if ( option == "update" ) 205 if ( option == "update" )
205 { 206 {
206 if (lineStr.contains("Updated list")) 207 if (lineStr.contains("Updated list"))
207 ret = true; 208 ret = true;
208 } 209 }