Commit 9a34ebd5f70096ec14dcab67b5af6cae3007ac15
1 parent
4c6e9533
Exists in
master
and in
29 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,7 +5,7 @@ | ||
5 | VAGRANTFILE_API_VERSION = "2" | 5 | VAGRANTFILE_API_VERSION = "2" |
6 | 6 | ||
7 | require 'fileutils' | 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 | if debs.empty? | 9 | if debs.empty? |
10 | puts "W: no debs built in ../../pkg/; will either install existing local" | 10 | puts "W: no debs built in ../../pkg/; will either install existing local" |
11 | puts " ones, or the ones from the remote repository" | 11 | puts " ones, or the ones from the remote repository" |
@@ -16,7 +16,7 @@ else | @@ -16,7 +16,7 @@ else | ||
16 | 16 | ||
17 | local_debs.delete(fn) | 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 | FileUtils::Verbose.rm_f(fn) | 20 | FileUtils::Verbose.rm_f(fn) |
21 | FileUtils::Verbose.ln f, '.' | 21 | FileUtils::Verbose.ln f, '.' |
22 | end | 22 | end |