Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 326747 - [PATCH] repoman check for deprecated eclasses
Summary: [PATCH] repoman check for deprecated eclasses
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL: http://dev.gentoo.org/~wired/patches/...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 335925
  Show dependency tree
 
Reported: 2010-07-03 16:46 UTC by Alex Alexander (RETIRED)
Modified: 2010-09-09 11:38 UTC (History)
4 users (show)

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


Attachments
repoman check for deprecated eclasses (0001-repoman-check-for-deprecated-eclasses.patch,3.46 KB, patch)
2010-07-03 16:47 UTC, Alex Alexander (RETIRED)
Details | Diff
updated patch with eclass deprecation check (0001-repoman-check-for-deprecated-eclasses.patch,3.46 KB, patch)
2010-08-14 22:59 UTC, Alex Alexander (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Alexander (RETIRED) gentoo-dev 2010-07-03 16:46:41 UTC
I've written a repoman check that looks for ebuilds using deprecated eclasses.

The need came up in the Qt herd. At some point we rolled out a second version of our main eclass, however migration to it has been rather slow.

Hopefully this check will make more devs aware of the need to migrate.

The check accepts a list of deprecated eclasses and their replacements, if any, so it can be used for other eclasses as well :)

Thanks :)
Comment 1 Alex Alexander (RETIRED) gentoo-dev 2010-07-03 16:47:45 UTC
Created attachment 237365 [details, diff]
repoman check for deprecated eclasses
Comment 2 Sebastian Luther (few) 2010-07-03 17:15:23 UTC
1) Your check() looks a bit bogus. It looks to me like something like that would suffice:
+	def check(self, num, line):
+		pass

2) The longest line in end() could use some white spaces ("+i+" -> "+ i +") and a line break.

3) The qt4.eclass misses a deprecation notice.

4) The following eclass are marked as deprecated:

"ruby": "ruby-ng",
"qt3": 0,
"gems": "ruby-fakegem",
"ruby-gnome2": "ruby-ng-gnome2",
"php-pear": "php-pear-r1"

It would be nicer if this the list wouldn't be hard coded, but I guess it's not that easy.

Other than that, looks good. :)
Comment 3 Sebastian Luther (few) 2010-07-03 17:21:43 UTC
(In reply to comment #2)
> It would be nicer if this the list wouldn't be hard coded, but I guess it's not
> that easy.

Maybe one could agree on a standard header for deprecated eclasses that could be found by a regex. Something like:

for eclasses without replacement:
# @DEAD

for eclasses with replacement:
# @DEPRECATED <new-eclass>

CCing QA and release for consideration.
Comment 4 Alex Alexander (RETIRED) gentoo-dev 2010-08-14 22:59:01 UTC
Created attachment 242991 [details, diff]
updated patch with eclass deprecation check

Sorry for the delay. I've fixed all your points :)
Comment 5 Alec Warner archtester Gentoo Infrastructure gentoo-dev Security 2010-08-15 01:29:54 UTC
(In reply to comment #4)
> Created an attachment (id=242991) [details]
> updated patch with eclass deprecation check
> 
> Sorry for the delay. I've fixed all your points :)
> 

Why is this a LineCheck at all?  This is just a metadata check.

if bad_eclasses in metadata['INHERITED'] ....

-A
Comment 6 Tomáš Chvátal (RETIRED) gentoo-dev 2010-08-15 08:38:08 UTC
Please add to your list x-modular -> xorg-2

Other than that the patch looks good :)
Comment 7 Diego Elio Pettenò (RETIRED) gentoo-dev 2010-08-21 20:59:46 UTC
Ruby team would love to see this soon :)
Comment 8 Zac Medico gentoo-dev 2010-08-21 21:01:19 UTC
(In reply to comment #5)
> Why is this a LineCheck at all?  This is just a metadata check.
> 
> if bad_eclasses in metadata['INHERITED'] ....

Maybe do both. Do we care to distinguish between direct and indirect inherits?
Comment 9 Tomáš Chvátal (RETIRED) gentoo-dev 2010-08-21 21:20:20 UTC
(In reply to comment #8)
> (In reply to comment #5)
> > Why is this a LineCheck at all?  This is just a metadata check.
> > 
> > if bad_eclasses in metadata['INHERITED'] ....
> 
> Maybe do both. Do we care to distinguish between direct and indirect inherits?
> 

We should probably distinguish about them and just warn when using eclass with bad inherit and die when using the bad inherit directly (eclasses are fixed slowly than ebuilds :))
Comment 10 Zac Medico gentoo-dev 2010-08-22 20:13:41 UTC
(In reply to comment #4)
> Created an attachment (id=242991) [details]
> updated patch with eclass deprecation check

Thanks, that's in git:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6bfbbbefc91069cb4244cf5a5462e6cef3cef3e6

(In reply to comment #5)
> Why is this a LineCheck at all?  This is just a metadata check.

Support for direct inherits with line numbers:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c810b639133301f605eabb1c9644d05cc0ff515a

Support for indirect inherits, with errors indicating indirect nature:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=93ceaa213a10df814de8e893f4312dc43e2047c4
Comment 11 Zac Medico gentoo-dev 2010-09-09 11:24:21 UTC
This is fixed in 2.1.9 and 2.2_rc68.
Comment 12 Zac Medico gentoo-dev 2010-09-09 11:38:32 UTC
(In reply to comment #6)
> Please add to your list x-modular -> xorg-2

This is in git now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9cf77a6c178f435e6747b1d6ab8d6757955e46f2