Question

Is there any way how I can automatically check for available Magento extension updates on the CLI? I thought about the mage tool as well as about n98-magerun, but both options do not seem to work.

With mage:

./mage install
./mage list-upgrades

Tells me No upgrades available, although updates are available. Maybe this is because I use a modman environment and mage does not like symlinks? Or do I use it in a wrong way or do I have wrong expectations?

n98-magerun does not seem to have such an option at all.

I would love to have an output similar to that one:

Namespace1_Extension1: no update available
Namespace1_Extension2: installed version: 1.0.0 ; available version: 1.1.0
...

I would expect this to work with extensions from Magento Connect, but it would be cool if it also worked with extensions from GitHub (difficult, but possible: get GitHub link from README, and check GitHub page for the current version).

Edit: Since it is rather bad practice to install via MC manager, the solution should also work for extensions which have been installed manually.

Was it helpful?

Solution 2

Okay I digged into that problem a bit. What the mage tool will do is to use the information from the var/package folder. So if you manually install your extensions and want to automatically check for upgrades with the mage tool, you have to put the respective XML file under var/package. This file can be found in each package you manually download from Magento Connect. It is normally called package.xml. You should rename it so that it matches the format Namespace_Extension-1.0.0.xml and then put it into the var/package folder. If you have done that, the mage tool will find the available upgrades for this extension if you run (thanks to @alternize):

./mage clear-cache
./mage mage-setup .
./mage sync --force
./mage sync-pear --force
./mage list-upgrades

Mind that you have to update the content and the filename of the respective XML file each time you manually upgrade the extension.

There does not seem to be any solution to automatically check for extensions which are only available on GitHub.

OTHER TIPS

this works for me as expected:

[test@server1 shop]$ ./mage clear-cache
[test@server1 shop]$ ./mage mage-setup .
Running initial setup...
Success
Success
Successfully added: http://connect20.magentocommerce.com/community
[test@server1 shop]$ ./mage config-set preferred_state beta
Success
[test@server1 shop]$ ./mage sync --force
Successfully added: community/Blah_Bleh-1.0.0
Successfully added: community/Foo_Bar-2.0.0
... (truncated for brevity)
[test@server1 shop]$ ./mage sync-pear --force
[test@server1 shop]$ ./mage list-upgrades
Updates for community:
  Biebersdorf_CustomerOrderComment: 0.1.3 => 0.1.5
  magento_easy_lightbox: 1.0.1 => 2.0.1

note: clearing the cache (./mage clear-cache) and re-syncing (./mage sync --force) are only needed if you do not get any results otherwise. also, you might want to use different values for preferred_state, you can get the list of available states by issuing ./mage config-help preferred_state

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top