You are not logged in.

#1 2012-10-14 04:17:51

icarus41
Member
Registered: 2006-12-18
Posts: 9

Simple ABS Helper

I've noticed there aren't many helpers around for building packages from your local ABS so I made one... It's pretty simple, it copies sources from abs and builds them, if there deps it builds them to.

it works pretty well except for a few packages (libxcb and libxml2 i'm lookin at you..)

I've got alot more work to do on it and other related things so I don't consider it ready for a proper package or anything yet. posting it here incase someone else has a use for it. 

 
#!/bin/bash
#Team Janky-Soft presents
#mkabs 

THIS=/usr/bin/mkabs

PACKAGE=$1
if [ ! -f ./PKGBUILD -a "$1" == "" ];
then   
        echo "Give a package name damnit";
        exit
fi

if [ "$1" == "" ];
then   
        PACKAGE=$(cat PKGBUILD | grep pkgname= | sed 's/.*=//g')
fi

INSTALLED=$(pacman -Q $PACKAGE 2>&1 | awk {'print $3'})

if [ "$INSTALLED" != "" ]
then   
        REPO=$(pacman -Si $PACKAGE 2>&1 | grep Repo | awk {'print $3'})

        if [ "$1" != "" ];
        then   
                cp -Rv /var/abs/$REPO/$PACKAGE/ ./
                cd $PACKAGE
        fi

        DEPS=$(cat PKGBUILD | grep "depends" | grep -v "optdepends")
        for WORD in $DEPS;
        do
                DEP=$(echo $WORD | awk -F "'" {'print $2'} | sed 's/>.*//g' | sed 's/<.*//g' | sed 's/pkgconfig//g' )
                REPO=$(pacman -Si $DEP 2>&1 | grep Repo | awk {'print $3'})
                INSTALLED=$(pacman -Q $DEP 2>&1 | awk {'print $3'})

                if [ "$DEP" != "" -a "$INSTALLED" != "" ];
                then   
                        cp -Rv /var/abs/$REPO/$DEP/ ./
                        cd $DEP
                        $THIS
                        wait
                        cd ..
                else if [ "$INSTALLED" != "" ];
                        then   
                                makepkg -i --noconfirm
                        fi
                fi
        done

        makepkg -i --noconfirm

else   
        echo "$PACKAGE already installed";
fi

Offline

#2 2012-10-14 04:35:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Simple ABS Helper

I know one ABS helper: absent.
I haven't used it, but it looks pretty simple.

expac and pactree can substitute many greps, seds and awks - and maybe completely eliminate cats.

Offline

#3 2012-10-14 04:45:13

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Simple ABS Helper

karol wrote:

expac and pactree can substitute many greps, seds and awks - and maybe completely eliminate cats.

Release the felines!

Also, moving to Community Contributions...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2012-10-14 17:21:53

icarus41
Member
Registered: 2006-12-18
Posts: 9

Re: Simple ABS Helper

Thanks for the expac tip, though its PKGBUILD seems broken hmm

Offline

#5 2012-10-14 17:32:22

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Simple ABS Helper

icarus41 wrote:

Thanks for the expac tip, though its PKGBUILD seems broken hmm

I've just tested it: https://projects.archlinux.org/svntogit … ages/expac
Builds and installs fine.

What errors did you get?

Offline

#6 2012-10-14 18:42:04

icarus41
Member
Registered: 2006-12-18
Posts: 9

Re: Simple ABS Helper

Ah, I'm using the 2011.08.19 base iso so there isn't a libalpm yet. I need to refactor it to be able to upgrade packages before pacman can be upgraded though.. Thanks for the tip.

Offline

#7 2012-10-14 23:54:21

mhertz
Member
From: Denmark
Registered: 2010-06-19
Posts: 681

Re: Simple ABS Helper

Huh?! Are you saying you haven't updated in a years time or so?

Also, libalpm was added way before that iso was released!...

Offline

Board footer

Powered by FluxBB