FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Development

 
 
LinkBack Thread Tools
 
Old 02-23-2009, 08:12 PM
Aaron Griffin
 
Default Scripting large rebuilds

Hey guys,
Does anyone have any scripts that they use for mass-rebuilds (such as
the readline rebuild)? I would like to get more tools of the sort into
devtools, so want to see if anyone has anything existing that I could
import / use for this purpose.

If not, I will write one to do this with makechrootpkg (yay, chroots)
to make this easier.

Cheers,
Aaron
 
Old 02-23-2009, 08:18 PM
Allan McRae
 
Default Scripting large rebuilds

Aaron Griffin wrote:

Hey guys,
Does anyone have any scripts that they use for mass-rebuilds (such as
the readline rebuild)? I would like to get more tools of the sort into
devtools, so want to see if anyone has anything existing that I could
import / use for this purpose.

If not, I will write one to do this with makechrootpkg (yay, chroots)
to make this easier.

Cheers,
Aaron



Not directly but the attached script could be useful. It takes a file of
package names and determines the order they need built. At the moment
it parses pacman output to get depends so it misses makedeps so that
needs fixed.


Can makeworld be adjusted to do what you are looking for?

Allan

#! /usr/bin/env python

import os, sys

def get_deps( package ):
deps = []

pkginfo = os.popen("pacman -Si " + package + " 2> /dev/null").read().split("
")
if pkginfo != [']:
found = False
for i in pkginfo:
if not found:
if i[0:10] == "Depends On":
deplist = i.split()[3:]
found = True
else:
if i[0] != " ":
break
deplist += i.split()

for i in deplist:
pkg = i.split(">")[0].split("<")[0].split("=")[0]
if os.popen("pacman -Si " + pkg + " 2> /dev/null").read().split("
") != [']:
deps.append(pkg)

return deps



rebuild_file = open(sys.argv[1], "r")
rebuild_list = rebuild_file.read().split()

rebuild_deps = {}
package_deps = {}


for i in rebuild_list:
package_deps[i] = get_deps(i)


for package in rebuild_list:
rebuild_deps[package] = package_deps[package][:]

pos = 0
while pos < len(rebuild_deps[package]):
dep = rebuild_deps[package][pos]

if not package_deps.has_key(dep):
package_deps[dep] = get_deps(dep)

for i in package_deps[dep]:
if not i in rebuild_deps[package]:
rebuild_deps[package].append(i)
pos += 1


for package in rebuild_list:
pos = 0
while pos < len(rebuild_deps[package]):
if rebuild_deps[package][pos] in rebuild_list:
pos += 1
else:
rebuild_deps[package].pop(pos)


filtered_deps = {}
for package in rebuild_list:
filtered_deps[package] = rebuild_deps[package][:]
if len(filtered_deps[package]) > 1:
pos=0
while pos < len(filtered_deps[package]) and len(filtered_deps[package]) > 1:
removed = False
for i in filtered_deps[package]:
if filtered_deps[package][pos] in rebuild_deps[i]:
filtered_deps[package].pop(pos)
removed = True
break

if not removed:
pos += 1


for package in rebuild_list:
if len(rebuild_deps[package]) == 0:
print package
else:
rebuild_deps[package].sort()
print package + " (Requires " + ", ".join(["%s" % pkg for pkg in filtered_deps[package]]) +")"
 
Old 02-23-2009, 08:26 PM
Aaron Griffin
 
Default Scripting large rebuilds

On Mon, Feb 23, 2009 at 3:18 PM, Allan McRae <allan@archlinux.org> wrote:
> Aaron Griffin wrote:
>>
>> Hey guys,
>> Does anyone have any scripts that they use for mass-rebuilds (such as
>> the readline rebuild)? I would like to get more tools of the sort into
>> devtools, so want to see if anyone has anything existing that I could
>> import / use for this purpose.
>>
>> If not, I will write one to do this with makechrootpkg (yay, chroots)
>> to make this easier.
>>
>> Cheers,
>> Aaron
>>
>
> Not directly but the attached script could be useful. It takes a file of
> package names and determines the order they need built. At the moment it
> parses pacman output to get depends so it misses makedeps so that needs
> fixed.

Looks neat - might be useful in devtools on its own.

> Can makeworld be adjusted to do what you are looking for?

Hmm probably not. I was thinking something like:
$ omg-rebuilds /path/to/svn/checkout /path/to/chroot/dir -- readline
bash foo bar baz

Or something to that effect, that would not only build all packages in
a chroot, but auto-bump the pkgrels and dump the correct results to
your svn dir, for a later run of testingpkg...
 
Old 02-23-2009, 08:36 PM
Pierre Schmitz
 
Default Scripting large rebuilds

Am Montag, 23. Februar 2009 22:26:36 schrieb Aaron Griffin:
> Or something to that effect, that would not only build all packages in
> a chroot, but auto-bump the pkgrels and dump the correct results to
> your svn dir, for a later run of testingpkg...

Would be ncie to have some helper scripts. I use some dumb scripts to manage
the kde rebuilds: http://git.archlinux.de/build-scripts/tree/kde

Maybe some of those can be extended to be more genereal. Espeically this which
sets pkgver, pkgrel and updates the md5sums: http://git.archlinux.de/build-
scripts/tree/kde/update-pkgbuilds (the awk scripts is stolen from some post of
the forums ;-))

--

Pierre Schmitz


Clemens-August-Straße 76
53115 Bonn

Telefon 0228 9716608
Mobil 0160 95269831
Jabber pierre@jabber.archlinux.de
WWW http://www.archlinux.de
 

Thread Tools




All times are GMT. The time now is 08:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org