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 > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 12-30-2007, 04:50 PM
Petteri Räty
 
Default Running a script to remove useless deps like virtual/libc from ebuilds

I have a script coming up that can remove virtual/libc dependencies from
ebuilds automatically but can this be done safely for all ebuilds are
are there ebuilds in system that really need this dep for stage building
etc? Are there other deps to like this that could be removed? At least
sys-libs/zlib could be one. Attached is a version that prints a unified
diff for the changes my script would make.

Regards,
Petteri
#!/usr/bin/python
from __future__ import with_statement
import portage
from fnmatch import filter
import os
import re
import sys
from contextlib import nested
from difflib import unified_diff

dep_start = re.compile('^R?DEPEND.*')
ws_re = re.compile('^s*$')
dep_end = re.compile('.*"$')

for root, dirs, files in os.walk(portage.settings['PORTDIR']):
for ebuild in filter(files, '*.ebuild'):
path = os.path.join(root, ebuild)
print path
with nested(open(path), os.tmpfile()) as (f,tmp):
in_dep = False
lines = f.readlines()
new = []
for line in lines:
if dep_start.match(line):
in_dep = True
if in_dep:
if dep_end.match(line):
in_dep = False
if line.find('virtual/libc') is not -1:
line = line.replace('virtual/libc',')
if not ws_re.match(line):
tmp.write(line)
new.append(line)
else:
tmp.write(line)
new.append(line)
else:
tmp.write(line)
new.append(line)

sys.stdout.writelines(unified_diff(lines, new))
 
Old 12-31-2007, 08:18 AM
"Denis Dupeyron"
 
Default Running a script to remove useless deps like virtual/libc from ebuilds

On Dec 30, 2007 6:50 PM, Petteri Räty <betelgeuse@gentoo.org> wrote:
> I have a script coming up that can remove virtual/libc dependencies from
> ebuilds automatically but can this be done safely for all ebuilds are
> are there ebuilds in system that really need this dep for stage building
> etc?

FWIW:
"However, packages which are included in the system target, or are
dependencies of system target packages, should generally include a
complete dependency list (excluding bootstrap packages). This makes
emerge -e system possible when installing from a stage 1 or stage 2
tarball."

From the last paragraph on implicit dependencies in the devmanual at:
http://devmanual.gentoo.org/general-concepts/dependencies/index.html

> Are there other deps to like this that could be removed? At least
> sys-libs/zlib could be one.

I suppose all packages in /usr/portage/profiles/base/packages are
suitable candidates. And maybe profile-specific implicit dependencies
on profile-specific packages too, but those would be more complicated
to locate.

Denis.
 

Thread Tools




All times are GMT. The time now is 07:54 AM.

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