You are not logged in.

#1 2016-12-21 23:20:46

mbalajew
Member
Registered: 2016-04-05
Posts: 6

PKGBUILD review request: vim-solarized8-git

Hello, I was hoping someone could let me know if there are any problems or quality issues with the PKGBUILD below

# Maintainer: 

pkgname=vim-solarized8-git
pkgver=20161211
pkgrel=1
pkgdesc="Optimized Solarized colorschemes. Best served with true-color terminals!"
arch=('any')
url="http://ethanschoonover.com/solarized"
license=('MIT')
makedepends=('git')
depends=('vim')
conflicts=('vim-solarized8')
provides=('vim-solarized8')
source=("$pkgname::git://github.com/lifepillar/vim-solarized8.git")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/$pkgname"
    local _tmpver="$(git log -n 1 --format="%cd" --date=short)"
    echo "${_tmpver//-/}"
}

package() {
    cd "$srcdir/$pkgname"
    install -dm755 $pkgdir/usr/share/vim/vimfiles/colors
    install -Dm644 colors/*             $pkgdir/usr/share/vim/vimfiles/colors/
}

Last edited by jasonwryan (2016-12-22 01:38:33)

Offline

#2 2016-12-21 23:27:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,541

Re: PKGBUILD review request: vim-solarized8-git

Please don't use a date as the pkgver. It's not unique and isn't guaranteed not to go backwards (the last commit could have an earlier date).

You should quote any paths that have variables you don't control in them. You can't guarantee that $pkgdir doesn't have a space in it.

Functions are guaranteed to start in $srcdir, so you don't need to specify that when changing directory. Nothing wrong with it, though.

Offline

#3 2016-12-22 00:45:10

mbalajew
Member
Registered: 2016-04-05
Posts: 6

Re: PKGBUILD review request: vim-solarized8-git

Thanks for the input. I made all the changes including changing pkgver to 0.4. However, now pacman thinks that the original version (20161211) is newer. Not sure how to deal with this, any suggestions?

Offline

#4 2016-12-22 00:51:07

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,541

Re: PKGBUILD review request: vim-solarized8-git

It hasn't been in the AUR long and has no votes or comments, I'd just install the new version and go with it. If you want the new version to be seen as an upgrade, you'll need to add an epoch.

You didn't actually fix the version, though, the pkgver function will still change it to a date. Please read the VCS packaging guidelines in the wiki.

Offline

#5 2016-12-22 01:02:18

mbalajew
Member
Registered: 2016-04-05
Posts: 6

Re: PKGBUILD review request: vim-solarized8-git

Thanks again for your help, I'll go through the guidelines in the wiki. Although I think I may have solved it:

# Maintainer: 

pkgname=vim-solarized8-git
pkgver=0.4.r0.g769661a
pkgrel=4
pkgdesc="Optimized Solarized colorschemes. Best served with true-color terminals!"
arch=('any')
url="http://ethanschoonover.com/solarized"
license=('MIT')
makedepends=('git')
depends=('vim')
conflicts=('vim-solarized8')
provides=('vim-solarized8')
source=("$pkgname::git://github.com/lifepillar/vim-solarized8.git")
sha256sums=('SKIP')

pkgver() {
  cd "$pkgname"
  git describe --long --tags | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

package() {
  cd "$pkgname"
  install -dm755 "$pkgdir/usr/share/vim/vimfiles/colors"
  install -Dm644 colors/* "$pkgdir/usr/share/vim/vimfiles/colors/"
}

Last edited by jasonwryan (2016-12-22 01:38:20)

Offline

Board footer

Powered by FluxBB