You are not logged in.

#1 2013-12-17 05:18:46

poiuyt23
Member
Registered: 2011-10-12
Posts: 75

Scripts I use to update my system from ABS

Banged some scripts together to update from ABS and sharing them cause I like them - they work together or separate.
gather abs directories into ~/abs directory:

#!/usr/bin/perl
my @upgradelist;
system ("sudo pacman -Sy");
system ("sudo abs");
open FH, "pacman -Qqu |";
while (<FH>){
	chomp $_;
	if (-d "/var/abs/core/$_") {system ("cp -R /var/abs/core/$_/ /home/poiuyt/abs/ ");}
	if (-d "/var/abs/community/$_") {system ("cp -R /var/abs/community/$_/ /home/poiuyt/abs/ ");}
	if (-d "/var/abs/extra/$_") {system ("cp -R /var/abs/extra/$_/ /home/poiuyt/abs/ ");}
	}

DL and make the ABS packages from the ~/abs directory:

  GNU nano 2.2.6            File: makepackages.pl                               

#!/usr/bin/perl
        $absdir = $ENV{"HOME"}."/abs";
        opendir (DIR, $absdir);
        my @directory= readdir(DIR);
        my $workingdir;
        foreach (@directory){
#               if ($file =~ m/^\./){
                        $workingdir = $absdir."/$_";
                        print "calling makepkg on $workingdir\n";
                        chdir ("$workingdir") or die "can't change directories";
                        system ("makepkg");
                        }
#               }

install packages in abs directory:

  GNU nano 2.2.6              File: install.pl                                  

#!/usr/bin/perl
        $absdir = $ENV{"HOME"}."/abs";
        opendir (DIR, $absdir);
        my @directory= readdir(DIR);
        my $workingdir;
        foreach (@directory){
#               if ($file =~ m/^\./){           
                        $workingdir = $absdir."/$_";
                        print "calling pacman on $workingdir\n";
                        chdir ("$workingdir") or die "can't change directories";
                        system ("sudo pacman -U *.pkg.tar.xz");
                }
#       }

Feel free to comment or improve as I willingly admit I am a crappy coder.
EDIT : My bad code was corrected - sorry was working on it today

Last edited by poiuyt23 (2013-12-17 05:35:21)

Offline

#2 2013-12-17 05:41:32

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

Re: Scripts I use to update my system from ABS

Moving to Programming and Scripting...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-12-24 12:19:22

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Scripts I use to update my system from ABS

Don't use pacman -Sy, use checkupdates
Don't run abs as root, use $ABSROOT, also you cam tell abs just what packages to download. As a sidenote, abs is often out of date, the gir repo is prefered.

And there already are several existing tools to build/update from abs, why not use one of those?


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2013-12-24 12:38:19

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Scripts I use to update my system from ABS

If you do use ABSROOT, you can just set it to your ~/abs directory so the first script would not be needed.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2013-12-26 02:18:25

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: Scripts I use to update my system from ABS

Mr.Elendig wrote:

, abs is often out of date, the gir repo is prefered.

Are you talking about this?

Offline

#6 2013-12-27 02:28:12

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Scripts I use to update my system from ABS


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2013-12-27 15:56:06

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: Scripts I use to update my system from ABS

I see. So instead of keeping the PKGBUILDs up to date with 'sudo abs', we would issue a 'git pull' instead. OK.

But it looks like this git repo is missing several packages from the official Arch repos, like calibre and dwm (these two are present in the ABS tree, under community).

Offline

#8 2013-12-28 17:22:53

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Scripts I use to update my system from ABS

There is a seperate repo for community, just click on the source link from the package page.

Last edited by Mr.Elendig (2013-12-28 17:23:45)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#9 2014-01-08 19:28:50

poiuyt23
Member
Registered: 2011-10-12
Posts: 75

Re: Scripts I use to update my system from ABS

I will have to take a look at all the suggestions made - the main reason I started this is because I was new to Arch and didn't (and still don't) know all the tools available.

Offline

Board footer

Powered by FluxBB