[arch-general] "$startdir/src", "$startdir/pkg" and "|| return 1" in official packages
Although this isn't really significant... I was just curious :) `grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648" `grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385" `fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274" Isn't that something that could be fixed easily using sed(1)/awk(1)? E.g. using: `find . -name 'PKGBUILD' -exec sed -i 's/$startdir\/src/$srcdir/g; s/${startdir}\/src/${srcdir}/g; s/$startdir\/pkg/$pkgdir/g; s/${startdir}\/pkg/${pkgdir}/g' {} ';'` ... to replace all that "$startdir/[...]" stuff?
On Fri, Sep 17, 2010 at 03:35:58PM +0200, Lukas Fleischer wrote:
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Isn't that something that could be fixed easily using sed(1)/awk(1)? E.g. using:
`find . -name 'PKGBUILD' -exec sed -i 's/$startdir\/src/$srcdir/g; s/${startdir}\/src/${srcdir}/g; s/$startdir\/pkg/$pkgdir/g; s/${startdir}\/pkg/${pkgdir}/g' {} ';'`
... to replace all that "$startdir/[...]" stuff?
Sounds good conceptionally to me. However, wouldn't you need to escape the '$' signs as well? With regexp, the '$' means the end of the expression string.
On 17/09/10 23:35, Lukas Fleischer wrote:
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Isn't that something that could be fixed easily using sed(1)/awk(1)? E.g. using:
`find . -name 'PKGBUILD' -exec sed -i 's/$startdir\/src/$srcdir/g; s/${startdir}\/src/${srcdir}/g; s/$startdir\/pkg/$pkgdir/g; s/${startdir}\/pkg/${pkgdir}/g' {} ';'`
... to replace all that "$startdir/[...]" stuff?
Well, it would need to be done on SVN trunk and released to the repo branches... so it is not just a simple sed. Anyway, whats the rush? They will change eventually. There should be no (or very few) $startdir/{src,pkg} in [core]. Allan
Well, it would need to be done on SVN trunk and released to the repo branches... so it is not just a simple sed.
Mh, yeah. But that shouldn't be too difficult to script either (e.g. using a for loop and running scp(1) and archrelease for every package).
Anyway, whats the rush? They will change eventually. There should be no (or very few) $startdir/{src,pkg} in [core].
As I already said at the beginning:
Although this isn't really significant... I was just curious :)
Just thought that might be an easy way to clean up and unify packages a bit.
On Fri, 17 Sep 2010 16:07:30 +0200 Lukas Fleischer <archlinux@cryptocrack.de> wrote:
Anyway, whats the rush? They will change eventually. There should be no (or very few) $startdir/{src,pkg} in [core].
As I already said at the beginning:
Although this isn't really significant... I was just curious :)
Just thought that might be an easy way to clean up and unify packages a bit.
If a fix can be applied on all packages at once, that seems more efficient and less error-prone to me. But I'm not a packager, so do what you want :) Dieter
On Fri, Sep 17, 2010 at 9:14 AM, Dieter Plaetinck <dieter@plaetinck.be> wrote:
On Fri, 17 Sep 2010 16:07:30 +0200 Lukas Fleischer <archlinux@cryptocrack.de> wrote:
Anyway, whats the rush? They will change eventually. There should be no (or very few) $startdir/{src,pkg} in [core].
As I already said at the beginning:
Although this isn't really significant... I was just curious :)
Just thought that might be an easy way to clean up and unify packages a bit.
If a fix can be applied on all packages at once, that seems more efficient and less error-prone to me. But I'm not a packager, so do what you want :)
I wouldn't object to doing this to everything in trunk/, but we shouldn't push those changes out to the repos/ unless the package actually gets rebuilt. Those should reflect the current state of the package as much as possible. -Dan
On Fri, Sep 17, 2010 at 09:18:41AM -0500, Dan McGee wrote:
I wouldn't object to doing this to everything in trunk/, but we shouldn't push those changes out to the repos/ unless the package actually gets rebuilt. Those should reflect the current state of the package as much as possible.
I agree. And imho replacing deprecated "$startdir" and "|| return 1" statements are the kind of things people always tend to forget... Even when rebuilding packages. So I don't see any reason why this shouldn't be done automatically if it's that easy...
On 09/17/2010 04:35 PM, Lukas Fleischer wrote:
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Isn't that something that could be fixed easily using sed(1)/awk(1)? E.g. using:
`find . -name 'PKGBUILD' -exec sed -i 's/$startdir\/src/$srcdir/g; s/${startdir}\/src/${srcdir}/g; s/$startdir\/pkg/$pkgdir/g; s/${startdir}\/pkg/${pkgdir}/g' {} ';'`
... to replace all that "$startdir/[...]" stuff?
we don't have to rush things like this. eventually everything would be all right with time when the packages are updated/rebuilt. -- Ionuț
On Fri, Sep 17, 2010 at 9:54 PM, Ionuț Bîru <ibiru@archlinux.org> wrote:
On 09/17/2010 04:35 PM, Lukas Fleischer wrote:
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Isn't that something that could be fixed easily using sed(1)/awk(1)? E.g. using:
`find . -name 'PKGBUILD' -exec sed -i 's/$startdir\/src/$srcdir/g; s/${startdir}\/src/${srcdir}/g; s/$startdir\/pkg/$pkgdir/g; s/${startdir}\/pkg/${pkgdir}/g' {} ';'`
... to replace all that "$startdir/[...]" stuff?
we don't have to rush things like this. eventually everything would be all right with time when the packages are updated/rebuilt. So it's more convincing if someone will calculate this the next year.
-- Ionuț
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Why ' || return 1' is deprecated? -- реклама ----------------------------------------------------------- Три новые линейки хостинг-планов - всё что нужно Вашему сайту! 6 месяцев хостинга бесплатно и домен в подарок. http://Hvosting.ua
On 18/09/10 00:40, Vitaliy Berdinskikh UR6LAD wrote:
Although this isn't really significant... I was just curious :)
`grep '${\?startdir}\?/src' /var/abs/*/*/PKGBUILD | wc -l` - "648"
`grep '${\?startdir}\?/pkg' /var/abs/*/*/PKGBUILD | wc -l` - "1385"
`fgrep '|| return 1' /var/abs/*/*/PKGBUILD | wc -l` - "9274"
Why ' || return 1' is deprecated?
makepkg automatically exits on any error in the build() or package() functions. Allan
On Sat, Sep 18, 2010 at 12:43:25AM +1000, Allan McRae wrote:
makepkg automatically exits on any error in the build() or package() functions.
This is interesting to know; I had no idea. I learn to build my PKGBUILDs from other live examples as well as the .proto versions in the shared pacman directory of example PKGBUILDs. I haven't looked lately but hope these example scripts are updated accordingly. I plan to update my personal PKGBUILDs and the ones I maintain in AUR.
participants (8)
-
Allan McRae
-
Dan McGee
-
Dieter Plaetinck
-
Ionuț Bîru
-
Lukas Fleischer
-
Steve Holmes
-
Vitaliy Berdinskikh UR6LAD
-
甘露(Gan Lu)