diff options
author | Aki <please@ignore.pl> | 2022-07-08 17:51:20 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-07-08 17:51:20 +0200 |
commit | f49116131f10ac04bb7d5f51609b59305500c244 (patch) | |
tree | 9e37b91d8b7aa99f5a9b6ea4cc57b6051a900dc2 | |
parent | 14bfd00920bfa9c4160786e486ed12841cc26cc3 (diff) | |
download | pkgrel-f49116131f10ac04bb7d5f51609b59305500c244.zip pkgrel-f49116131f10ac04bb7d5f51609b59305500c244.tar.gz pkgrel-f49116131f10ac04bb7d5f51609b59305500c244.tar.bz2 |
Written a manual page
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | pkgrel.1 | 35 |
2 files changed, 38 insertions, 0 deletions
@@ -15,9 +15,12 @@ install: pkgrel mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(MANDIR) cp -f pkgrel $(DESTDIR)$(BINDIR)/pkgrel + cp -f pkgrel.1 $(DESTDIR)$(MANDIR)/pkgrel.1 chmod 755 $(DESTDIR)$(BINDIR)/pkgrel + chmod 644 $(DESTDIR)$(MANDIR)/pkgrel.1 uninstall: rm -f $(DESTDIR)$(BINDIR)/pkgrel + rm -f $(DESTDIR)$(MANDIR)/pkgrel.1 .PHONY: all clean install uninstall diff --git a/pkgrel.1 b/pkgrel.1 new file mode 100644 index 0000000..a292d83 --- /dev/null +++ b/pkgrel.1 @@ -0,0 +1,35 @@ +.TH pkgrel 1 "2022-07-08" +.SH NAME +pkgrel \- print out pkgrel number according to git repository history +.SH SYNOPSIS +.SY pkgrel +.YS +.SH DESCRIPTION +This program will check the history of the +.I PKGBUILD +file from the current working directory and print out the expected distribution release number. +.PP +The pkgrel is guessed based on the state of the working directory, index, and history starting from head and going back +until the end of history. The pkgrel starts at 1. If pkgver is changed, the currently stored pkgrel is printed to +standard output and the program exits. If the working directory, index or a commit contains any other changes that are +not affecting pkgver value, then pkgrel is incremented and the program continues. +.SH EXIT STATUS +0 will be returned on successful run and the pkgrel number will be printed to standard output. +.PP +1 will be returned otherwise. This can happen when the current directory is not tracked as part of any git repository, +if an error occurred when accessing the repository, or if +.I PKGBUILD +file does not exist in the current working directory or history of the repository. +.SH ENVIRONMENT +This program may use environment variables that are related to a git repository configuration. See +.B The Git Repository +subsection in +.B ENVIRONMENT VARIABLES +of +.BR git (1). +.SH NOTES +This program was implemented as a result of a simple experiment to see if it would be possible to avoid managing the +pkgrel inside the git repository. The reason to avoid it was to disconnect meta information related to versioning from +the content of the version-controlled files. +.SH SEE ALSO +.BR PKGBUILD (5),\ makepkg (8),\ git (1) |