Commit 9a34ebd5f70096ec14dcab67b5af6cae3007ac15
1 parent
4c6e9533
Exists in
staging
and in
42 other branches
util/debian-install: fix logic for copying .debs
- make the code independent of the number of packages - cope with a clean environment, where there is no local copies yet.
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
util/debian-install/Vagrantfile
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | VAGRANTFILE_API_VERSION = "2" |
| 6 | 6 | |
| 7 | 7 | require 'fileutils' |
| 8 | -debs = `find ../../pkg/ -name '*.deb' | sort -t _ -V | tail -2`.split | |
| 8 | +debs = `find ../../pkg/ -name '*.deb' | sort -t _ -V`.split | |
| 9 | 9 | if debs.empty? |
| 10 | 10 | puts "W: no debs built in ../../pkg/; will either install existing local" |
| 11 | 11 | puts " ones, or the ones from the remote repository" |
| ... | ... | @@ -16,7 +16,7 @@ else |
| 16 | 16 | |
| 17 | 17 | local_debs.delete(fn) |
| 18 | 18 | |
| 19 | - if File.stat(f) != File.stat(fn) | |
| 19 | + if !File.exist?(fn) || File.stat(f) != File.stat(fn) | |
| 20 | 20 | FileUtils::Verbose.rm_f(fn) |
| 21 | 21 | FileUtils::Verbose.ln f, '.' |
| 22 | 22 | end | ... | ... |