[aur-general] PKGBUILD - custom DLAGENT - failed to create symbolic link
Hi, I'm trying to package the tools necessary to compile the freedict dictionaries as DICT files (and subsequently the dictionaries themselves). The whole PKGBUILD is to be found at the end of this message. Since the sources for all the directories and the tools are provided in one single repository on github.com, I use svn to extract exclusively the respective necessary files. This required a little fiddling, but I finally got it working using a strange custom DLAGENT ¹: DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "%o"\ --depth\ empty;\ cd\ "%o";\ svn\ up\ "%o"') Anyways, this works as far as downloading is concerned. However, upon running makepkg, I get the following error: ==> Extracting sources... ln: failed to create symbolic link '<somedir>/src/' -> '': No such file or directory ln: failed to create symbolic link '<somedir>/src/' -> '': No such file or directory The problem appears to be that makepkg stores empty names for the files downloaded with the custom DLAGENT. Does somebody know the cause of this? Any help is appreciated. Einhard Leichtfuß ¹ For some reason the '\ 's are necessary, quoting the whole bash skript inside did not work (properly escaped, of course). PKGBUILD -------- # Maintainer: Einhard Leichtfuß <archer@respiranto.de> _files=(tools Makefile) _pkgname=dict-freedict-tools pkgname=${_pkgname}-svn pkgver=r1420 pkgrel=1 pkgdesc="Tools to compile the Freedict dictionaries" arch=('any') url="http://www.freedict.org/" license=('GPL') makedepends=('subversion') provides=(${_pkgname}) conflicts=(${_pkgname}) DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "%o"\ --depth\ empty;\ cd\ "%o";\ svn\ up\ "%o"') #DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "${_f}"\ --depth\ empty;\ cd\ "${_f}";\ svn\ up\ "${_f}"') #DLAGENTS+=('_svn::/usr/bin/echo %u %o') source=( $(printf "_svn://github.com/freedict/fd-dictionaries/trunk/%s " "${_files[@]}") ) md5sums=('SKIP' 'SKIP') #pkgver() #{ # cd ${_files[0]} # local _ver="$(svnversion)" # printf "r%s" "${_ver//[[:alpha:]]}" #} #package() #{ # mkdir -p "${pkgdir}/opt/freedict-tools" # cp -r "${_files[@]}" "${pkgdir}/opt/freedict-tools/" #}
Sorry, I used the wrong DLAGENTS line in my last email. On 2016-09-26 11:12, respiranto wrote:
Hi,
I'm trying to package the tools necessary to compile the freedict dictionaries as DICT files (and subsequently the dictionaries themselves). The whole PKGBUILD is to be found at the end of this message.
Since the sources for all the directories and the tools are provided in one single repository on github.com, I use svn to extract exclusively the respective necessary files.
This required a little fiddling, but I finally got it working using a strange custom DLAGENT ¹: DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "%o"\ --depth\ empty;\ cd\ "%o";\ svn\ up\ "%o"')
corrected:
DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "${_f}"\ --depth\ empty;\ cd\ "${_f}";\ svn\ up\ "${_f}"')
Anyways, this works as far as downloading is concerned. However, upon running makepkg, I get the following error: ==> Extracting sources... ln: failed to create symbolic link '<somedir>/src/' -> '': No such file or directory ln: failed to create symbolic link '<somedir>/src/' -> '': No such file or directory
The problem appears to be that makepkg stores empty names for the files downloaded with the custom DLAGENT.
Does somebody know the cause of this? Any help is appreciated.
Einhard Leichtfuß
¹ For some reason the '\ 's are necessary, quoting the whole bash skript inside did not work (properly escaped, of course).
corrected PKGBUILD: -------------------
# Maintainer: Einhard Leichtfuß <archer@respiranto.de> _files=(tools Makefile) _pkgname=dict-freedict-tools pkgname=${_pkgname}-svn pkgver=r1420 pkgrel=1 pkgdesc="Tools to compile the Freedict dictionaries" arch=('any') url="http://www.freedict.org/" license=('GPL') makedepends=('subversion') provides=(${_pkgname}) conflicts=(${_pkgname}) DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "${_f}"\ --depth\ empty;\ cd\ "${_f}";\ svn\ up\ "${_f}"') source=( $(printf "_svn://github.com/freedict/fd-dictionaries/trunk/%s " "${_files[@]}") ) md5sums=('SKIP' 'SKIP')
#pkgver() #{ # cd ${_files[0]} # local _ver="$(svnversion)" # printf "r%s" "${_ver//[[:alpha:]]}" #}
#package() #{ # mkdir -p "${pkgdir}/opt/freedict-tools" # cp -r "${_files[@]}" "${pkgdir}/opt/freedict-tools/" #}
On Mon, Sep 26, 2016 at 12:25 PM, respiranto <arch023@respiranto.de> wrote:
DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "${_f}"\ --depth\ empty;\ cd\ "${_f}";\ svn\ up\ "${_f}"')
Why write your own DLAGENT for this? It seems that the svn VCS client only supports specifying directories, not individual files. But you can fetch individual files over https directly from github. Something like: source=(svn+https://github.com/freedict/fd-dictionaries/trunk/tools https://raw.githubusercontent.com/freedict/fd-dictionaries/master/Makefile) Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3
On 2016-09-26 11:59, Christoph Gysin via aur-general wrote:
On Mon, Sep 26, 2016 at 12:25 PM, respiranto <arch023@respiranto.de> wrote:
DLAGENTS+=('_svn::/usr/bin/bash -c _u="%u";\ _u="${_u#_svn://}";\ _d="${_u%/*}";\ _f="${_u##*/}";\ /usr/bin/svn\ checkout\ "https://${_d}"\ "${_f}"\ --depth\ empty;\ cd\ "${_f}";\ svn\ up\ "${_f}"')
Why write your own DLAGENT for this?
It seems that the svn VCS client only supports specifying directories, not individual files. But you can fetch individual files over https directly from github.
Something like:
source=(svn+https://github.com/freedict/fd-dictionaries/trunk/tools https://raw.githubusercontent.com/freedict/fd-dictionaries/master/Makefile)
Chris
Thanks! This works perfectly well. I should probably have searched the web for direct file downloads from github.com first. Though I am still confused about why my approach didn't work. Einhard
Thanks! This works perfectly well. I should probably have searched the web for direct file downloads from github.com first.
Though I am still confused about why my approach didn't work.
It seems that DLAGENTS only support downloading files, not directories. Chris -- echo mailto: NOSPAM !#$.'<*>'|sed 's. ..'|tr "<*> !#:2" org@fr33z3
participants (2)
-
Christoph Gysin
-
respiranto