Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 405017 - sys-apps/portage: repoman warns about Invalid Gentoo Copyright when file hasn't been modified in current year
Summary: sys-apps/portage: repoman warns about Invalid Gentoo Copyright when file hasn...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Portage team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-02-20 12:21 UTC by Pacho Ramos
Modified: 2022-07-12 03:18 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pacho Ramos gentoo-dev 2012-02-20 12:21:17 UTC
I was getting:

  ebuild.badheader              1
   net-libs/telepathy-glib/telepathy-glib-0.16.5.ebuild: Invalid Gentoo Copyright on line: 1


And it was simply caused by needing to change "2011" year to "2012"... wouldn't be better to get trivial things like this fixed automatically when committing?

Thanks a lot

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2012-02-20 12:29:16 UTC
We've already got some code to update the header for new or modified files, so at least for those files, we can skip the warning.
Comment 2 Matt Turner gentoo-dev 2013-08-16 18:28:10 UTC
The problem I see -- maybe it's different -- is that repoman complains about "invalid copyright" when the copyright date isn't the current year, even when the file hasn't been modified in the current year.

Take for instance x11-drivers/xf86-video-neomagic:

Last modification:

  28 Dec 2012; Agostino Sarubbo <ago@gentoo.org>
  xf86-video-neomagic-1.2.7.ebuild:
  Stable for ia64, wrt bug #440872

  ebuild.badheader              3
   x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.5.ebuild: Invalid Gentoo Copyright on line: 1
   x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.6.ebuild: Invalid Gentoo Copyright on line: 1
   x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.7.ebuild: Invalid Gentoo Copyright on line: 1

These are simply wrong. I think in fact asserting 2013 copyright on a file that hasn't been modified since 2012 is wrong. I also feel confident that asserting copyright 1999- is wrong for files created in 2012 is also wrong, but a separate issue.
Comment 3 Zac Medico gentoo-dev 2013-08-16 19:25:59 UTC
Repoman is using the modification time from the filesystem, which does not necessarily correspond to the time that the file was last modified in the vcs. So, we want repoman to query the time from the vcs instead.
Comment 4 Pacho Ramos gentoo-dev 2014-02-02 08:44:29 UTC
I see repoman is able to fix the copyright year already:
--- ./light-themes-0.1.93-r3.ebuild
+++ ./light-themes-0.1.93-r3.ebuild
@@ -1 +1 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation

In that case, why don't simply drop the warning when it's referring to a year change that repoman will fix automatically then?
Comment 5 Matt Turner gentoo-dev 2015-05-23 19:43:35 UTC
(In reply to Pacho Ramos from comment #4)
> I see repoman is able to fix the copyright year already:
> --- ./light-themes-0.1.93-r3.ebuild
> +++ ./light-themes-0.1.93-r3.ebuild
> @@ -1 +1 @@
> -# Copyright 1999-2013 Gentoo Foundation
> +# Copyright 1999-2014 Gentoo Foundation
> 
> In that case, why don't simply drop the warning when it's referring to a
> year change that repoman will fix automatically then?

That sounds like a good plan.
Comment 6 Pacho Ramos gentoo-dev 2016-01-31 17:23:46 UTC
(In reply to Zac Medico from comment #1)
> We've already got some code to update the header for new or modified files,
> so at least for those files, we can skip the warning.

I think this is no longer working, maybe due to the git migration :/
Comment 7 Zac Medico gentoo-dev 2016-01-31 18:04:14 UTC
(In reply to Pacho Ramos from comment #6)
> (In reply to Zac Medico from comment #1)
> > We've already got some code to update the header for new or modified files,
> > so at least for those files, we can skip the warning.
> 
> I think this is no longer working, maybe due to the git migration :/

Yeah, file modification times are completely ignored for git, since they correspond to the time that the file was locally checked out.
Comment 8 Pacho Ramos gentoo-dev 2016-01-31 18:13:38 UTC
Why is not correct to simply update all the headers of files provided in the repo to the year we are? :/ I guess it's for some kind of "legal" reason?
Comment 9 Zac Medico gentoo-dev 2016-01-31 18:50:00 UTC
(In reply to Pacho Ramos from comment #8)
> Why is not correct to simply update all the headers of files provided in the
> repo to the year we are? :/ I guess it's for some kind of "legal" reason?

My understanding of US law is that copyrighted works enter public domain after 95 years. Therefore, it is inappropriate to update the copyright date unless the content has changed somehow.
Comment 10 Pacho Ramos gentoo-dev 2016-01-31 18:56:54 UTC
Then, cannot repoman take the year from "date" command or similar to know that we are in 2016 and fix the Copyright as it did before but now without relying on CVS for that? :/
Comment 11 Zac Medico gentoo-dev 2016-01-31 19:33:48 UTC
The copyright update code is currently called from the UpdateChangeLog function, which is not called unless the repo has changelogs enabled. So, we'll to move this code to the Actions class and call it unconditionally:

	for fn in chain(new, changed):
		if fn.endswith('.diff') or fn.endswith('.patch'):
			continue
		update_copyright(os.path.join(pkgdir, fn), year, pretend=pretend)
Comment 12 Brian Dolbec (RETIRED) gentoo-dev 2016-01-31 20:09:36 UTC
OK, Zac, I just force pushed some more fixes, changes to the repoman branch.

Do you want to add that patch?
Comment 13 Zac Medico gentoo-dev 2016-02-01 07:58:51 UTC
(In reply to Brian Dolbec from comment #12)
> OK, Zac, I just force pushed some more fixes, changes to the repoman branch.
> 
> Do you want to add that patch?

Yeah, I've pushed these two patches to the repoman branch:

https://gitweb.gentoo.org/proj/portage.git/commit/?h=repoman&id=a6a50adf336ca98044f0f981fad77efde078daef
https://gitweb.gentoo.org/proj/portage.git/commit/?h=repoman&id=37e0e67a673286f519a689586087960505898c43

Tested with pym/portage/tests/repoman/test_simple.py and it works.
Comment 14 Pacho Ramos gentoo-dev 2016-02-01 19:27:27 UTC
Thanks a lot :)
Comment 15 Zac Medico gentoo-dev 2016-03-14 02:00:35 UTC
I don't see these patches in the repoman branch anymore, but they're here if needed:

https://github.com/zmedico/portage/tree/bug_405017
Comment 16 Zac Medico gentoo-dev 2017-06-29 17:06:13 UTC
The update_copyright fix was included in repoman 2.3.0:

https://gitweb.gentoo.org/proj/portage.git/commit/?id=32399303c9c8b8965c9cd8a10fd6c87542d01bc3
Comment 17 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 03:18:25 UTC
repoman support has been removed per bug 835013.

Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.