2011-02-01

magpie - MAGeia Perl Integration Easy

in my mandriva to mageia switch, i promised to myself that i'd collect the various scripts that i'm using on a day to day basis to maintain the myriad of perl rpm packages.

therefore, i've created magpie (MAGeia Perl Integration Easy) and uploaded it to cpan. the tool is not yet complete, but i'm incorporating new commands now and then.

it currently supports 2 commands:
  • magpie bswait - this command pauses according to the recommendation of mageia build-system. it indeed provides some recommendation on how much time to pause between 2 packages submission to not overload it - (this is known as throttling).
  • magpie co - this brand new command (in version 1.110320) allows to check-out a given package from mageia repository.

some details about magpie checkout: it is not meant to replace "mgarepo co", it does in fact use mgarepo underneath. so what does this command add?
  • the possibility to check out in a given directory
    $ magpie co -d ~/rpm/cauldron perl
  • the fact that it will either check out *or* update the local check-out if it already exists:
    $ magpie co -d ~/rpm/cauldron perl
    # check-out if 1st run, update otherwise
  • finally, the possibility to dump a shell command to execute to change directory in the fresh check-out:
    # add this in your ~/.bashrc
    function cco() { eval $(magpie co -d ~/rpm/cauldron -q -s $*); }
    # then, one can do a fresh checkout/update + cd by issuing:
    $ cco perl

nothing revolutionary, but it saves some keystrokes here and there.

2 comments:

  1. nice, I think I should do the same thing for ruby and create a gem because basically I follow more or less a similar process (with lots of other modifications due to the adoption of a brand new policy :)

    Though, I don’t understand this :
    “the possibility to check out in a given directory”

    If you issue a mgarepo co foo bar it’ll checkout package foo in the bar directory too

    ReplyDelete
  2. @shikamuru: indeed, mgarepo allows a directory to be given as last arg. but it is the directory that will contain the checkout, whereas magpie checkout uses this as the parent directory.

    $ mgarepo co foo ~/bar
    ==> ~/bar/{SOURCES|SOURCES-bin|SPECS}
    $ magpie co foo -d ~/bar
    ==> ~/bar/foo/{SOURCES|SOURCES-bin|SPECS}

    i prefer it this way because a) it keeps the package name as last directory component and b) all the check-outs can be grouped in the same directory. ymmv. :-)

    ReplyDelete