Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4015.1796096959624805033 for ; Mon, 30 Nov 2026 19:49:19 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@konsulko.com header.s=google header.b=GgnZ2Y6I; spf=pass (domain: konsulko.com, ip: 209.85.214.180, mailfrom: tim.orling@konsulko.com) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2f0634667aaso43578125ad.0 for ; Mon, 30 Nov 2026 19:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1796096959; x=1796701759; darn=lists.openembedded.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uCi6NGdQOPYA+uw+n5bV1vWrqSHtKLCyLzDWkHsjdpc=; b=GgnZ2Y6IVSpUeKDiOscMdoFAmH4d/A5mtG5Piu7GSuz2rwOiQ2Awwyc8OX3/LzysXE r5siKodyhkYZ/XqM6E+1Xq916Puu7c8Hs0Nms0UpASfaY3SOF/taez5e7RNl2pcFzQji qwXvhdLetByyDUxy/aPYQS1+qZj49MDttU9ro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796096959; x=1796701759; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=uCi6NGdQOPYA+uw+n5bV1vWrqSHtKLCyLzDWkHsjdpc=; b=V4fn7JMsz/2aBrEbSZrDSHxRZtFl7gE92wNOwdaWUIf95aUgADamnX01q9UN6847kD 0jonN9H2Ug5ZKbg3EOWowcAylWhWstXLccIgCbZBFqeQTwLiFI/e3QcFLDcIpOXxEfzo qGalW6tN+S4WWlS7aFqZy0rnQ1sEqSY2QQULmYUoge7iAvGLFcnSGw1U+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:1a43:b0:2ed:3032:ec21 with SMTP id d9443c01a7336-2f03f1b9c14mr266299725ad.21.1796096958629; Mon, 30 Nov 2026 19:49:18 -0800 (PST) Return-Path: Received: from localhost (c-24-20-171-118.hsd1.or.comcast.net. [24.20.171.118]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2f03ee84425sm177662485ad.6.2026.11.30.19.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 19:49:18 -0800 (PST) From: Tim Orling To: openembedded-core@lists.openembedded.org Cc: Tim Orling , Bruce Ashfield Subject: [PATCH 2/7] licensecheck: add recipe Date: Mon, 30 Nov 2026 19:49:05 -0800 Message-ID: <20261201034910.25521-3-tim.orling@konsulko.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261201034910.25521-1-tim.orling@konsulko.com> References: <20261201034910.25521-1-tim.orling@konsulko.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Tue, 01 Dec 2026 03:49:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251658 Content-Type: text/plain; charset="utf-8" Add licensecheck 0.3.1, the license detection library that pkg.go.dev uses, for go-mod-update-modules. main.go is a small front end that prints, as JSON, the licenses found in each file and how much of the file they cover. The library is BSD-3-Clause; main.go is MIT. AI-Generated: Claude Fable 5.2 (maintainers.inc entry, CVE_PRODUCT) Signed-off-by: Tim Orling --- meta/conf/distro/include/maintainers.inc | 1 + .../licensecheck/files/main.go | 49 +++++++++++++++++++ .../licensecheck/licensecheck_0.3.1.bb | 31 ++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 meta/recipes-devtools/licensecheck/files/main.go create mode 100644 meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index 62de04001e..8024be3383 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -473,6 +473,7 @@ RECIPE_MAINTAINER:pn-libxvmc = "Unassigned " RECIPE_MAINTAINER:pn-libxxf86vm = "Unassigned " RECIPE_MAINTAINER:pn-libyaml = "Wang Mingyu " RECIPE_MAINTAINER:pn-libzip = "Igor Opaniuk " +RECIPE_MAINTAINER:pn-licensecheck = "Tim Orling " RECIPE_MAINTAINER:pn-lighttpd = "Unassigned " RECIPE_MAINTAINER:pn-linux-dummy = "Unassigned " RECIPE_MAINTAINER:pn-linux-firmware = "Vivek Puar " diff --git a/meta/recipes-devtools/licensecheck/files/main.go b/meta/recipes-devtools/licensecheck/files/main.go new file mode 100644 index 0000000000..5b38107af7 --- /dev/null +++ b/meta/recipes-devtools/licensecheck/files/main.go @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: MIT +// +// Command licensecheck prints the licenses that github.com/google/licensecheck +// finds in each file, one JSON object per file. +package main + +import ( + "encoding/json" + "fmt" + "os" + + "github.com/google/licensecheck" +) + +type match struct { + ID string `json:"id"` + Start int `json:"start"` + End int `json:"end"` + IsURL bool `json:"url,omitempty"` +} + +type result struct { + File string `json:"file"` + Percent float64 `json:"percent"` + Matches []match `json:"matches"` + Error string `json:"error,omitempty"` +} + +func main() { + if len(os.Args) < 2 { + fmt.Fprintln(os.Stderr, "usage: licensecheck FILE...") + os.Exit(2) + } + enc := json.NewEncoder(os.Stdout) + for _, f := range os.Args[1:] { + r := result{File: f, Matches: []match{}} + data, err := os.ReadFile(f) + if err != nil { + r.Error = err.Error() + } else { + cov := licensecheck.Scan(data) + r.Percent = cov.Percent + for _, m := range cov.Match { + r.Matches = append(r.Matches, match{m.ID, m.Start, m.End, m.IsURL}) + } + } + enc.Encode(r) + } +} diff --git a/meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb b/meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb new file mode 100644 index 0000000000..a8fe6ef22f --- /dev/null +++ b/meta/recipes-devtools/licensecheck/licensecheck_0.3.1.bb @@ -0,0 +1,31 @@ +SUMMARY = "Identify the licenses in license files" +DESCRIPTION = "A command line front end for the Go licensecheck library, which \ +pkg.go.dev uses to detect the licenses of Go modules. For each file, it lists \ +every license that it finds, where in the file, and how much of the file the \ +licenses cover. go-mod-update-modules.bbclass uses it to identify the licenses \ +of Go module dependencies." +HOMEPAGE = "https://github.com/google/licensecheck" +BUGTRACKER = "https://github.com/google/licensecheck/issues" +SECTION = "devel" + +# No CPE in the NVD yet. Name the vendor, as other projects are also +# called licensecheck. +CVE_PRODUCT = "google:licensecheck" + +LICENSE = "BSD-3-Clause AND MIT" +LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=a413d6b3884e141783f23d00d5838777 \ + file://src/${GO_IMPORT}/cmd/licensecheck/main.go;beginline=1;endline=1;md5=6ec41034e04432ee375d0e14fba596f4" + +SRC_URI = "git://github.com/google/licensecheck;protocol=https;nobranch=1;destsuffix=${GO_SRCURI_DESTSUFFIX} \ + file://main.go;subdir=${GO_SRCURI_DESTSUFFIX}/cmd/licensecheck" +SRCREV = "16aaea36649f556bae5a5ee972c247f58a0de1c4" + +GO_IMPORT = "github.com/google/licensecheck" +GO_INSTALL = "${GO_IMPORT}/cmd/licensecheck" + +# The library only uses the standard library +export GO111MODULE = "off" + +inherit go + +BBCLASSEXTEND = "native" -- 2.56.1