Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Fix an issue with pc-fbsdupdatecheck and the Updater GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Moore committed Sep 5, 2013
1 parent 04630fb commit d47ba25
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src-qt4/pc-updategui/mainWin.cpp
Expand Up @@ -552,11 +552,11 @@ void mainWin::checkFBSDUpdates() {
// Now check if there are freebsd-updates to install
QProcess f;
if ( wDir.isEmpty() )
f.start(QString("pc-fbsdupdatecheck"), QStringList());
f.start(QString("pc-fbsdupdatecheck"), QStringList() << "update" );
else {
QProcess::execute("cp /usr/local/bin/pc-fbsdupdatecheck " + wDir + "/tmp/.fbupdatechk");
QProcess::execute("chmod 755 " + wDir + "/tmp/.fbupdatechk");
f.start(QString("chroot"), QStringList() << wDir << "/tmp/.fbupdatechk" << "fetch" );
f.start(QString("chroot"), QStringList() << wDir << "/tmp/.fbupdatechk" << "update" );
}
while(f.state() == QProcess::Starting || f.state() == QProcess::Running)
QCoreApplication::processEvents();
Expand Down
25 changes: 19 additions & 6 deletions src-sh/pc-fbsdupdatecheck/main.c
Expand Up @@ -6,11 +6,24 @@
#include <string.h>
#include <unistd.h>

int main()
int main(int argc, char ** argv)
{
system("touch /tmp/.fbsdup-lock");
system("mkdir /var/db/freebsd-update-check 2>/dev/null");
system("cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch' '-d' '/var/db/freebsd-update-check'");
system("rm /tmp/.fbsdup-lock");
return 0;
if ( argc == 2 ) {
if ( strcmp(argv[1], "update") != 0 )
{
printf("Invalid option!");
return 1;
}
// Fetch to the standard working-dir
system("touch /tmp/.fbsdup-lock");
system("cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch'");
system("rm /tmp/.fbsdup-lock");
return 0;
} else {
system("touch /tmp/.fbsdup-lock");
system("mkdir /var/db/freebsd-update-check 2>/dev/null");
system("cat /usr/sbin/freebsd-update | sed 's|! -t 0|-z '1'|g' | /bin/sh -s 'fetch' '-d' '/var/db/freebsd-update-check'");
system("rm /tmp/.fbsdup-lock");
return 0;
}
}

0 comments on commit d47ba25

Please sign in to comment.