← Back to team overview

mudlet-makers team mailing list archive

[Bug 1187176] [NEW] uninstallPackage() can fail to return

 

Public bug reported:

uninstallPackage() can fail to return and none of the code after it will
be run. Perhaps there is an error that happens that is not reported by
Mudlet anywhere.  The following code, which accounts for this error:

function svo_doupdate_click()
  svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Updating Svo...<p>]])
  svo.doupdatelabel:hide()
  svo.dontupdatelabel:hide()

  local name = svo.me.name

  if not (uninstallPackage and installPackage) then
    svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Can't update your Svo. You didn't update to Mudlet 2.1, and your current Mudlet lacks the features necessary. Go update first please.<p>]])
    return
  end

  if not io.exists(getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name)) then
    svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Hm, can't update Svo - seems the new system we downloaded dissapeared. Do 'vupdate force' to download it again.<p>]])
    return
  end

  function svo_update_system()
    svo_updating_system = "uninstalling"
    uninstallPackage(name.." svo")

    svo_updating_system = "installing"
    svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Uninstalled the old Svo, installing the new one now...<p>]])
    installPackage(getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name))

    svo_updating_system = nil
    svo.echof("Svo updated! Restart Mudlet, and you'll be all done. You can find the changelog on svo.vadisystems.com.")

    svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Svo updated!<br><br>Restart Mudlet, and you'll be all done.<p>]])
    svo.updatelabel:setStyleSheet([[
        margin: 0px;
        padding: 2px;

        /* Vertical gradient */
        background: qlineargradient(
            x1: 0, y1: 0, x2: 0, y2: 1,
            stop: 0 #3c3c3c, stop: 1 #232323
        );

        border: none;
        border-radius: 4px;

        color: #ffffff;

      qproperty-alignment: 'AlignVCenter | AlignHCenter';
      qproperty-wordWrap: true;
      font-family: 'Ubuntu','Calibri',serif;
    ]])
  end

  svo_updating_system = "started"
  tempTimer(10, function()
    if not svo_updating_system then return end

    if svo_updating_system == "uninstalling" then
      svo.updatelabel:echo([[<p align="center" style="font-size:8pt; color:white">Hm, seems the update got stuck on the uninstallPackage() function. Try uninstalling Svo from the Package Manager and then installing it from the zip (found in ]].. getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name) ..[[) to upgrade now.<p>]])
    elseif svo_updating_system == "installing" then
      svo.updatelabel:echo([[<p align="center" style="font-size:8pt; color:white">Hm, seems the update got stuck on the installPackage() function. Old Svo is uninstalled, but it the new one didn't get installed - install your Svo zip (found in ]].. getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name) ..[[ via the Package Manager.<p>]])
    end
  end)
  svo_update_system()
end

still has issues that people experience:

Also this is the issue - Hm, seems the update got stuck on the uninstallPackage()function.
 Try uninstalling Svo from the package manager and then reinstalling it from the zip (found in 
C:blahblah) to upgrade now.

** Affects: mudlet
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Mudlet
Makers, which is subscribed to Mudlet.
https://bugs.launchpad.net/bugs/1187176

Title:
  uninstallPackage() can fail to return

Status in Mudlet the MUD client:
  New

Bug description:
  uninstallPackage() can fail to return and none of the code after it
  will be run. Perhaps there is an error that happens that is not
  reported by Mudlet anywhere.  The following code, which accounts for
  this error:

  function svo_doupdate_click()
    svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Updating Svo...<p>]])
    svo.doupdatelabel:hide()
    svo.dontupdatelabel:hide()

    local name = svo.me.name

    if not (uninstallPackage and installPackage) then
      svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Can't update your Svo. You didn't update to Mudlet 2.1, and your current Mudlet lacks the features necessary. Go update first please.<p>]])
      return
    end

    if not io.exists(getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name)) then
      svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Hm, can't update Svo - seems the new system we downloaded dissapeared. Do 'vupdate force' to download it again.<p>]])
      return
    end

    function svo_update_system()
      svo_updating_system = "uninstalling"
      uninstallPackage(name.." svo")

      svo_updating_system = "installing"
      svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Uninstalled the old Svo, installing the new one now...<p>]])
      installPackage(getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name))

      svo_updating_system = nil
      svo.echof("Svo updated! Restart Mudlet, and you'll be all done. You can find the changelog on svo.vadisystems.com.")

      svo.updatelabel:echo([[<p align="center" style="font-size:10pt; color:white">Svo updated!<br><br>Restart Mudlet, and you'll be all done.<p>]])
      svo.updatelabel:setStyleSheet([[
          margin: 0px;
          padding: 2px;

          /* Vertical gradient */
          background: qlineargradient(
              x1: 0, y1: 0, x2: 0, y2: 1,
              stop: 0 #3c3c3c, stop: 1 #232323
          );

          border: none;
          border-radius: 4px;

          color: #ffffff;

        qproperty-alignment: 'AlignVCenter | AlignHCenter';
        qproperty-wordWrap: true;
        font-family: 'Ubuntu','Calibri',serif;
      ]])
    end

    svo_updating_system = "started"
    tempTimer(10, function()
      if not svo_updating_system then return end

      if svo_updating_system == "uninstalling" then
        svo.updatelabel:echo([[<p align="center" style="font-size:8pt; color:white">Hm, seems the update got stuck on the uninstallPackage() function. Try uninstalling Svo from the Package Manager and then installing it from the zip (found in ]].. getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name) ..[[) to upgrade now.<p>]])
      elseif svo_updating_system == "installing" then
        svo.updatelabel:echo([[<p align="center" style="font-size:8pt; color:white">Hm, seems the update got stuck on the installPackage() function. Old Svo is uninstalled, but it the new one didn't get installed - install your Svo zip (found in ]].. getMudletHomeDir().."/svo/downloads/"..string.format("%s svo.zip", svo.me.name) ..[[ via the Package Manager.<p>]])
      end
    end)
    svo_update_system()
  end

  still has issues that people experience:

  Also this is the issue - Hm, seems the update got stuck on the uninstallPackage()function.
   Try uninstalling Svo from the package manager and then reinstalling it from the zip (found in 
  C:blahblah) to upgrade now.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mudlet/+bug/1187176/+subscriptions


Follow ups

References