-
Notifications
You must be signed in to change notification settings - Fork 46
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
Feature Request: Support for Linux distro packages like deb or rpm #71
Comments
Well if you install rpm or deb files with Usually for projects that generate
Still not understanding what the use-case would be... |
I do not agree with you on this topic. I am not talking about installing an deb / rpm via a official or inofficial repository nor about using some sort of ppa.
I think it is worth mentioning, that a lot (if not most) of the Go based releases are created by https://github.com/goreleaser/goreleaser, which does support the creation of deb and rpm packages. The process of providing just the deb / rpm packages as releases on Github is an easy thing to do with goreleaser. And unfortunately, most of them do not provide a PPA. The main reason, why I like
The use case is: install and keep up to date deb and rpm which are released on Github release page only (without PPA or other repository). |
Here some additional examples I currently install by using the deb packages and that I would like to have an easy way of keeping track of updates:
Just to give some examples. In some cases, switching to an other archive type would be possible, in some cases, this is not possible. I guess, I could even life with a solution, which only keeps track of the downloaded version of the deb / rpm and the installation would be an additional manual step, because installing deb / rpm does need root permissions and this is currently out of scope for |
I see your point and I agree it's not I have some ideas / questions that it'd be nice to discuss before moving forward with that Q: How do we add a feature to let users select a file regardless bin automatic selection? i.e if I do I: An idea to implement is to allow configuring |
I am happy to discuss this.
I mentioned in #53 (comment), that I started to implement my own tool, before I discovered Just today I had the situation, where
For this use case, I assume we would need a different target folder for the download, because I would prefer not to have the |
I did some thinking about this. I understand, that the initial idea of
So currently the scope is limited to single binary releases. Nevertheless I would like to propose a slight extension of the current code structure, which would allow for easier addition of other use cases like support for extracting the full content of archives (#53) and deb / rpm (#71, this issue). As I understand
Some parts are already abstracted pretty well (e.g. support for different providers, support for different archive types), some parts are currently not abstracted at all (e.g. So for the stages mentioned above I propose interfaces like this (the interfaces might not yet be complete): type Provider interface {
List() ([]assets.Asset, error)
Get(asset.Asset) (io.Reader, error)
}
// Filter work like middlewares and are therefore chainable,
// the result is an ordered list of assets.Asset, where the asset.Asset with the highest priority has index 0.
// So there could be strict filters, that remove non matching items from the list or even
// a manual filter, which just returns a list with one (the maually selected) item.
type Filter func([]assets.Asset) []assets.Asset
// Archive converts a io.Reader to a fs.FS (more specific testing/fstest.MemFS). For a zip archive, the fs.FS contains all files.
// For an executable binary, the fs.FS just contains a single file, the executable binary it self.
// The same would apply for deb / rpm files, because we do not unarchive these files in bin
// but pass them "as is" to the next stage.
type Archive interface {
Unarchive(io.Reader) (fs.FS, error)
}
// Install functions take a fs.FS and perform the actual installation to disk.
// For the current behavior of bin, this boils down to selecting the binary executable
// and copy it to the target directory. For a different implementation of Install this could
// mean, to save the whole content of the fs.FS to an other target directory
// and only link the binary to the binaries directory. For deb / rpm, this would store
// the content of the fs.FS to a temporary folder and launch dpkg or rpm for the
// installation.
//
// Eventually, the install command could be wrapped with "middlewares" as well, which
// would allow to filter the content of the fs.FS (e.g. automatically exclude files or manually
// select the files, that should get installed.
type Install func(fs.FS) error I am pretty sure, the signatures of the functions are not yet correct nor the interfaces complete. But I hope to provide some thoughts how I look forward to your thoughts. |
Dropping as suggestion Github's I mainly use |
Some tools offer releases also as
.deb
,.rpm
or similar Linux distribution packages additional to the releases packages as.zip
or.tar.gz
. Often the Linux distribution specific package has some additional benefits like the installation of man pages or default configuration files. Therefore in some cases I would prefer to install the Linux distribution package.But with these packages I currently suffer from the same problem as with the direct installation of binaries, that is, I don't have an easy way of tracking updates these packages.
Therefore it would be beneficial, if
bin
could fill this gap as well. I thinkbin
would be suited for this use case, because it already "knows" how to handle github releases and finding the correct packages. Also it is able to compare the local version with the remote ones.The only thing that is missing is, a provider to install such packages. For this to work, the current behavior would need to be changed, because the installation is no longer just copying the selected file to the correct location, but saving the file temporarily and let an other tool perform the installation.
The text was updated successfully, but these errors were encountered: