rodjek / librarian-puppet

http://librarian-puppet.com
MIT License
693 stars 209 forks source link

update fails after librarian-puppet package #322

Closed dfreudenberger closed 7 years ago

dfreudenberger commented 9 years ago

Hi there,

after running librarian-puppet package calling librarian-puppet update fails with following message /home/df/librarian-test/vendor/puppet/source/75d83f44da1cbe5af07c437726bc6dfbe5e08d5a.tar.gz already exists; not overwritten.

Unfortunately I'm not 100% sure whats going on but it seems like https://github.com/rodjek/librarian-puppet/blob/master/lib/librarian/puppet/source/git.rb#L28 does not detect the cached version because self.sha is nil until https://github.com/rodjek/librarian-puppet/blob/master/lib/librarian/puppet/source/git.rb#L35 was called. As far as I can tell this happens only for modules defined as

mod 'foo-foo',
  :git => "git://github.com/foo/bar.git",
  :ref => 'some-branch'

Our workaround in place is adding the lines below right before https://github.com/rodjek/librarian-puppet/blob/master/lib/librarian/puppet/source/git.rb#L28

unless sha
   repository_update_once!
   self.sha = fetch_sha_memo
end

If you need any help / information, just let me know and I'll happily assist.

carlossg commented 9 years ago

can you create a PR ?

dfreudenberger commented 9 years ago

i could but i'm pretty sure the actual issue is something else and I'd prefer to have someone taking a look at the issue who has a deeper knowledge of the existing codebase.