Permalink
Browse files

Improve the package GUI, if we fail to check for updates, warn the user

  • Loading branch information...
1 parent 9fabf4e commit 1211b751364866851e921f132578086de58b37f2 @kmoore134 kmoore134 committed Nov 15, 2013
Showing with 15 additions and 3 deletions.
  1. +2 −1 src-qt4/pc-pkgmanager/main.cpp
  2. +5 −1 src-qt4/pc-pkgmanager/mainWin.cpp
  3. +8 −1 src-sh/pc-updatemanager/pc-updatemanager
@@ -40,13 +40,14 @@ int main( int argc, char ** argv )
{
QString chkarg = argv[1];
// Running in a chroot
- if ( chkarg == "-chroot" )
+ if ( chkarg == "-chroot" ) {
if( argc == 3 ){
chroot = argv[2];
}else{
qDebug() << "Usage: -chroot <directory>";
exit(1);
}
+ }
}
w.ProgramInit(chroot);
@@ -225,6 +225,9 @@ void mainWin::checkMPKGUpdates() {
while(p.state() == QProcess::Starting || p.state() == QProcess::Running)
QCoreApplication::processEvents();
+ if ( p.exitCode() != 0 )
+ QMessageBox::warning(this, tr("Package Check"), tr("Unable to check for package updates!"));
+
while (p.canReadLine()) {
line = p.readLine().simplified();
qDebug() << line;
@@ -1221,12 +1224,13 @@ QString mainWin::getDelPkgs()
while (*it) {
for (int z=0; z < metaPkgList.count(); ++z)
// See if any packages status have changed
- if ( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(5) == "YES" && (*it)->checkState(0) == Qt::Unchecked )
+ if ( (*it)->text(0) == metaPkgList.at(z).at(0) && metaPkgList.at(z).at(5) == "YES" && (*it)->checkState(0) == Qt::Unchecked ) {
if ( tmp.isEmpty() ){
tmp = (*it)->text(0);
}else{
tmp = tmp + "," + (*it)->text(0);
}
+ }
++it;
}
@@ -552,9 +552,16 @@ is_net_up() {
checkup_pkgs() {
- # Checkout the installed pkgs and compare to master list
+ # Update the repo DB
rc_halt "pkg-static update"
+
pkg-static upgrade -n >/tmp/.pkgData.$$
+ if [ $? -ne 0 ] ; then
+ echo "Error checking for package updates..."
+ exit 1
+ fi
+
+ # Check fr updates now
grep -q "Upgrading" /tmp/.pkgData.$$
if [ $? -ne 0 ] ; then
echo "All packages are up to date!"

0 comments on commit 1211b75

Please sign in to comment.