# HG changeset patch # User Andre Heinecke # Date 1411737959 -7200 # Node ID 8bfbfd4ea568b486b08fe4e92dda5c7f9392cbb1 # Parent 82792b3a16bd1ac4656bf7505b5c1ecb53454baa# Parent 8ceaa189570df2371e93fae45a022153b67cf4a0 Merge diff -r 8ceaa189570d -r 8bfbfd4ea568 packaging/linux-installer.inc --- a/packaging/linux-installer.inc Fri Sep 26 11:31:12 2014 +0200 +++ b/packaging/linux-installer.inc Fri Sep 26 15:25:59 2014 +0200 @@ -73,7 +73,7 @@ parse_args() { OPTS=`getopt \ - -l uninstall,update,show-after-update,force,help,prefix:,system,version \ + -l uninstall,update,force,help,prefix:,system,version \ -o d,f,p:,s -n "$ME" -- "$@"` [ $? -eq 0 ] || usage 23 @@ -155,6 +155,10 @@ # $lock_dir is generate by the shar temp_dirs+=("${instcfg[PREFIX]}/$lock_dir") fi + if [ "${TMPEXTRACT_DIR:-}" ]; then + temp_dirs+=("$TMPEXTRACT_DIR") + fi + if [ "${lock_dir:-}" ]; then temp_dirs+=("$extra_bin_path") fi @@ -324,7 +328,15 @@ getxt "unpacking files ...\n" OLDWD="$PWD" -cd "${instcfg[PREFIX]}" + +if [ $UPDATE -eq 1 ]; then + # Trustbridge might be running. Install into temporary dir + # and move the directory into the installation prefix afterwards + TMPEXTRACT_DIR=$(mktemp -d) + cd "$TMPEXTRACT_DIR" +else + cd "${instcfg[PREFIX]}" +fi set +u set -- '-c' @@ -333,6 +345,11 @@ ###SHAR### # ---------------------------------------------------------------------- +if [ $UPDATE -eq 1 ]; then + cp -fr "$TMPEXTRACT_DIR/bin" "${instcfg[PREFIX]}" + cp -fr "$TMPEXTRACT_DIR/share" "${instcfg[PREFIX]}" +fi + cd "$OLDWD" getxt "Preparing trustbridge-tray-starter ...\n" diff -r 8ceaa189570d -r 8bfbfd4ea568 ui/mainwindow.cpp --- a/ui/mainwindow.cpp Fri Sep 26 11:31:12 2014 +0200 +++ b/ui/mainwindow.cpp Fri Sep 26 15:25:59 2014 +0200 @@ -438,6 +438,11 @@ sudoParams << parameters; updaterProcess->setArguments(sudoParams); +#if 0 + updaterProcess->setStandardErrorFile("/tmp/tb-inst-err.log"); + updaterProcess->setStandardOutputFile("/tmp/tb-inst-out.log"); +#endif + foreach (const QString &sProg, sudoPrograms) { qDebug() << "Starting process " << sProg <<" params: " << sudoParams; updaterProcess->setProgram(sProg); @@ -511,31 +516,6 @@ } QDateTime listInstalledLastMod = mSettings.value("List/installedDate").toDateTime(); QDateTime swInstalledLastMod = mSettings.value("Software/installedDate").toDateTime(); - - QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); - - if (swAvailableLastMod.isValid() && swInstalledLastMod.isValid()) { - if (swInstalledLastMod >= swAvailableLastMod) { - qDebug() << "Installed an update: " << swInstalledLastMod << - " available " << swAvailableLastMod; - syslog_info_printf ("Software has been updated to version: %s\n", - QApplication::applicationVersion().toUtf8().constData()); - QString fileName = mSettings.value("Software/available").toString(); - if (fileName.isEmpty()) { - qDebug() << "Software marked as available but no filename set."; - } else { - if (QFile::remove(fileName)) { - qDebug() << "Removed: " << fileName; - } else { - qDebug() << "Failed to remove: " << fileName; - } - } - /* Clear out available data. */ - mSettings.remove("Software/available"); - mSettings.remove("Software/availableDate"); - } - } - QString listResource = QString::fromLatin1(LIST_RESOURCE); QString swResource = QString::fromLatin1(SW_RESOURCE); @@ -608,6 +588,30 @@ void MainWindow::setLastModifiedSWDate(const QDateTime &date) { + QDateTime swAvailableLastMod = mSettings.value("Software/availableDate").toDateTime(); + + if (swAvailableLastMod.isValid() && date.isValid()) { + if (date >= swAvailableLastMod) { + qDebug() << "Installed an update: " << date << + " available was " << swAvailableLastMod; + syslog_info_printf ("Software has been updated to version: %s\n", + QApplication::applicationVersion().toUtf8().constData()); + QString fileName = mSettings.value("Software/available").toString(); + if (fileName.isEmpty()) { + qDebug() << "Software marked as available but no filename set."; + } else { + if (QFile::remove(fileName)) { + qDebug() << "Removed: " << fileName; + } else { + qDebug() << "Failed to remove: " << fileName; + } + } + /* Clear out available data. */ + mSettings.remove("Software/available"); + mSettings.remove("Software/availableDate"); + } + } + mSettings.beginGroup("Software"); #ifdef IS_TAG_BUILD /* We accept an invalid date to force installing any avialable update