-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
termsql 0.3 (new formula) #7801
Conversation
|
||
def install | ||
# Replace path to man pages in hard-coded setup.py | ||
new_contents = File.read("setup.py").gsub(%r{\/usr\/share\/man\/man1\/}, man1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done with inreplace
instead, to avoid separate read/writes:
inreplace "setup.py" do |s|
s.gsub! %r{/usr/share/man/man1/}, man1
end
You should also report it upstream (build parameters never hurt 😉)
class Termsql < Formula | ||
desc "Convert text into SQL table and query it" | ||
homepage "https://tobimensch.github.io/termsql/" | ||
url "https://github.com/tobimensch/termsql.git", :using => :git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fine to leave :using => :git
off due to the .git
suffix.
desc "Convert text into SQL table and query it" | ||
homepage "https://tobimensch.github.io/termsql/" | ||
url "https://github.com/tobimensch/termsql.git", :using => :git | ||
version "0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this version coming from? I can't find any tags/releases on upstream.
Thanks for taking the time to contribute @kaeff! I've left some comments for you to look over, let me know if you have any questions. |
Thanks @woodruffw ! I asked @tobimensch about adding a version tag and making the man1 path configurable here: tobimensch/termsql#3 . I've guessed the version from running |
Thanks for raising the issues with upstream. Unfortunately, getting the version from |
How about using the commitish as the version? |
Unfortunately, no. The version should be a stable release put out by upstream. @tobimensch Could you put out either a tag or a full release for |
|
||
def install | ||
# Replace path to man pages in hard-coded setup.py | ||
inreplace "setup.py", %r{/usr/share/man/man1/}, man1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
man1
doesn't have a trailing slash, so this looks sketchy to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be necessary according to the spec (https://docs.python.org/2/distutils/setupscript.html#installing-additional-files), but we can append a slash anyway for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@woodruffw What’s @ilovezfs is saying is that this line replaces something that ends with a slash with something that doesn’t.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bfontaine I think I understood that, I guess I'm not clear on what the problem is. Looking at the file itself:
data_files=[('/usr/share/man/man1/', ['termsql.1.gz'])]
should be changed to something like this:
data_files=[('/usr/local/Cellar/termsql/0.3/share/man/man1', ['termsql.1.gz'])]
There's no trailing slash there, but it shouldn't matter to setup.py
according to the spec above. Please correct me if I'm misunderstanding something!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use "#{man1}/"
here, thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@woodruffw Thanks, that’s clear. I didn’t look at the file itself and thought we might replace e.g. "/usr/share/man/man1/foo.1"
with "#{man1}foo.1"
.
|
||
test do | ||
# Run an example query (count processes) | ||
system "ls -lha /usr/bin/* | termsql -w -r 8 \"select count(*) from tbl\"" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use pipe_input
here instead of a manual pipe and assert_match
on the output.
@woodruffw @MikeMcQuaid I've addressed your requested changes. Could you have another look? The upstream tag is still missing unfortunately. |
version "22501e5c982ec04229643802e36756feb4687e89" | ||
sha256 "d8fabe96f57153a2e2852995d66f4506cf593bae4a6b9d7d76d3aef6150fb07e" | ||
|
||
depends_on :python => ["sqlite3", "sqlparse"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be vendored instead e.g. like ansible.rb
desc "Convert text into SQL table and query it" | ||
homepage "https://tobimensch.github.io/termsql/" | ||
|
||
url "https://github.com/tobimensch/termsql/archive/22501e5c982ec04229643802e36756feb4687e89.tar.gz" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need an upstream tag before we can include this, I'm afraid.
Closing for now, please reopen if circumstances change. |
Hi,
I'd like to propose this new formula. I'm not the package author, nor experienced with writing formulas for python projects, but I've made sure to follow the docs as best as I can. Happy for your feedback, thanks in advance!
cf. tobimensch/termsql#3