Skip to content

Commit 38bfd40

Browse files
committed
Merge pull request #144 from RallySoftware-cookbooks/Issue-134
Issue #134 Remove /var/lib/alternatives/#{cmd} before calling alternatives.
2 parents 0c6294a + 7cbe5eb commit 38bfd40

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

providers/alternatives.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
description = "Add alternative for #{cmd}"
3939
converge_by(description) do
4040
Chef::Log.debug "Adding alternative for #{cmd}"
41+
shell_out("rm /var/lib/alternatives/#{cmd}")
4142
install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}")
4243
unless install_cmd.exitstatus == 0
4344
Chef::Application.fatal!(%Q[ set alternative failed ])

test/integration/openjdk-7/bats/verify_openjdk-7.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
run test -d $JAVA_HOME
88
[ "$status" -eq 0 ]
99
}
10+
11+
@test "properly links jar" {
12+
run test -L /usr/bin/jar
13+
[ "$status" -eq 0 ]
14+
}

test/integration/openjdk/bats/verify_openjdk.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
run test -d $JAVA_HOME
88
[ "$status" -eq 0 ]
99
}
10+
11+
@test "properly links jar" {
12+
run test -L /usr/bin/jar
13+
[ "$status" -eq 0 ]
14+
}

test/integration/oracle-7/bats/verify_oracle-7.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
run test -d $JAVA_HOME
88
[ "$status" -eq 0 ]
99
}
10+
11+
@test "properly links jar" {
12+
run test -L /usr/bin/jar
13+
[ "$status" -eq 0 ]
14+
}

test/integration/oracle/bats/verify_oracle.bats

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
run test -d $JAVA_HOME
88
[ "$status" -eq 0 ]
99
}
10+
11+
@test "properly links jar" {
12+
run test -L /usr/bin/jar
13+
[ "$status" -eq 0 ]
14+
}

0 commit comments

Comments
 (0)