tpkg / client

tpkg client code
MIT License
5 stars 7 forks source link

Bug fix: Preventing infinite loop after installing a native dependency package. #38

Closed jaeheung90 closed 11 years ago

jaeheung90 commented 11 years ago

Currently "tpkg --upgrade" falls in an infinite loop after installing a native dependency package.

This can happen when a new version of a tpkg package introduces a new native dependency. Then, the first upgrade attempt always gets stuck. The second attempt will succeed since the required native package was installed during the first attempt. However, this gets worse if the first attempt was made from a daemon(e.g. Etch), which will continue to run calculating the tpkg checksum(hash) over and over again wasting significant CPU time.

It is caused by a lack of update of @available_native_packages after installing a native package. installed_packages_that_meet_requirement( ) at line 4092 returns nil for the native package even after its installation, and the tpkg being upgraded is pushed back to the queue again and again by line 4096 making an infinite loop.

This can be avoided by simply deleting the native package data from @available_native_packages after installing it and let the data reloaded when queried.

Jae Park

jheiss commented 11 years ago

Thanks!