ianmiell / shutit

Automation framework for programmers
http://ianmiell.github.io/shutit/
MIT License
2.15k stars 110 forks source link

apt-get update is called twice #191

Closed marcelloromani closed 9 years ago

marcelloromani commented 9 years ago

apt-get update is called once in get_distro_info() https://github.com/ianmiell/shutit/blob/master/shutit_global.py#L1771

and then in setup.py, setup module: https://github.com/ianmiell/shutit/blob/master/setup.py#L534 https://github.com/ianmiell/shutit/blob/master/setup.py#L547 https://github.com/ianmiell/shutit/blob/master/setup.py#L548

I think the call in setup:build() is triggered do_update being yes by default: https://github.com/ianmiell/shutit/blob/master/util.py#L135 changin it to no fixed the issue.

ianmiell commented 9 years ago

I pondered this for a while and did something simpler - if we call apt-get update in the build then we switch off do_update. I'm not sure this is perfect but seems good enough and passes testing.

marcelloromani commented 9 years ago

It could be convenient to add some sort of "update packages" api to ShutIt, which would take care of remembering if we already called it and manage the commands for the specific target type (i.e. apt and yum).

Just a thought. I might draft something myself if I have time.