Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onfluent-platform: fix confluent-platform cli #50592

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 22 additions & 0 deletions Formula/confluent-platform.rb
Expand Up @@ -11,14 +11,36 @@ class ConfluentPlatform < Formula

conflicts_with "kafka", :because => "kafka also ships with identically named Kafka related executables"

patch :DATA
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this been reported upstream? This needs a comment and a link to an upstream issue at a minimum and description of when it should be removed or how it should be updated. In an ideal world, upstream would accept the fix and we would use a patch do block to grab the patch from github.


def install
prefix.install "bin"
rm_rf "#{bin}/windows"
prefix.install "etc"
prefix.install "share"
prefix.install "libexec"
rm_rf "#{libexec}/cli/linux_386"
rm_rf "#{libexec}/cli/linux_amd64"
rm_rf "#{libexec}/cli/windows_386"
rm_rf "#{libexec}/cli/windows_amd64"
end

test do
assert_match version.to_s, shell_output("#{bin}/kafka-broker-api-versions --version")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you improve this test to use some of the functionality of the software? Version tests rarely indicate that something is actually wrong. And especially if you're going to patch something we need a test.

end
end
__END__
diff --git a/bin/confluent b/bin/confluent
index 1247e4f..fadbb8d 100755
--- a/bin/confluent
+++ b/bin/confluent
@@ -184,7 +184,8 @@ BINARY=confluent
OS=$(uname_os)
ARCH=$(uname_arch)
PREFIX="${OWNER}/${REPO}"
-EXE_PATH="${BASH_SOURCE%/*}/../libexec/cli"
+SELF=$(realpath "${BASH_SOURCE}")
+EXE_PATH="${SELF%/*}/../libexec/cli"
PLATFORM="${OS}/${ARCH}"

# use in logging routines