         @readme.show()
         @readmeLink.text('Hide README')
 
-    homepage = @pack.homepage
+    homepage = @metadata.homepage
     unless homepage
-      if _.isString(@pack.repository)
-        repoUrl = @pack.repository
+      if _.isString(@metadata.repository)
+        repoUrl = @metadata.repository
       else
-        repoUrl = @pack.repository?.url
+        repoUrl = @metadata.repository?.url
       if repoUrl
         repoUrl = repoUrl.replace(/.git$/, '')
         homepage = repoUrl if require('url').parse(repoUrl).host is 'github.com'

      @updateDefaultAction()
      @updateEnabledState()

    @packageEventEmitter.on 'package-installed package-uninstalled package-upgraded', (error, pack) =>
      if pack?.name is @pack.name
        @defaultAction.enable()
        @updatePackageState()
        @updateDefaultAction()

  togglePackageEnablement: ->
    if @disabled
      config.removeAtKeyPath('core.disabledPackages', @pack.name)
    else
      config.pushAtKeyPath('core.disabledPackages', @pack.name)

  updatePackageState: ->
    @disabled = atom.isPackageDisabled(@pack.name)
    @updateAvailable = false
    @bundled = false
    loadedPackage = atom.getLoadedPackage(@pack.name)
    packagePath = loadedPackage?.path ? atom.resolvePackagePath(@pack.name)
    @installed = packagePath?
    if @installed
      for packageDirPath in config.bundledPackageDirPaths

      if @installed
        if @updateAvailable
          @defaultAction.text('Upgrading\u2026')
          packageManager.install @metadata, (error) =>
            @packageEventEmitter.trigger('package-upgraded', error, @metadata)
        else
          @defaultAction.text('Uninstalling\u2026')
          packageManager.uninstall @metadata, (error) =>
            @packageEventEmitter.trigger('package-uninstalled', error, @metadata)
      else
        @defaultAction.text('Installing\u2026')
        packageManager.install @metadata, (error) =>
          @packageEventEmitter.trigger('package-installed', error, @metadata)

    @updateDefaultAction()

