-
Notifications
You must be signed in to change notification settings - Fork 369
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
Add create command #9624
base: master
Are you sure you want to change the base?
Add create command #9624
Conversation
class Command | ||
def self.create | ||
puts 'Example package names: libnvme, crew-profile-base'.lightblue | ||
name = gets('Enter the package name:').chomp.capitalize.tr('-', '_') |
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.
Check for invalid package names? First character must be a letter, only alphanumeric and - or _ allowed, search packages for duplicate names, etc.
puts 'Example package description: C Library for NVM Express on Linux.'.lightblue | ||
description = gets('Enter the package description:').chomp | ||
puts 'Example package homepage: https://github.com/linux-nvme/libnvme'.lightblue | ||
homepage = gets('Enter the package homepage:').chomp |
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.
Must be a url?
puts 'Example package license: LGPL-2.1+'.lightblue | ||
license = gets('Enter the package license:').chomp | ||
puts 'Example package source_url: https://github.com/linux-nvme/libnvme/archive/refs/tags/v1.0-rc4.tar.gz'.lightblue | ||
source_url = gets('Enter the package source_url:').chomp |
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.
Must be a url?
puts 'Example package source_url: https://github.com/linux-nvme/libnvme/archive/refs/tags/v1.0-rc4.tar.gz'.lightblue | ||
source_url = gets('Enter the package source_url:').chomp | ||
puts 'Example package source_sha256: 82dc150c09e5e211d5200a37fabbbe25c69f5b0f22582956e51587a5a54463b5'.lightblue | ||
source_sha256 = gets('Enter the package source_sha256:').chomp |
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.
Only hex characters allowed?
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.
I don't see how anyone would enter an invalid sha256 value in this way.
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.
Just another validation possibility.
source_url = gets('Enter the package source_url:').chomp | ||
puts 'Example package source_sha256: 82dc150c09e5e211d5200a37fabbbe25c69f5b0f22582956e51587a5a54463b5'.lightblue | ||
source_sha256 = gets('Enter the package source_sha256:').chomp | ||
puts 'Example package buildsystem: meson'.lightblue |
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.
List all possible buildsystems?
puts 'Example package source_sha256: 82dc150c09e5e211d5200a37fabbbe25c69f5b0f22582956e51587a5a54463b5'.lightblue | ||
source_sha256 = gets('Enter the package source_sha256:').chomp | ||
puts 'Example package buildsystem: meson'.lightblue | ||
buildsystem = gets('Enter the package buildsystem:').chomp |
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.
Select from a list of options?
@@ -335,6 +335,7 @@ | |||
crew build [options] [-k|--keep] [-v|--verbose] <name> ... | |||
crew check [-V|--version] [-v|--verbose] <name> ... | |||
crew const [-v|--verbose] [<name> ...] | |||
crew create |
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.
Allow switch options to bypass interactive prompts?
armv7l: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', | ||
i686: 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii', | ||
x86_64: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | ||
}) |
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.
What if no_compile_needed
is the intention?
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.
Maybe have a prompt to include binaries? Something like Will this package require prebuilt binaries? (Y/n):
?
buildsystem = gets('Enter the package buildsystem:').chomp | ||
|
||
puts <<~EOF | ||
require "'buildsystems/#{buildsystem}'" |
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.
What about a standard package?
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.
As I said in the PR description, this only supports buildsystems for now-- a significant chunk of packages are buildsystems anyways, and those that aren't buildsystems will have unique def self.build
sections that benefit less from a template.
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.
package
could be a choice and buildsystems/
can be added to the others as a replacement pattern. There are many packages that don't require buildsystems too.
As discussed in #9594.
Pretty simple at the moment, only supports buildsystems, and you will still manually have to add dependencies yourself.
A step in the right direction though, and enough to provide the convenience that I'm taking away from
crew upload
.It's hanging right now, and I'd welcome help figuring out why.
Run the following to get this pull request's changes locally for testing.