Bug 6986

Summary: Make legal-info fails on uboot versions before 2014.01
Product: buildroot Reporter: Matthew Starr <mstarr>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: buildroot, mstarr
Priority: P5    
Version: 2014.02   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target:
Build:

Description Matthew Starr 2014-03-24 19:36:47 UTC
In buildroot 2014.02, selecting U-Boot version as custom and then entering a version before 2014.01 results in 'make legal-info' failing with the following message:

build/uboot-2013.07/Licenses/gpl-2.0.txt: No such file or directory

This appears to be a change made in the following commit:
http://git.buildroot.net/buildroot/commit/boot/uboot/uboot.mk?id=eb9b1f50281b4e0c3363923d461d57a165e8be15

Can this be changed to look for the COPYING file at the root of the uboot directory for versions before 2014.01 and use the new Licenses/gpl-2.0.txt for version 2014.01 and after?
Comment 1 Peter Korsgaard 2014-03-24 20:20:09 UTC
Hi,

It would indeed be nice to handle this more gracefully, but that's unfortunately not currently possible with the legal-info infrastructure.

The fact that it fails when the license file isn't available is quite nice for testing, as the autobuilders very soon informs us of the failure (mistyped license file, a package with a license change in a new version), but for the end user a warning would be nicer.
Comment 2 Matthew Starr 2014-03-24 20:35:11 UTC
(In reply to comment #1)
> Hi,
> 
> It would indeed be nice to handle this more gracefully, but that's
> unfortunately not currently possible with the legal-info infrastructure.
> 
> The fact that it fails when the license file isn't available is quite nice for
> testing, as the autobuilders very soon informs us of the failure (mistyped
> license file, a package with a license change in a new version), but for the
> end user a warning would be nicer.

Could the boot/uboot/uboot.mk file be updated to look for the existence of the Licenses/gpl-2.0.txt file and if it doesn't exist look for the COPYING file?  If the COPYING file is also not present then fail.
Comment 3 Peter Korsgaard 2014-03-25 07:31:15 UTC
Like I mentioned above, this is currently not possible with the legal info infrastructure. Some packages have multiple license files, so it's difficult to come up with a simple syntax for optional filenames.

Instead I have fixed it for u-boot by simply copying the license file from the old location to the new after extracting it:

commit 2e628372d34d9e77727185aaf47c82a439a22244
Author: Peter Korsgaard <peter@korsgaard.com>
Date:   Tue Mar 25 07:18:15 2014 +0100

    uboot: unbreak legal info for legacy versions
    
    Fixes #6986
    
    Prior to u-boot 2013.10, the GPL license text was stored in COPYING and not
    Licenses/gpl-2.0.txt, breaking legal-info.
    
    Work around it by simply copying the file from the old location to the new
    if present.
    
    Signed-off-by: Peter Korsgaard <peter@korsgaard.com>

That commit should apply cleanly to 2014.02. Thanks!
Comment 4 Matthew Starr 2014-03-25 13:25:39 UTC
That would work great.  Thanks.