conjur-debify 1.10.2 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/conjur/fpm/debify_utils.sh +21 -0
- data/lib/conjur/fpm/package.sh +1 -2
- data/spec/debify_utils_spec.rb +55 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5d37eadc9ebb56259a7a9fbb811761eb4d9a4210b664b450e5ddcb51e3f5eeb
|
4
|
+
data.tar.gz: 88611983be2c6a1726b54ffac032f95ab3966e3d7cef57e50504fd3c781fce54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be770ae77cf5e80478fb77137b90394086d3bbede9a0d15a61b64b636a6c43ca8e1711e69d7033deb12f0ed13f9609c5c13d1eab4ececfc7a89163a530aa2d7
|
7
|
+
data.tar.gz: 925471e67b930d1fab9cba2484706bea504357fc3dead42cb6c3b2136036cf4ece73092b640b8fef70abf46b84bb7908f0f2189ebef0994171abc06f21d57e32
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.10.
|
1
|
+
1.10.3
|
@@ -9,3 +9,24 @@ function bundle_clean() {
|
|
9
9
|
rm -rf vendor/bundle/ruby/${ruby_version}/gems/*/{test,spec,examples,example,contrib,doc,ext,sample}
|
10
10
|
fi
|
11
11
|
}
|
12
|
+
|
13
|
+
# Remove files from the current directory that also exist in another given
|
14
|
+
# directory. For example, say in the current directory there is:
|
15
|
+
# foo
|
16
|
+
# bar/baz
|
17
|
+
# bar/xyzzy
|
18
|
+
# bacon
|
19
|
+
# people/phlebas
|
20
|
+
# and in dir2 there is
|
21
|
+
# bacon
|
22
|
+
# alice
|
23
|
+
# people/phlebas
|
24
|
+
# bar/xyzzy
|
25
|
+
# then after running `remove_matching dir2` current directory will be left with only:
|
26
|
+
# foo
|
27
|
+
# bar/baz
|
28
|
+
# Note it probably isn't 100% fool-proof, so don't launch it out to space or something.
|
29
|
+
function remove_matching() {
|
30
|
+
find "$1" -type f -print0 | sed -ze "s@^$1@.@" | xargs -0 rm -f
|
31
|
+
find . -type d -empty -delete
|
32
|
+
}
|
data/lib/conjur/fpm/package.sh
CHANGED
@@ -28,8 +28,7 @@ bundle --without development test
|
|
28
28
|
bundle clean
|
29
29
|
cp /usr/local/bundle/config .bundle/config # bundler for some reason stores config there...
|
30
30
|
cd /dev-pkg
|
31
|
-
|
32
|
-
find . -type d -empty -delete
|
31
|
+
remove_matching $prefix
|
33
32
|
bundle_clean
|
34
33
|
|
35
34
|
if [ `ls | wc -l` -eq 0 ]; then
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'aruba/rspec'
|
3
|
+
|
4
|
+
Aruba.configure do |c|
|
5
|
+
c.activate_announcer_on_command_failure = %i(stderr stdout)
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "remove_matching()", type: :aruba do
|
9
|
+
it "removes matching files" do
|
10
|
+
here %w(foo bar/baz bar/xyzzy zork)
|
11
|
+
there %w(foo bar/baz not)
|
12
|
+
remove_matching
|
13
|
+
expect(contents_of herepath).to match_array %w(zork bar bar/xyzzy)
|
14
|
+
end
|
15
|
+
|
16
|
+
it "also handles files with spaces in names" do
|
17
|
+
here ['foo', 'bar/baz', 'with space', 'with', 'bar/another space']
|
18
|
+
there ['with space', 'bar/another space here']
|
19
|
+
remove_matching
|
20
|
+
expect(contents_of herepath).to match_array ['foo', 'bar', 'bar/baz', 'with', 'bar/another space']
|
21
|
+
end
|
22
|
+
|
23
|
+
# auxiliary methods and setup
|
24
|
+
let(:herepath) { Pathname.new Dir.mktmpdir }
|
25
|
+
let(:therepath) { Pathname.new Dir.mktmpdir }
|
26
|
+
after { [herepath, therepath].each &FileUtils.method(:remove_entry) }
|
27
|
+
|
28
|
+
def contents_of dir
|
29
|
+
Dir.chdir(dir) { Dir['**/*'] }
|
30
|
+
end
|
31
|
+
|
32
|
+
def remove_matching
|
33
|
+
run_simple "bash -c 'source #{DEBIFY_UTILS_PATH}; cd #{herepath}; remove_matching #{therepath}'"
|
34
|
+
end
|
35
|
+
|
36
|
+
def here files
|
37
|
+
mkfiles herepath, files
|
38
|
+
end
|
39
|
+
|
40
|
+
def there files
|
41
|
+
mkfiles therepath, files
|
42
|
+
end
|
43
|
+
|
44
|
+
def mkfiles dir, files
|
45
|
+
return dir if files.empty?
|
46
|
+
files.each do |path|
|
47
|
+
fullpath = dir + path
|
48
|
+
FileUtils.makedirs fullpath.dirname
|
49
|
+
FileUtils.touch fullpath
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
DEBIFY_UTILS_PATH = File.expand_path '../../lib/conjur/fpm/debify_utils.sh', __FILE__
|
54
|
+
end
|
55
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-debify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -224,6 +224,7 @@ files:
|
|
224
224
|
- spec/action/publish_spec.rb
|
225
225
|
- spec/data/Makefile
|
226
226
|
- spec/data/test.tar
|
227
|
+
- spec/debify_utils_spec.rb
|
227
228
|
- spec/spec_helper.rb
|
228
229
|
- spec/utils_spec.rb
|
229
230
|
- tag-image.sh
|
@@ -264,5 +265,6 @@ test_files:
|
|
264
265
|
- spec/action/publish_spec.rb
|
265
266
|
- spec/data/Makefile
|
266
267
|
- spec/data/test.tar
|
268
|
+
- spec/debify_utils_spec.rb
|
267
269
|
- spec/spec_helper.rb
|
268
270
|
- spec/utils_spec.rb
|