Merge ~ines-almeida/txpkgupload:remove-git-dependency-from-default-make-command into txpkgupload:master

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: f3f9e9d032f888a7eb1ef7db22ac4ab4e1849d1d
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/txpkgupload:remove-git-dependency-from-default-make-command
Merge into: txpkgupload:master
Diff against target: 13 lines (+1/-1)
1 file modified
Makefile (+1/-1)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+444912@code.launchpad.net

Commit message

Update Makefile default commands to not update version

This command requires a git directory, which doesn't always need to be the case when one runs the default `make` command, e.g., installing it from the tarball. This change moves that command to run when building the tarball, which should be the new way of deploying txpkgupload in the future

Description of the change

Currently there is no good `make` command to run on charm install for txpkgupload.
The `make compile` command will fail and throw an error if not in a .git repository.

Another alternative would be to make it fail gracefully, but IMO it doesn't make much sense to me to need to run the `update-version` script there regardless.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Looking at https://git.launchpad.net/launchpad/commit?id=e13a516043 as an example, could you instead do `[ ! -d .git ] || scripts/update-version-info.sh`? That should make it work gracefully in a charm, and I think you could probably then drop the change to the `build-tarball` rule.

Revision history for this message
Ines Almeida (ines-almeida) wrote :

Sounds good, updated. I'll squash and update the commit message after approved to remove the incoherence

Revision history for this message
Colin Watson (cjwatson) :
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 ddd2107..313b16e 100644
3--- a/Makefile
4+++ b/Makefile
5@@ -41,7 +41,7 @@ default: compile
6
7 bootstrap compile:
8 $(MAKE) $(ENV)
9- scripts/update-version-info.sh
10+ [ ! -d .git ] || $(MAKE) $(VERSION_INFO)
11
12
13 $(VERSION_INFO):

Subscribers

People subscribed via source and target branches

to all changes: