summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos José Ruiz-Henestrosa Ruiz2020-07-21 12:15:20 +0200
committerCarlos José Ruiz-Henestrosa Ruiz2020-07-21 12:15:20 +0200
commit5cb5fd8a9de53765d1aefbbc03751d51d633aade (patch)
treebc6d5a35261b6bd5e161086d623523c1b12fcd2f
parenta88ae3fc12e3d1de9a1f9daeb17b69203718d83c (diff)
downloadaur-5cb5fd8a9de53765d1aefbbc03751d51d633aade.tar.gz
Changed indentation and simplified pkgver code
Now we'll use cut instead of sed for clearer version extraction
-rw-r--r--PKGBUILD29
1 files changed, 14 insertions, 15 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d4a1be4fb53..1ccb3993201 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,6 @@ pkgdesc="Semi-automatic importer from external data sources into beancount"
arch=('any')
url="https://github.com/jbms/beancount-import"
license=('MIT')
-groups=()
depends=('beancount>=2.1.3'
'python>=3.5'
'python-setuptools'
@@ -29,25 +28,25 @@ source=('git://github.com/jbms/beancount-import.git')
md5sums=('SKIP')
pkgver() {
- cd "$srcdir/${_name}"
+ cd "$srcdir/${_name}"
- # The repo does not tag releases, so we have to get creative
- _release_commit=$(git log -L '/version=/',+1:setup.py \
- --max-count=1 --pretty="format:%h" | \
- head --lines=1)
- _ver=$(grep version setup.py | sed "s/.*'\([^']*\)'.*/\1/")
- printf "%s.r%s.%s" \
- "${_ver}" \
- "$(git rev-list --count ${_release_commit}..HEAD)" \
- "$(git rev-parse --short HEAD)"
+ # The repo does not tag releases, so we have to get creative
+ _release_commit=$(git log -L '/version=/',+1:setup.py \
+ --max-count=1 --pretty="format:%h" | \
+ head --lines=1)
+ _ver=$(grep version setup.py | cut --delimiter="'" --fields=2)
+ printf "%s.r%s.%s" \
+ "${_ver}" \
+ "$(git rev-list --count ${_release_commit}..HEAD)" \
+ "$(git rev-parse --short HEAD)"
}
build() {
- cd "$srcdir/${_name}"
- python setup.py build
+ cd "$srcdir/${_name}"
+ python setup.py build
}
package() {
- cd "$srcdir/${_name}"
- python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
+ cd "$srcdir/${_name}"
+ python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
}