Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 71265 - [BUGFIX] New fixlafile.awk rewrited in python
Summary: [BUGFIX] New fixlafile.awk rewrited in python
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High major (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 64112 75850 75940 78598 79051 84440 87141 90292 90608 93306 104443 124980 (view as bug list)
Depends on:
Blocks: 73435
  Show dependency tree
 
Reported: 2004-11-15 02:42 UTC by Simone Gotti (RETIRED)
Modified: 2006-06-01 16:17 UTC (History)
21 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/usr/lib/portage/bin/fixlafiles.py (fixlafiles.py,8.46 KB, text/plain)
2004-11-15 02:43 UTC, Simone Gotti (RETIRED)
Details
portage_contents.py-20041114-01.patch (portage_contents.py-20041114-01.patch,3.12 KB, patch)
2004-11-15 02:44 UTC, Simone Gotti (RETIRED)
Details | Diff
fix_libtool_files.sh.patch (fix_libtool_files.sh.patch,2.47 KB, patch)
2004-11-15 02:44 UTC, Simone Gotti (RETIRED)
Details | Diff
fixlafiles.py (fixlafiles.py,8.96 KB, text/plain)
2004-11-25 16:37 UTC, Simone Gotti (RETIRED)
Details
portage_contents.py-20041125-01.patch (portage_contents.py-20041125-01.patch,5.86 KB, patch)
2004-11-25 16:38 UTC, Simone Gotti (RETIRED)
Details | Diff
(alternative fix) fix_contents (fix_contents,6.68 KB, text/plain)
2005-04-27 07:03 UTC, TGL
Details
(alternative fix) fixlafiles.awk--fix_CONTENTS.patch (fixlafiles.awk--fix_CONTENTS.patch,867 bytes, patch)
2005-04-27 07:04 UTC, TGL
Details | Diff
fix_libtool_files.sh.patch (fix_libtool_files.sh.patch,2.56 KB, patch)
2005-05-07 19:51 UTC, Ryan Hill (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simone Gotti (RETIRED) gentoo-dev 2004-11-15 02:42:04 UTC
The program fix_libtool_files.sh and the called one fixlafile.awk have a MAJOR problem: they change of course the md5 and mtime of the .la files but don't update the portage database (CONTENTS files). So an "emerge -C foo" won't remove this changed files and this will bring to an unclean system and problems with some apps.

To fix this in a cleaner way I did some things:

1) Added a class to portage_contents.py that let you manage CONTENTS file, get and edit the file properties like md5 and mtime.

2) We needed an "atomic" file update. Every time we change an .la file we have to updated the CONTENTS file that own that .la file. Doing this at the end of all the changes is ugly and less functional.
For this reason I had to rewrite fixlafile.awk in python so I can add the functions provided by portage_contents.sh

3) On Travis Tilley request: removed the need to pass an OLDVER variabile to fix_libtool_file.sh, now every version that is different from the gcc current one is updated (this need some testing please).

By now, fix_libtools_file.sh is used again and it'll call /usr/lib/python/bin/fixlafiles.py, probably it can be removed and fixlafiles.py can be called directly.

I'll attach the new fixlafile.py, and patched against portage_contents.py and fix_libtool_files.sh
Comment 1 Simone Gotti (RETIRED) gentoo-dev 2004-11-15 02:43:34 UTC
Created attachment 43982 [details]
/usr/lib/portage/bin/fixlafiles.py
Comment 2 Simone Gotti (RETIRED) gentoo-dev 2004-11-15 02:44:07 UTC
Created attachment 43983 [details, diff]
portage_contents.py-20041114-01.patch
Comment 3 Simone Gotti (RETIRED) gentoo-dev 2004-11-15 02:44:37 UTC
Created attachment 43984 [details, diff]
fix_libtool_files.sh.patch
Comment 4 Simone Gotti (RETIRED) gentoo-dev 2004-11-25 16:37:27 UTC
Created attachment 44757 [details]
fixlafiles.py

Better script, remove all the bashism, updated the CONTENTS only if the md5 and
mtime registered in the CONTENTS are the same of the file.
Comment 5 Simone Gotti (RETIRED) gentoo-dev 2004-11-25 16:38:44 UTC
Created attachment 44758 [details, diff]
portage_contents.py-20041125-01.patch

Now the contentsManager class can also act as a dict.
Uses the same CONTENTS parsing used in portage.py.
Comment 6 Simone Gotti (RETIRED) gentoo-dev 2004-12-09 07:52:16 UTC
*** Bug 64112 has been marked as a duplicate of this bug. ***
Comment 7 Gregorio Guidi (RETIRED) gentoo-dev 2004-12-28 03:30:00 UTC
*** Bug 75850 has been marked as a duplicate of this bug. ***
Comment 8 Gregorio Guidi (RETIRED) gentoo-dev 2004-12-29 11:39:11 UTC
*** Bug 75940 has been marked as a duplicate of this bug. ***
Comment 9 SpanKY gentoo-dev 2005-01-18 16:30:28 UTC
*** Bug 78598 has been marked as a duplicate of this bug. ***
Comment 10 Simone Gotti (RETIRED) gentoo-dev 2005-01-26 06:33:05 UTC
*** Bug 79051 has been marked as a duplicate of this bug. ***
Comment 11 Gregorio Guidi (RETIRED) gentoo-dev 2005-03-07 14:51:13 UTC
*** Bug 84440 has been marked as a duplicate of this bug. ***
Comment 12 Carsten Lohrke (RETIRED) gentoo-dev 2005-03-29 10:36:03 UTC
*** Bug 87141 has been marked as a duplicate of this bug. ***
Comment 13 Sven Wegener gentoo-dev 2005-04-24 14:56:52 UTC
*** Bug 90292 has been marked as a duplicate of this bug. ***
Comment 14 Carsten Lohrke (RETIRED) gentoo-dev 2005-04-27 06:22:35 UTC
*** Bug 90608 has been marked as a duplicate of this bug. ***
Comment 15 TGL 2005-04-27 07:02:29 UTC
Oops, sorry for having added to an already long list of duplicates...

Anyway, since i've wrote my own solution now, i will re-attach it here. Don't get me wrong, i don't claim it's better than Simone's one... at the contrary, i can only welcome the idea of some awk to python rewriting :)
But it has the benefit to be non-intrusive, so maybe it could be used as a temporary fix or something like that.
Comment 16 TGL 2005-04-27 07:03:51 UTC
Created attachment 57386 [details]
(alternative fix) fix_contents

This is an helper script to update the CONTENTS files.
Comment 17 TGL 2005-04-27 07:04:56 UTC
Created attachment 57387 [details, diff]
(alternative fix) fixlafiles.awk--fix_CONTENTS.patch

And this is a small patch for the awk code to call it.
Comment 18 Jason Stubbs (RETIRED) gentoo-dev 2005-04-28 21:44:42 UTC
$ grep /lib/rcscripts/awk/fixlafiles.awk /var/db/pkg/*/*/CONTENTS
/var/db/pkg/sys-devel/gcc-3.4.3.20050110-r2/CONTENTS:obj /lib/rcscripts/awk/fixlafiles.awk c8fd3851ccee57651e43cac458dba7c1 1113754816

Why is this assigned directly to portage?

Toolchain, can these scripts be verified please?
Comment 19 Ryan Hill (RETIRED) gentoo-dev 2005-05-07 19:51:28 UTC
Created attachment 58311 [details, diff]
fix_libtool_files.sh.patch

original patch bit-rotted.
Comment 20 Markus Tacker 2005-06-02 04:18:04 UTC
*** Bug 93306 has been marked as a duplicate of this bug. ***
Comment 21 Carsten Lohrke (RETIRED) gentoo-dev 2005-09-01 15:42:34 UTC
*** Bug 104443 has been marked as a duplicate of this bug. ***
Comment 22 Carsten Lohrke (RETIRED) gentoo-dev 2005-11-20 07:33:26 UTC
This is really a problem for users dealing with stale files, resulting e.g. in 


grep /usr/lib/libfoo.la: No such file or directory
/bin/sed: can't read /usr/lib/libfoo.la: No such file or directory
libtool: link: `/usr/lib/libfoo.la` is not a valid libtool archive. 


errors. This bug is now open for over a year, what holds us back to fix this?
Comment 23 Ryan Hill (RETIRED) gentoo-dev 2005-11-26 19:56:26 UTC
if this isn't getting looked at, could we at least get the current
fix_libtool_files.sh to not touch mtimes or update the portage db with new
mtimes & checksums? (bug #78597, bug #90292, and bug #87141)
Comment 24 Ryan Hill (RETIRED) gentoo-dev 2005-11-26 19:57:50 UTC
(In reply to comment #23)

> mtimes & checksums? (bug #78597, bug #90292, and bug #87141)

er, bug #78598 that is.

Comment 25 Mark Loeser (RETIRED) gentoo-dev 2005-12-15 00:53:22 UTC
What we do here is going to depend on what we decide with regards to bug #90744
Comment 26 SpanKY gentoo-dev 2006-02-19 15:19:13 UTC
we're getting rid of this stuff
Comment 27 SpanKY gentoo-dev 2006-03-04 20:17:16 UTC
*** Bug 124980 has been marked as a duplicate of this bug. ***