Posts Tagged ‘pirum’
Building PEAR packages
Lets suppose you are learning to build PEAR packages (Pirum is a very nice PEAR channel server btw). You managed to create and publish the initial version of the package and it even installed just fine after you ‘pear install’-ed it.
Then you fixed a bug in the source, increased the version number in package.xml, built and published the next version. The new version is listed at the Pirum generated page.
- But ‘pear upgrade channel/Package’ does not ugprade to newest version.
- Forcing upgrade with -f does not help either.
- Uninstalling and reinstalling the package still gets the previous version.
- channel-update does not help.
- After uninstalling the package, removing the source from Pirum, regenerating the index and trying to reinstall you get a nice error stating that this version does not exist at the server.
I was really puzzled by all that. Then I discovered the reason – by looking at pear configuration.
$ pear config-get cache_ttl
3600
Channel contents are cached for that many seconds (3600 = 1 hour). The solution is to either reduce this number, or – preferrably – nuke the cache by
$ pear cache-clear
After this your package will upgrade just fine ;)
Its very logical to cache this information of course to avoid killing package servers and I feel really stupid for not figuring it out earlier.