You are not logged in.
Hello,
after a long absence from arch I'm now using arch as a server and workstation system.
To have all workstations in sync I need a tool which show all installed package versions and the available one.
Something like the portversion from FreeBSD.
Is there an option for makepkg available to set the working directory to a specific path?
I have mounted the abs dir on each workstation and if I compile a package I would like to have the src dir on the local HDD to avoid to much network traffic.
delco
Offline
I need a tool which show all installed package versions
pacman -Q
and the available one.
pacman -Sy && pacman -Qu
Is there an option for makepkg available to set the working directory to a specific path?
Why do you want this? Surely you don't want to be compiling packages for every workstation. Just compile the packages on one workstation and re-use the packages on the other workstations.
I am a gated community.
Offline
Hi stonecrest,
I mean a tool which shows the difference like:
Name Installed Available
package 1.2.0 1.2.1
and not only the package and new version. Maybe my explanation was not clear.
The problem with the compilation is the network access. All workstations have the abs mounted via NFS, so the compilation is huge network traffic and terrible slow. After the package is compiled it is moved to the central server and is available for the other workstations.
That is done via the makepkg.conf entry PKGDEST. An entry SRCDEST is available but no entry for WORKDIR or something else.
delco
Offline
truncated .. new rev[3] below ...
Last edited by raeven (2007-05-23 09:51:55)
Offline
Hi raeven,
a nice script:)
I'm not the python crack, so one thing could be added.
An option to show only the different packages. It make the life a little bit easier if there are a lot of packages installed.
thanx
delco
Offline
oki i think does the job ...
i dunno if the ts-version --help, shows clear enough info .. if not let me know ...
by default it now reports only on packages where the version do not match,
so
[raeven@Viper32 ts]# ts-version -q firefox bash linkage-svn -a
linkage-svn 204-1 unknown
firefox 2.0.0.3-1 2.0.0.3-3
bash 3.2.017-2 3.2.017-2
....
[raeven@Viper32 ts]# ts-version -q firefox bash linkage-svn
linkage-svn 204-1 unknown
firefox 2.0.0.3-1 2.0.0.3-3
...
[raeven@Viper32 ts]# ts-version -q firefox bash linkage-svn -i
firefox 2.0.0.3-1 2.0.0.3-3
please note options have precedence ...
so ts.ver -i -a is the same as ts.ver -a
and if the option -h is passed, only help is displayed
----------------------------------------------
Revision 3
#!/usr/bin/env python
#` Author: Shane Lane | Raeven `#
#` License: Public Domain `#
#` Pkg: tellscripts-version `#
#` Reversion: 3 `#
import re, subprocess as sp, sys
cmd = sys.argv.pop(0)
if '-q' in sys.argv or '--quiet' in sys.argv: _quiet = True
else: _quiet = False
argv = [arg for arg in sys.argv if arg[0] != '-']
instl = {}
avail = {}
if _quiet == False: print 'tellscripts: ts-version -- v0.3'
if '-h' in sys.argv or '--help' in sys.argv :
print '\ntellscripts.Version reports version info on installed vs available packages\n'
print 'ts-version -h|--help ~ print this message.'
print 'ts-version [opt] ~ report on all packages with unmatched versions;'
print ' the pkg list consists of all installed packages.'
print 'ts-version [opt] pkg1 pkg2 pkg3 ~ report on list of pkgs 1,2 and 3.'
print 'Pkg List operations:'
print ' -a|--all ~ report on all packages.'
print ' -i|--in-repos ~ report only on packages found in the repos(pacman.conf)'
print ' -q|--quiet ~ only print results.\n'
sys.exit(0)
if len(argv) == 0:
if _quiet == False: print 'Building Package Lists ... Please Wait!',
for pkg in sp.Popen(['/usr/bin/pacman','-Q'], stdout=sp.PIPE).stdout.readlines():
pkg = pkg.rstrip().split(' ')
instl[pkg[0]] = pkg[1]
for pkg in sp.Popen(['/usr/bin/pacman','-Sl'], stdout=sp.PIPE).stdout.readlines():
pkg = pkg.rstrip().split(' ')
avail[pkg[1]] = pkg[2]
if _quiet == False: print '\r',' '*48
else:
if _quiet == False: print 'Querying Package Versions ... Please Wait!',
pmq = sp.Popen(['/usr/bin/pacman','-Q']+argv, stdout=sp.PIPE, stderr=sp.STDOUT).stdout.readlines()
for line in pmq:
if line[:6] == 'error:': continue
line = line.rstrip().split(' ')
instl[line[0]] = line[1]
reg = re.compile('\nVersion.*\n')
for inst in instl:
pmsi = sp.Popen(['/usr/bin/pacman','-Si', inst], stdout=sp.PIPE, stderr=sp.STDOUT).stdout.read()
if pmsi[:6] == 'error:': continue
avail[inst] = reg.search(pmsi).group().split(':')[1].strip()
if _quiet == False: print '\r',' '*48
if _quiet == False:
print '%32s%18s%18s' % ('Package','Installed','Available')
print '%32s%18s%18s' % ('-------','---------','---------')
if len(instl) > 0:
if '-a' in sys.argv or '--all' in sys.argv:
for pkg in instl:
print '%32s%18s%18s' % (pkg, instl[pkg], avail.get(pkg,'unknown'))
else:
if '-i' in sys.argv or '--in-repos' in sys.argv: _ir = True
else: _ir = False
for pkg in instl:
ipver = instl[pkg]
apver = avail.get(pkg,'unknown')
if ipver != apver:
if _ir == True and apver != 'unknown':
print '%32s%18s%18s' % (pkg, ipver, apver)
elif _ir == False:
print '%32s%18s%18s' % (pkg, ipver, apver)
Last edited by raeven (2007-05-23 09:53:04)
Offline
Hi raeven,
thanks a lot. That is what I've missed .
delco
Last edited by delco (2007-05-23 19:44:15)
Offline
yw was good practice ... and fun ...
Offline