You are not logged in.
absent is a simple bash script to ease the tedious task of rebuilding repo packages - locating the PKGBUILD, copying it somewhere, cd-ing there and running makepkg.
Its interface is similar to clyde/packer/yaourt.
For further info, install it (AUR: absent) and read the help message.
Last edited by JohannesSM64 (2011-07-12 14:29:53)
Offline
If nobody is going to say it; I will. I think this is great. Relieves the headache of building everything manually. Thanks much for this; it's almost exactly what I'm trying to accomplish with mine as well. Yours is a lot cleaner though and at just over 175 lines runs faster too. Bonus there. I think I need to trim down on the PKGBUILD parsing/version checking, etc, and focus less on dependency handling as well (talk about a headache). Sad for me to say, but I like yours better. haha (right now anyway ) Nifty arithmetic, too. Well done. I think I'll be using this for a while.
Offline
Haven't tried it yet.... It's portage (emerge) like ?
Offline
Haven't tried it yet.... It's portage (emerge) like ?
What I was thinking..it seems to sort of take the ports-like part and add a thin layer of (convenient) abstraction.
Can't wait to try it.
Offline
If nobody is going to say it; I will. I think this is great. Relieves the headache of building everything manually. Thanks much for this; it's almost exactly what I'm trying to accomplish with mine as well. Yours is a lot cleaner though and at just over 175 lines runs faster too. Bonus there. I think I need to trim down on the PKGBUILD parsing/version checking, etc, and focus less on dependency handling as well (talk about a headache). Sad for me to say, but I like yours better. haha (right now anyway ) Nifty arithmetic, too. Well done. I think I'll be using this for a while.
Thanks. Good luck with yours, competition would be nice
Offline
Offline
Haha. For some reason I felt great and nostalgic when I saw '$EDITOR not defined or invalid, enter your editor of choice". Reminded me of playing MUDs or somesuch.
Offline
Thanks. Good luck with yours, competition would be nice
Thanks, I'll do my best. I hadn't worked on it in a while but picked it up again last night and actually figured a lot out. It's funny when things come to a standstill and you put it down and come back later and suddenly everything makes sense. Haha. The only problem with mine is it's 500+ lines of zsh that I tried to convert to bash but can't figure it out, so the user will have to have zsh until I can change it. Regardless, it's basically done now, I just have to clean up the dependency handling (or drop it because it's kindy goofy, but I do like having the script handle fetching the extra packages as well). I keep thinking yours could do that too if only by having the script call it's main function again but just with the dependencies for the value, though you'd either have to parse the build or catch it from makepkg if everything is strictly local (no remote fetching of information), which I prefer anyway. Or something else, who knows. I really like yours the way it is though, I'm just rambling because code and coding possibilities are exciting to me, and from the look of the responses it looks like I'm not your only competition.
Offline
Just to clarify, there is already dependency handling (just put -s in the makepkg flags), but that only fetches binary packages. If you want to build the dependencies too, that should indeed not be hard, I already source the PKGBUILD (since it's the most reliable way of getting $install), so just use the $depends array.
And also makedepends. Also, the PKGBUILD is currently only sourced after editing the PKGBUILD before editing $install (since it's only then it's needed), so it's never sourced in non-interactive mode. Sorry for all the post editing
Last edited by JohannesSM64 (2010-03-30 19:15:48)
Offline
That's what I meant, sorry. Building them. Anyway, was just brainstorming
EDIT: Ah, ok.
Last edited by milomouse (2010-03-30 19:06:41)
Offline
This is a very nice piece of software. I have a small feature request, when you enter makepkg flags you have to put in "-fsci" for example. It would be nice if you could just do fsci, without the dash. That is it. Thanks for this program!
Offline
It would be a cool feature if it would generate a diff -u vs abs and your copy, then preserve the diff so that a subsequent run on the same package applies the diff. This could be helpful to keep things in sync
[git] | [AURpkgs] | [arch-games]
Offline
@ Vintendo: Nah, the string you enter is passed directly to makepkg. If dashes were to be avoided completely, you would have to be able to type something like "csi source" and have absent parse it and transform it into "-csi --source". It's too clunky to implement. There is one simple solution (that is, however, far from perfect, and I won't use it) but you can if you want: replace all occourances of "makepkg $MPKGF" with "makepkg -$MPKGF" in the script.
@ Daenyth: I'll look into it later.
Last edited by JohannesSM64 (2010-04-01 21:30:15)
Offline
Daenyth, the diff idea is nice. I'm waiting pretty much since I use Arch for something that will help me re-build ABS packages the way I want. Somehow I guess it's not easy to get right, but it would be nice.
Offline
For the "sci" vs "-sci", you could just apply this to the first character and do something like this when reading the user's response:
if [[ $(echo $MPKGF|cut -c1) != "-" ]]; then
MPKGF=$(echo "-"$MPKGF)
fi
.. or something. Usually it's just the first character people leave out, like "sci" instead of "-sci", but with --source (as with other long options) is something you consciously think about when typing and so always use "--". I would think so anyway.
And I'm not entirely sure I understand the diff'ing suggestion. You mean apply differences from your PKGBUILD <into> the ABS PKGBUILD or vise versa or something entirely different? If so, wouldn't that add your old pkgver, depends, etc into the new one, or vise versa, and if so also removing compilation options? Again, I may be totally missing the meaning behind this suggestion, and apologize if I am and will probably feel pretty stupid after someone explains it.
Offline
There's no need for cut there, use bash's substring function.
[git] | [AURpkgs] | [arch-games]
Offline
I too didn't fully understand the diff idea.
On another note, I swapped "Enter makepkg flags" for the more inituitive "Enter arguments to pass to makepkg" and swapped $MPKGF for the more initituive $MAKEPKGARGS, so $MPKGF doesn't work anymore.
Offline
I too didn't fully understand the diff idea.
explanation (at least, how I see it. not necessarily how daenyth meant it):
the reason you build custom packages from ABS is usually because you want to make one or a few small changes in the PKGBUILD.
so, just getting the latest pkgbuild from abs and rebuilding the package is not enough. there should be a way to automatically re-apply the changes you did on the older pkgbuild, on top of the new one.
not sure if diff is the right approach for that. actually i think it's not.
git is really good in that aspect. it can merge changesets into changed/rearranged code and even when there are conflicts, it helps you to solve them.
I already proposed to keep our package sources (and hence "abs") into a git repo, but there were some problems with that (see http://mailman.archlinux.org/pipermail/ … 1769.html)
what *could* work is this: everytime you sync abs, you do a new git commit. and you keep all official abs stuff in a certain git branch. and you have your own branch with your own changes, that should make it easy to merge in upstream changes. there's the cost that you store abs multiple times (once in /var/abs, and once in ~/mypackages-or-whatever) but i think the benefits outweigh that.
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
@Daenyth: I'm not familiar (at least not by name?) with bash's sub-string, could you give me an example? Currently I have quite a large script and only two accounts of "cut" but it would still be nice to remove them if I can. I'm using zsh but I'm sure the same should apply. Also, is Dieter's explaination what you meant about the diff suggestion? I'm curious to know because I'm trying to find a way to do something similar.
@Johannes: Allright, I updated from git and see what you mean. Thanks. By the way, I'm trying to make it where errorneous makepkg flags aren't passed and are intercepted and prompted again. I currently have:
until ( $(cd $newpath;makepkg $answer 1>/dev/null) ); do
_sub
done
_sub is a function that includes my prompt. Anyway, it works, like it will show "makepkg: invalid option -- 'z'" and call _sub again but if it's a correct makepkg flag it will continue but only show makepkg output and not the compiling output. Do you (or anyone else, for that matter) have any ideas as a way around this? I can't really say "accept all but *X*" because there could be some user variables such as the -p .. command. Just curious since we're both working on similar projects (not trying to hijack the thread).
Offline
Yes, that's what I meant by diff.
As for substrings; If you want from variable foo X characters starting from position Y, ${foo:Y:X}. So for first char starting at beginning, ${foo:0:1}. It's much faster because bash does the operation itself instead of calling exec() and letting cut process it.
[git] | [AURpkgs] | [arch-games]
Offline
Reviving this.. I did a huge code cleanup (see) and trimmed absent from 181 to 111 lines. It was mostly replacing spaghetti code. The main difference you will notice is that it now uses .absentrc instead of env vars, mainly so searchdirs can be an array (so dir names with spaces are supported - you kind of need to in 2011).
Should I add absent to AUR so you can install it without digging up a forum post and copying from it?
Offline
Should I add absent to AUR so you can install it without digging up a forum post and copying from it?
Please do. This is exceptionally handy.
Offline
Done
Offline
Very handful tool.
You could add a link in the first post
Offline
Just a quick FYI, public domain isn't a valid legal term outside of the US and similar (and judging by your last name you are Norwegian?).
#!/bin/bash
# Tool for Arch Linux to quickly search a tree of PKGBUILDs and build packages.
# Written by Johannes Langøy, 2010-2011. Public domain.
I'd recommend giving it a valid license, such as the WTFPL or something similar (see http://en.wikipedia.org/wiki/WTFPL)
Very useful tool by the way, thanks for writing it and providing it. Now maybe I'll give the ABS a go!
Offline