Merge ~jslarraz/review-tools:add-intall-deps-target into review-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: 45434673dd7e6b00e7c5ae8cb176b0e46a45a865
Proposed branch: ~jslarraz/review-tools:add-intall-deps-target
Merge into: review-tools:master
Diff against target: 18 lines (+8/-0)
1 file modified
Makefile (+8/-0)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+466810@code.launchpad.net

Commit message

Makefile: add install-{,deb,snap}-deps targets

To post a comment you must log in.
Revision history for this message
Emilia Torino (emitorino) :
Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote (last edit ):

> is this apt install or snap install instead?

Yup, it is snap install. updated :)

Revision history for this message
Alex Murray (alexmurray) wrote :

Should this use sudo for the apt install commands? Or better yet, to match the experience of snap install, should it use pkexec to prompt via gui?

review: Needs Information
Revision history for this message
Jorge Sancho Larraz (jslarraz) wrote :

Using pkexec would be nice, but unless I'm not aware of some option, it will prompt the user for every package that needs to be installed. It could be avoided by wrapping the loop in a bash script but I think it is an overkill considering the purpose of this target.

If there is a way to "cache" user password via pkexec I will be happy to take a look at it.

Otherwise "sudo" should be ok here

Revision history for this message
Alex Murray (alexmurray) wrote :

Ok - let's go with it as it already is - thanks @jslarraz.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/Makefile b/Makefile
2index 523b0ac..2e394fb 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -50,6 +50,14 @@ check-snap-deps:
6
7 check-deps: check-deb-deps check-snap-deps
8
9+install-deb-deps:
10+ @for dep in $(DEB_DEPENDENCIES); do if ! dpkg -s $$dep 1>/dev/null 2>&1; then sudo apt install -y $$dep; fi; done
11+
12+install-snap-deps:
13+ @for dep in $(SNAP_DEPENDENCIES); do if ! snap list $$dep 1>/dev/null 2>&1; then sudo snap install $$dep; fi; done
14+
15+install-deps: install-deb-deps install-snap-deps
16+
17 black: clean
18 black --check $(FILES)
19

Subscribers

People subscribed via source and target branches