jabranham / system-packages

Moved to gitlab
https://gitlab.com/jabranham/system-packages
GNU General Public License v3.0
39 stars 12 forks source link

Expose the functionality for retrieving a command. #25

Closed akhramov closed 6 years ago

akhramov commented 6 years ago

Hi,

First of all, thanks for your package. It's really helpful.

I would like to discuss the possibility of exposing command retrieving functionality. As it stands now, some integrations need to know which shell command is going to be executed. use-package integration is the most notable example:

https://github.com/jwiegley/use-package/blob/512aa50b025018cb8574498d868814f73c02bb9b/use-package-ensure-system-package.el#L30-L42

(defun use-package-ensure-system-package-install-command (pack)
  "Return the default install command for PACK."
  (let ((command
         (cdr (assoc 'install (cdr (assoc system-packages-package-manager
                                          system-packages-supported-package-managers))))))
    (unless command
      (error (format "%S not supported in %S" 'install system-packages-package-manager)))
    (unless (listp command)
      (setq command (list command)))
    (when system-packages-use-sudo
      (setq command (mapcar (lambda (part) (concat "sudo " part)) command)))
    (setq command (mapconcat 'identity command " && "))
(mapconcat 'identity (list command pack) " ")))

This duplicates the code already existing in the package, but not exposed yet. Would it make sense to expose this piece of functionality, so integrations would be able to leverage it? What do you think?

See also jwiegley/use-package#661

Thanks!

jabranham commented 6 years ago

I just pushed a commit that adds system-packages-get-command. Let me know if that's not what you were asking about.

@waymondo for the ping.

akhramov commented 6 years ago

Yeah, exactly. Thanks!

akhramov commented 6 years ago

@jabranham also, may I ask you to make a release?

jabranham commented 6 years ago

Done

On Wed 25 Apr 2018 at 00:06, Artem Khramov notifications@github.com wrote:

@jabranham also, may I ask you to make a release?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

akhramov commented 6 years ago

Thank you very much!