[arch-general] PKGBUILD work
Hey all, How to have access and change PKGBUILD variables? Is there command-line tools for this kind of job, so one could easily check, for example, the version number, change it and update the checksum? thanks a bunch, Bernardo
2011/2/5 Bernardo Barros <bernardobarros2@gmail.com>
Hey all,
How to have access and change PKGBUILD variables? Is there command-line tools for this kind of job, so one could easily check, for example, the version number, change it and update the checksum?
thanks a bunch, Bernardo
Can't you just open it in nano or vim? -- (\_ /) copy the bunny to your profile (0.o ) to help him achieve world domination. (> <) come join the dark side. /_|_\ (we have cookies.)
And get PKGBUILD with ABS. -- Sds., Leandro Inácio S. Carvalho http://blog.leandroinacio.eti.br/ <http://blog.luizagostinho.com/>http://archlinux-br.org/ Linux User: #475144 LPIC-1 (LPI000212497) Arch Linux User "Não existe atalho para o desenvolvimento, para progredirmos precisamos de ação, dedicação e aprendizado!" On Sat, Feb 5, 2011 at 10:54, jesse jaara <jesse.jaara@gmail.com> wrote:
2011/2/5 Bernardo Barros <bernardobarros2@gmail.com>
Hey all,
How to have access and change PKGBUILD variables? Is there command-line tools for this kind of job, so one could easily check, for example, the version number, change it and update the checksum?
thanks a bunch, Bernardo
Can't you just open it in nano or vim?
-- (\_ /) copy the bunny to your profile (0.o ) to help him achieve world domination. (> <) come join the dark side. /_|_\ (we have cookies.)
2011/2/5 jesse jaara <jesse.jaara@gmail.com>:
Can't you just open it in nano or vim?
Of course... or even better, Emacs. :-) But I'd like to know if I could do something like 'get-pkg-version', so from time to time I could use a script to create a list with the packages and the version numbers. Then would be easy to check if a bunch all packages are up-to-date. Or even publish so a team could easily check if they are up-to-date. (Then someone could open those ones in Emacs and update the checksum with a key-stroke. :-)
(in case not all of then are installed, then pacman would do it)
2011/2/5 Bernardo Barros <bernardobarros2@gmail.com>
2011/2/5 jesse jaara <jesse.jaara@gmail.com>:
Can't you just open it in nano or vim?
Of course... or even better, Emacs. :-)
But I'd like to know if I could do something like 'get-pkg-version', so from time to time I could use a script to create a list with the packages and the version numbers.
Then would be easy to check if a bunch all packages are up-to-date. Or even publish so a team could easily check if they are up-to-date.
(Then someone could open those ones in Emacs and update the checksum with a key-stroke. :-)
check xyne-common-bash-functions it will help litle -- (\_ /) copy the bunny to your profile (0.o ) to help him achieve world domination. (> <) come join the dark side. /_|_\ (we have cookies.)
[2011-02-05 12:02:53 -0200] Bernardo Barros:
But I'd like to know if I could do something like 'get-pkg-version',
If you trust the PKGBUILD: . PKGBUILD echo $pkgver If you don't, then I would use AWK to parse it... -- Gaetan
yep! could you give an example of a bash function that gets the $pkgver from a file?
On 02/05/2011 04:17 PM, Bernardo Barros wrote:
yep!
could you give an example of a bash function that gets the $pkgver from a file? Hi... I'm not verry good in bash function but this should work:
pkgver() { . $1 ; echo $pkgver ;} Put it in your .bashrc and then run: pkgver PKGBUILD But it won't work with zsh...
Am 05.02.2011 16:17, schrieb Bernardo Barros:
yep!
could you give an example of a bash function that gets the $pkgver from a file?
Just paste Gaetans two lines into a file: . `pwd`/PKGBUILD echo $pkgver Save it in a directory which is in your PATH variable and make it executeable. If you mean with file an archive from AUR, then you have to untar it first: tar -xzf `pwd`/$1.tar.gz cd `pwd`/$1 . `pwd`/PKGBUILD echo $pkgver # Clean up cd .. rm -r $1 You must call this script with the package name obtained, e.g. pkgver dccnightmare
On 5 February 2011 21:23, Bernardo Barros <bernardobarros2@gmail.com> wrote:
Hey all,
How to have access and change PKGBUILD variables? Is there command-line tools for this kind of job, so one could easily check, for example, the version number, change it and update the checksum?
There is no such prepackaged tool, because we assume these are trivial tasks which I'm sure you can chalk up yourself, for eg.: #!/bin/bash find /var/abs -name $1 -exec grep ^pkgver=[a-zA-Z0-9].* {}/PKGBUILD \; | sed 's/pkgver=//' To check. find /var/abs -name $1 -exec sed 's/^pkgver=.*/pkgver=3.4/' -i {}/PKGBUILD \; To change.
On 6 February 2011 00:58, Ray Rashif <schiv@archlinux.org> wrote:
On 5 February 2011 21:23, Bernardo Barros <bernardobarros2@gmail.com> wrote:
Hey all,
How to have access and change PKGBUILD variables? Is there command-line tools for this kind of job, so one could easily check, for example, the version number, change it and update the checksum?
There is no such prepackaged tool, because we assume these are trivial tasks which I'm sure you can chalk up yourself, for eg.:
#!/bin/bash find /var/abs -name $1 -exec grep ^pkgver=[a-zA-Z0-9].* {}/PKGBUILD \; | sed 's/pkgver=//'
To check.
find /var/abs -name $1 -exec sed 's/^pkgver=.*/pkgver=3.4/' -i {}/PKGBUILD \;
To change.
Of course, you have to do some copying from /var/abs and not just edit directly like that.
Thank you all.
participants (7)
-
Aljosha Papsch
-
Bernardo Barros
-
Gaetan Bisson
-
jesse jaara
-
Leandro Inacio
-
pyknite
-
Ray Rashif