Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 118605 - [PATCH] repoman date checking fixes for each new year.
Summary: [PATCH] repoman date checking fixes for each new year.
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Repoman (show other bugs)
Hardware: All Linux
: High normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-10 19:20 UTC by Alec Warner (RETIRED)
Modified: 2009-01-30 03:42 UTC (History)
2 users (show)

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


Attachments
Changes the date check to check the cvs header. (repoman-date-fix.patch,1.56 KB, patch)
2006-01-10 19:21 UTC, Alec Warner (RETIRED)
Details | Diff
The first patch sucked, this one is an improvement, with better date checking at commit time. (repoman-date-fix.patch,3.85 KB, patch)
2006-01-15 23:06 UTC, Alec Warner (RETIRED)
Details | Diff
sigh, lets remove the debug printing this time ;) (repoman-date-fix.patch,3.78 KB, patch)
2006-01-15 23:08 UTC, Alec Warner (RETIRED)
Details | Diff
same patch with fix for the traceback reported (repoman-date-fix.patch,3.92 KB, patch)
2006-01-17 09:28 UTC, Alec Warner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-10 19:20:45 UTC
Repoman likes to check ebuild headers, compares the date in the gentoo copyright to the mtime of the file.  As pointed out by halcy0n this is retarded as every year around this time every ebuild has this "error" where the date is wrong.  Thats great, but why not check something that we care about, like the CVS header?  That way if the header was last modified in 2006, then the gentoo copyright should be 2006.

Patch that checks CVS header against gentoo-copyright forthcoming.
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-10 19:21:32 UTC
Created attachment 76802 [details, diff]
Changes the date check to check the cvs header.
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-15 23:06:38 UTC
Created attachment 77232 [details, diff]
The first patch sucked, this one is an improvement, with better date checking at commit time.

This bug also filters ebuilds checked at commit time, to only those valid for the commit ( removed, added, changed ).  This is to get the time check correct for ebuilds during the commit phase, without checking all .ebuild files in the current directory.
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-15 23:08:32 UTC
Created attachment 77233 [details, diff]
sigh, lets remove the debug printing this time ;)
Comment 4 Paul Varner (RETIRED) gentoo-dev 2006-01-17 05:58:14 UTC
Received the following traceback when running repoman commit

Traceback (most recent call last):
  File "/usr/bin/repoman", line 882, in ?
    if os.stat(checkdir+"/"+y+".ebuild")[0] & 0x0248:
OSError: [Errno 2] No such file or directory: '/home/pvarner/cvsroot-gentoo/gentoo-x86/net-libs/courier-authlib/./courier-authlib-0.58.ebuild.ebuild'
Comment 5 Marius Mauch (RETIRED) gentoo-dev 2006-01-17 08:17:10 UTC
Maybe i'm dumb, but someone can point out the bug here? Sounds like correct behavior to me. Checking the CVS header instead would actually create a bug as you would only get a warning once the error has been committed already.
Comment 6 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-17 09:15:41 UTC
(In reply to comment #5)
> Maybe i'm dumb, but someone can point out the bug here? Sounds like correct
> behavior to me. Checking the CVS header instead would actually create a bug as
> you would only get a warning once the error has been committed already.
> 

Well the current behavior relies on mtimes...so fex this year the mtimes of the files are all 2005, but the date is 2006, so you get warnings on EVERY file.  That is obviously wrong.

This patch addresses that issue by comparing to the CVS header.  As you said, that creates a secondary issue where the cvs header is updated at commit time and the check cannot be performed.  I cheat around this by adding a check at commit time ( if repoman --commit then.. ) and check the date anyway.  So during  reopman commit it will fail telling you that the copyright header date is not of the current year, and that you should fix it.
Comment 7 Alec Warner (RETIRED) archtester gentoo-dev Security 2006-01-17 09:28:05 UTC
Created attachment 77361 [details, diff]
same patch with fix for the traceback reported

Made the mistake of not parsing the output from cvs tree.  It should now strip out non-ebuild components as well as strip the .ebuild from things so that the traceback does not occur.
Comment 8 Mark Loeser (RETIRED) gentoo-dev 2006-01-17 09:33:15 UTC
(In reply to comment #5)
> Maybe i'm dumb, but someone can point out the bug here? Sounds like correct
> behavior to me. Checking the CVS header instead would actually create a bug as
> you would only get a warning once the error has been committed already.
> 

Well, Alec almost had it right, but its slightly backwards :)  The problem is if I do a checkout right now, all files will have an mtime of 2006, and as such, I'll get a warning for every single file in the tree that hasn't been updated this year.  Checking it against the Header is the sane way to tell if it has in fact been updated, but not had the copyright year updated.  The commit issue has to be worked around by checking at commit time if the year is wrong (only sane way I can think of doing it)
Comment 9 Petteri Räty (RETIRED) gentoo-dev 2007-01-10 16:30:26 UTC
Seeing this stuff again with 2007:
  ebuild.badheader               1
   dev-java/jsch/jsch-0.1.30.ebuild: Copyright header Error. Possibly date related.

The only thing I did was to remove two old versions so 0.1.30 should still stay 2006.
Comment 10 Mark Loeser (RETIRED) gentoo-dev 2007-12-17 03:35:43 UTC
Anyone? :)  We are going to hit this again very soon....
Comment 11 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-01-30 03:42:42 UTC
Just found this bug (randomly) and repoman only warns if the mtime and header differ. Closing as fixed.