LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Calvin, a project in bash (http://www.linuxquestions.org/questions/slackware-14/calvin-a-project-in-bash-896795/)

abesirovic1 08-11-2011 12:55 PM

Calvin, a project in bash
 
Hi there all you fine people,

Being annoyed by sbopkg and too lazy to do all slackbuilds by hand I decided to learn bash and in the process write my own "packager" and so I did. This is my first BASH project and so far I found it to be very nifty (I tend to use this thing almost daily) so I'm throwing it out into the wild, maybe somebody will find it useful.

Calvin can automate slackbuild installation and can process these nice text files for the lazy bunch, the ones I call slackbundles. Basically, a bundle is just a text file with a list of slackbuilds which will be built in that order. I found out that a bundle for mysql-workbench (and stuff alike) might save a couple of those dying nerves.

I've made a nice page for calvin here: http://www.cprog.de/calvin/

So check it out. Any input is extremely welcome.

Cheers,
Armin.

bosth 08-11-2011 02:56 PM

Your slackbundles sound like the sbo queue files.

wigry 08-11-2011 04:31 PM

Even if you managed to reimplement the SBO queue files, the main point is, you learned to program BASH and thats a big accomplishment. Congratulations!

<---- Does this make sense? Registered 2004, 16 posts, LQ Newbie :D

Keith Hedger 08-12-2011 08:54 AM

Not bad!
Couple of things I would change the bash-centric way is to use $(COMMAND) instead of back ticks ( yes I know it's not posix but this IS a bash script! please don't flame me! ), I would also check for uid 0 rather than the name root ( echo $UID ).
You might want to check out the advanced bash scripting guide if you haven' already got a copy and also this is a good site for bash scripts http://bashscripts.org/forum/index.php
Good work!

bosth 08-12-2011 09:10 AM

Any plans to support the Sbo queue (.sqf) file format? There's already a large collection of those and the differences between your format and theirs are small. It might get people using your script that way...

abesirovic1 08-14-2011 02:15 PM

Hi guys, thanks for all the input.

@bosth: Yes, another friend recommended this and I'm working on it. If it works I'll give it a go with some of those and if it works that'll be great.

brianL 08-14-2011 03:59 PM

Quote:

Originally Posted by wigry (Post 4440104)
<---- Does this make sense? Registered 2004, 16 posts, LQ Newbie :D

Your title depends on number of posts, not how long you've been a member, or level of knowledge. If it depended on level of knowledge, I wouldn't even qualify as a newbie. :)

GazL 08-14-2011 04:52 PM

Quote:

Originally Posted by brianL (Post 4442854)
Your title depends on number of posts, not how long you've been a member, or level of knowledge. If it depended on level of knowledge, I wouldn't even qualify as a newbie. :)

Speaking of which... You're only 15 away from "Guru". ;)

brianL 08-14-2011 04:54 PM

Yeah, I'd be too embarrassed to choose that title. :) Probably go for "LQ 5k Club".

brianL 08-14-2011 05:01 PM

From the LQ FAQ:
Quote:

After 5000 posts you can choose between Guru, LQ Muse, LQ 5k Club, LQ Sage, LQ Veteran and LQ Addict

55020 08-14-2011 06:51 PM

Quote:

Originally Posted by Keith Hedger (Post 4440789)
use $(COMMAND) instead of back ticks ( yes I know it's not posix

Excellent advice, and it *IS* Posix. http://pubs.opengroup.org/onlinepubs...l#tag_02_06_03

bgeddy 08-14-2011 10:02 PM

Quote:

Yeah, I'd be too embarrassed to choose that title. Probably go for "LQ 5k Club".
Quote:

From the LQ FAQ:
Quote:
After 5000 posts you can choose between Guru, LQ Muse, LQ 5k Club, LQ Sage, LQ Veteran and LQ Addict
@brianL- Haha - LQ Addict sounds very suspect to me and "LQ 5k Club" not much better. Go for Guru - from Wikipedia
Quote:

A guru (Sanskrit: गुरु) is one who is regarded as having great knowledge, wisdom, and authority in a certain area, and who uses it to guide others (teacher). Other forms of manifestation of this principle can include parents, school teachers, non-human objects (books) and even one's own intellectual discipline, if the aforementioned are in a guidance role.[1]
Suits you sir - guru brianL - gotta ring to it.

Keith Hedger 08-15-2011 04:58 AM

Quote:

Originally Posted by 55020 (Post 4442985)
Excellent advice, and it *IS* Posix. http://pubs.opengroup.org/onlinepubs...l#tag_02_06_03

Thanks for that, I've never checked but I have had some complaints when posting ( not just on this board ) that the $() form is bash only and not posix , now I know better!Grrr


All times are GMT -5. The time now is 05:53 AM.