From patchwork Fri Dec 16 16:42:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16864 X-Patchwork-Delegate: ticotimo@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9993EC4167B for ; Fri, 16 Dec 2022 16:43:15 +0000 (UTC) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mx.groups.io with SMTP id smtpd.web10.17816.1671208989163067407 for ; Fri, 16 Dec 2022 08:43:09 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LVHYwPY9; spf=pass (domain: gmail.com, ip: 209.85.216.43, mailfrom: ticotimo@gmail.com) Received: by mail-pj1-f43.google.com with SMTP id 3-20020a17090a098300b00219041dcbe9so2902021pjo.3 for ; Fri, 16 Dec 2022 08:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=U0tUS7a8iqdwzUHBAx3K6cLjGEPHqvVqMY6N0SEPOus=; b=LVHYwPY90OXsAF4ClHKMLd7uyaqaUOPsx6/X32tS2hZ1Lfgtb6hi4qXPg/OwTTZ5WX w8icdjWUYPk32LYoh+TFMmFcqEzSCYne99I+7jmulyat/J7O8uxyTK8EjtW7TCZrAdaY d3HQl8be9Lm5LccBIHLIoVIGVzmbLjlNLCb5WqxqY0LnhogaipDxttjFMN0pipuQFZ95 /K6pEB0oLFBwk7m2Vva5+DHUJx0O0PVN0J3RjlI+K8JX8dyCRATWFK3FTRJ9JdSBv0cx 6CB6ewOP66u6S9/Dg/cyTThoCjta75HMFbyXvUOjB8HPMagYj1LlW98q7NDk1ZHpYX2U Rmsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U0tUS7a8iqdwzUHBAx3K6cLjGEPHqvVqMY6N0SEPOus=; b=RNRVftEpbflhJ16Ww12NU/ZTgSKjFX4nKM3ZwXWE+u88v4j8AOhKhPpg64NBupKNmx Im/ciacqTt9dDmV6c4r9id/Bc7xDZjhZRQ0vofuitztk/uE5KNg8jr3lZ/LkrlFvGdSs VSqtMoHHn5IA9RdWUwan1HIDhpXjRXjnrFRqeA4dKqxcEkSeztW0002LCX/otc8WPtwL bac/y5Zvq5p2glW0jz7nHqgw/lHRgH5Gw2drhHb2nGR3MnsNKoq+ZvXYEIZosTnKHPZQ u7b0GuIFGM9BKsQoMa8TILx4Xsj0hCzJTh5HrFdgPdf0o2l9gi2cqHE0LuRB6ZSCHQ3K ebtQ== X-Gm-Message-State: ANoB5pnwUp4XC4hiEg4BsDxlthO3FXogLLSv2PiM8/K57uu+NEpbkku5 pCKAhmwPgAKrCZsrlqfE20rp9LuW12A= X-Google-Smtp-Source: AA0mqf4TlAA7YGB82TjuKJjudj1YFvflSVhIGD8SJX8NnXXWJJt336ATwuWG7V8G4Vkj2Oa19VHUMA== X-Received: by 2002:a17:902:a985:b0:188:6300:5a65 with SMTP id bh5-20020a170902a98500b0018863005a65mr30023452plb.35.1671208988151; Fri, 16 Dec 2022 08:43:08 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:07 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 1/6] Dockerfile: add captcha dependencies Date: Fri, 16 Dec 2022 08:42:50 -0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:15 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58824 From: Michael Halstead The current version of django-simple-captcha requires libz and freetype development libraries. Signed-off-by: Michael Halstead Refactor to apply. Fix typo. Fix previous mixed use of space vs tab. Signed-off-by: Tim Orling --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4b2870a..a6c7ad2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,9 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ python3-mysqldb \ python3-dev \ python3-pil \ - python3-wheel \ + python3-wheel \ + libz-dev \ + libfreetype6-dev \ libjpeg-dev \ libmariadbclient-dev \ locales \ From patchwork Fri Dec 16 16:42:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98ADFC4332F for ; Fri, 16 Dec 2022 16:43:15 +0000 (UTC) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web11.18014.1671208995132770459 for ; Fri, 16 Dec 2022 08:43:15 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=PNcRZNhp; spf=pass (domain: gmail.com, ip: 209.85.214.180, mailfrom: ticotimo@gmail.com) Received: by mail-pl1-f180.google.com with SMTP id x2so2817374plb.13 for ; Fri, 16 Dec 2022 08:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bbM430MS0yHjCjJ2m7+ui/RSmHawPTXHRNVMsVhvivU=; b=PNcRZNhpGLfKpqut7wVrWe+AT4JUFZJqczhzSl7qvHFeVh1JLMXMklLJDp9joe/Qpq ffe3VhIk3gIaNi7J56inCkzLOkLxqR2LERhzrJMmzgIniFk/t7E9VoWweYs4ZqMhf+C2 kiU4QUrVqB2X8nMpGtsoAZ5P2TNEQTeMJgfAB6wTstdXyxGc0xNC4rBXddufjJCtiuy/ 33A0zihffGVsEM0zpMVo+vO4Hq4MsREP0K74jheE48grR60NAs63TXOnThEGYqqH4YUn jeO500J3PeWkJN2oNt5FRYI+QhJBfk1u7v4N98OrvmRJBpqBUPMIsr96UY+4kzK+0vIJ ltEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bbM430MS0yHjCjJ2m7+ui/RSmHawPTXHRNVMsVhvivU=; b=maSo50PRvaIRrk3K8k3p2gcXAM33HYtY86Vi5aF04XZZvsVoYVatKsfBvavhGouSvh DQXzTplBo5QBD9xoCFCiWKwtvZmgXmENRSoTk/cSYf0B1TEy5hsJroMQkSDPywg4wXRH RapiqB/x0AIDtP4h3luZFG3TDcOpcvXlFLiHO20mr/wjIKOHTDFLLmWbZHRi0+YNcNDh JsHqFvPBqpl/2HVNE/1cUsqS5LFZvpj/R7ohjtQRv25yCi6mNsQ3rvpIvuIV67Jm8YZK +EZvhGglWTbtGL01GGPDMYh6oz5uU1vJ9f5FjM0ZJ7XnjYc0DxlY4GU2AliAATXdIQDX qkDQ== X-Gm-Message-State: ANoB5pn+VmrFvC7ie6vr1TvBeKBa2MurMXwIdWreNBBAALalfK7yM/Ln GhWKTMb+XicwTeFQEZTEb7AC4TRUb6c= X-Google-Smtp-Source: AA0mqf76K+Eg/D8k71RPzeSmnBqGr7QK+EUK7QcaAL9kCBsblYdFGQ7GoxDB4cahqJ6IFVT/KgjfsQ== X-Received: by 2002:a17:902:f292:b0:190:d283:7faf with SMTP id k18-20020a170902f29200b00190d2837fafmr13157610plc.13.1671208994170; Fri, 16 Dec 2022 08:43:14 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:13 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 2/6] utils.py: Use get_layer_var() to get BBFILE_COLLECTIONS Date: Fri, 16 Dec 2022 08:42:51 -0800 Message-Id: <3743999127b48ee332fdbf3ed25cc3bdd76dfa74.1671208436.git.tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:15 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58825 From: Robert Yang The commit 38e6288c7dad579518b0de2b6664f23be58889b6 has added oe-core to BBLAYERS by default, and then there will be multiple BBFILE_COLLECTIONS which causes update.py failure to update layers (most of the dependencies or recommends are missing), use get_layer_var() to get BBFILE_COLLECTIONS to fix the problem since it can ignore the extra oe-core from BBFILE_COLLECTIONS. Signed-off-by: Robert Yang Fix minor typos. Minor rewording. Signed-off-by: Tim Orling --- layerindex/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layerindex/utils.py b/layerindex/utils.py index efd18e4..ed7fb47 100644 --- a/layerindex/utils.py +++ b/layerindex/utils.py @@ -188,7 +188,7 @@ def _add_dependency(var, name, layerbranch, config_data, logger=None, required=T logger.warn('Either set REMOVE_LAYER_DEPENDENCIES to remove them from the database, or fix conf/layer.conf') def set_layerbranch_collection_version(layerbranch, config_data, logger=None): - layerbranch.collection = config_data.getVar('BBFILE_COLLECTIONS', True) + layerbranch.collection = get_layer_var(config_data, 'BBFILE_COLLECTIONS', logger) ver_str = "LAYERVERSION_" if layerbranch.collection: layerbranch.collection = layerbranch.collection.strip() From patchwork Fri Dec 16 16:42:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16866 X-Patchwork-Delegate: ticotimo@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96DADC4332F for ; Fri, 16 Dec 2022 16:43:25 +0000 (UTC) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mx.groups.io with SMTP id smtpd.web11.18016.1671208998878352373 for ; Fri, 16 Dec 2022 08:43:18 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=duvhyg5v; spf=pass (domain: gmail.com, ip: 209.85.216.54, mailfrom: ticotimo@gmail.com) Received: by mail-pj1-f54.google.com with SMTP id v13-20020a17090a6b0d00b00219c3be9830so2895414pjj.4 for ; Fri, 16 Dec 2022 08:43:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NqAVCUVUJB49GtwWSLG6FX5gCsF47MBXWCLk+AKGd8A=; b=duvhyg5vfJ8wqD/xoABCly9MtQj5zPahFL+h0Jbie/sghz72/BNMTqCy++uwkUa78+ 3dXtEW4Aa735wESuaLzVeSLJmeQwZZShAvsT3JSPLvdLMEUVbfcDtcgv9v7gfJ/YKWAA jxqO1gaEvRaFytwUxEXoXGeVao5vrD+s9Z5LsAPDsKSpDK4V4uKvILkA2xgdaIZlYJzy ofKQx0Ut/ME+62rsDoj7Gvof98PMnjCKbtXtg5K1SkX71PWsaCAW4kEOLy+7r+YwcSfC mTqMcwR37kK5qjFPnliwx0GygMnwD/pSBF2+IhWxtVbx9/RiI7YVRuyHXEVe39ViBSYZ iueA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NqAVCUVUJB49GtwWSLG6FX5gCsF47MBXWCLk+AKGd8A=; b=KrD6VBIXAznF91+NprUiwQEpaXuSe3IJZYWeew9PjzbIh750MpLMFA6YvixvyvpvCX CVT2q9Mrq1zzhpJOGmFuURI779urthPUc5GziW6os1VsGr86Sjlme7qaDDEhIuGlHCTy q4S8o0m+vIKLshbNist19xzjd1Ey8vmXzKVWlrjyobzl82ti8SjU+6u89hpRbFMBwmDd BhWzlm+p3ZeicGrunpo6VXZSWad/9YgddcuADn0Jn+qhN6PiiO1CeL9IuPanTgtzzce/ C90Z3SFYjPjovuG06Tsm2LvBhDKhIxOi6da0EdEYl2LT7SOUqK+p7NBHb5JeTJn7lxXe V2NQ== X-Gm-Message-State: ANoB5pl/ZDX8XPFycGUMRjwpwmginjL6pN0mT1Vu+ehm1ihuUVKciqB4 M3qcvQ+kAtfLZq80y6I/yS2nTtScCWw= X-Google-Smtp-Source: AA0mqf7LcKInWZGe8JQiVBbyTj6XRAbzMsYXOJVBgJ4REugaq3MkRq8BQWqKxMPGyal1iitCKqzdPA== X-Received: by 2002:a17:902:dac3:b0:189:62f7:e5fc with SMTP id q3-20020a170902dac300b0018962f7e5fcmr43785533plx.14.1671208997817; Fri, 16 Dec 2022 08:43:17 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:17 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 3/6] admin.py: Remove has_delete_permission() Date: Fri, 16 Dec 2022 08:42:52 -0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58826 From: Robert Yang The following commit has added on_delete=models.CASCADE to the ForeignKey: === commit 2d526f9b0d363f3e442abc97ef9bd9fab37ee5e4 Author: Amber Elliot Date: Thu Jun 25 15:57:34 2020 -0700 Updating models and imports for Django 2.2 upgrade. === The on_delete=models.CASCADE will remove the objects which reference the removed objects, so there will be errors when removing a LayerBranch with admin permissions: === Cannot delete layer branch Deleting the selected layer branch would result in deleting related objects, but your account doesn't have permission to delete the following types of objects: Append distro === This is because has_delete_permission() always return False, remove it to use Django's implementation to fix the problem. Signed-off-by: Robert Yang Minor rewording. Signed-off-by: Tim Orling --- layerindex/admin.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/layerindex/admin.py b/layerindex/admin.py index 9ed6102..f8b2f6e 100644 --- a/layerindex/admin.py +++ b/layerindex/admin.py @@ -102,8 +102,6 @@ class RecipeAdmin(admin.ModelAdmin): return rofields def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class PackageConfigAdmin(admin.ModelAdmin): search_fields = ['feature', 'recipe__pn'] @@ -132,8 +130,6 @@ class ClassicRecipeAdmin(admin.ModelAdmin): return rofields def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class MachineAdmin(admin.ModelAdmin): search_fields = ['name'] @@ -141,8 +137,6 @@ class MachineAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in Machine._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class DistroAdmin(admin.ModelAdmin): search_fields = ['name'] @@ -150,9 +144,6 @@ class DistroAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in Distro._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False - class BBAppendAdmin(admin.ModelAdmin): search_fields = ['filename'] @@ -160,8 +151,6 @@ class BBAppendAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in BBAppend._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class BBClassAdmin(admin.ModelAdmin): search_fields = ['name'] @@ -169,8 +158,6 @@ class BBClassAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in BBClass._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class PatchAdmin(admin.ModelAdmin): search_fields = ['path'] @@ -178,8 +165,6 @@ class PatchAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in Patch._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class PatchDispositionAdmin(admin.ModelAdmin): fields = ['patch', 'user', 'disposition', 'comment'] @@ -199,8 +184,6 @@ class IncFileAdmin(admin.ModelAdmin): readonly_fields = [f.name for f in IncFile._meta.get_fields()] def has_add_permission(self, request, obj=None): return False - def has_delete_permission(self, request, obj=None): - return False class RecipeChangeInline(admin.StackedInline): model = RecipeChange From patchwork Fri Dec 16 16:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96DDEC4167B for ; Fri, 16 Dec 2022 16:43:25 +0000 (UTC) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mx.groups.io with SMTP id smtpd.web10.17827.1671209003349407751 for ; Fri, 16 Dec 2022 08:43:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=a1wizWeK; spf=pass (domain: gmail.com, ip: 209.85.216.50, mailfrom: ticotimo@gmail.com) Received: by mail-pj1-f50.google.com with SMTP id n65-20020a17090a2cc700b0021bc5ef7a14so2961621pjd.0 for ; Fri, 16 Dec 2022 08:43:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pvaoAVSs3mVV6yNsYY/O0yzT/nAxAL7yNpIxJj2ahfM=; b=a1wizWeKrT+ylUtHj0hL0esNKVZzbzi3Ri9RQnHjRdWsUvC/tSh0uGj9Hoh6MunD9j YtHURJU9sokRnpgu9POZOUwKWL64nypjDT7Pb6i6vT+3L+IEoj1Ga8kDVEN54P6vDgGD 3fhRhO+D8bxQ9hSdZ3MhQd1ogZ58eI6DHPLHWZftODoRbmdY3n3ZSYOT2m100UzA1cY8 NrsY7HNtmViD56Bp/fAtrCk4xPNfktnZWUkL3LJlZvsu0jwuvLM3mOisiMK6w5psHZ5V bjHc1kjVMFs72H+dIFBteEBedSnWDUZqp9A3lfgk5IKSE7TTCmvihA8ttFp4iEWzpvSG dCOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pvaoAVSs3mVV6yNsYY/O0yzT/nAxAL7yNpIxJj2ahfM=; b=QDwHuZcs4jQC7qqg3SHqI4P8rMdZ/N68yukmrlzPb6sanwo/ImObiwDEKR/BNpKNah MRpDCge6XvNTDhDul6NS7UjrvftrbUEeRLBbViCeTAEscOr7IAl0E07XLQ8DLNHRwlpg wNCAodmhOY/0wza+Ki6mElBZj4dkZPZ7FBKLP2aD6VFn46rpSXSGkHXttgixaVIfsUw7 x4HfHJ3HCntCPRAlGOlN10ElRu2hiNgPB6P7vtw/aWq4lTa9rFeEyWcWhRy3uyzfFZ/G GxozCGDU6n0vP2oxNGa/SrlqnhiwAVJRPxAuK0CFkhTOGyQWy2nxf+ZF4VvND9RLz6b4 /YHg== X-Gm-Message-State: ANoB5pkpDcAc9zpoqI2OqRYB2y0zh+pgE6yw2+FuHDNd9Yy5dWiBQ29Q JX1MEBifyZpuDL8tZm4FSeA7nSTyw2I= X-Google-Smtp-Source: AA0mqf7MWpyIU+YwrchlOLY5VACQRYID9w6Gs364jGf0sWw0L/OS5oG0oDQ2sodAS01CLAzpZpCESQ== X-Received: by 2002:a17:902:e0d1:b0:18c:bba:b8f4 with SMTP id e17-20020a170902e0d100b0018c0bbab8f4mr26554926pla.68.1671209002350; Fri, 16 Dec 2022 08:43:22 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:21 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 4/6] utils.py: Fix for is_commit_ancestor() Date: Fri, 16 Dec 2022 08:42:53 -0800 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:25 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58827 From: Robert Yang The runcmd() would print an "ERROR" on failure which causes confusion since the failure is expected on old branches, so subprocess.getstatusoutput to fix the problem. Signed-off-by: Robert Yang Minor rewording. Signed-off-by: Tim Orling --- layerindex/utils.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/layerindex/utils.py b/layerindex/utils.py index ed7fb47..6566710 100644 --- a/layerindex/utils.py +++ b/layerindex/utils.py @@ -243,16 +243,18 @@ def is_commit_ancestor(repodir, commit, logger): # check if commit is a sha1 hash if re.match('[0-9a-f]{40}', commit): # check if the commit is an ancestor - contained = runcmd(['git', 'merge-base', '--is-ancestor', '%s' % commit, 'HEAD'], repodir, logger=logger) - return True - else: - raise Exception('is_commit_ancestor: "commit" must be a SHA1 hash') - except subprocess.CalledProcessError as e: - if e.returncode == 1: - # commit is not an ancestor + cmd = "GIT_DIR=%s/.git git merge-base --is-ancestor %s HEAD" % (repodir, commit) + logger.debug('Running "%s"' % cmd) + ret, output = subprocess.getstatusoutput(cmd) + if ret == 0: + return True + elif ret == 1: + logger.debug('output: %s' % output) return False else: - raise e + raise Exception('Failed to run command: %s: ret: %s, output: %s' % (cmd, ret, output)) + else: + raise Exception('is_commit_ancestor: "commit" must be a SHA1 hash') except Exception as esc: logger.warn(esc) From patchwork Fri Dec 16 16:42:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96825C4167B for ; Fri, 16 Dec 2022 16:43:35 +0000 (UTC) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web10.17831.1671209007616301379 for ; Fri, 16 Dec 2022 08:43:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HTWliK95; spf=pass (domain: gmail.com, ip: 209.85.214.177, mailfrom: ticotimo@gmail.com) Received: by mail-pl1-f177.google.com with SMTP id a9so2850872pld.7 for ; Fri, 16 Dec 2022 08:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qnG4QJ0uVVgIFDLnuXTkgZoHEYKw67KAHMFe/GcSP08=; b=HTWliK95DBybTY9WyLTx7XQeUPLU81r88EVgjDBqwaN94kquG5YLLhzzsIHACivX6o EySA2h4eAnzy84VgRHT/l5kXYaHD8+9nY/Nc9nZjUofagNhzGEDnynu0EDHo+IBGuv36 PqaAnYhRya/Mq1qOy0c7BCZwicdRP6U5NdxdmgjxePzMUgR1vNHsN8uZxdaUHq8Cy/Ys hSt0CRLIzGCozJaf9ndDr92GcXrLbd+cjAtTpeeSv2gGkPErPMxSASaOTTQ22s+CCa6v OryiYDgK+j2+2eEBcZ4BotuIEDDRi6dTH7nYUzTvOjqEK7GBVVvbLhFoWFWNFfvHdjHu Vm+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qnG4QJ0uVVgIFDLnuXTkgZoHEYKw67KAHMFe/GcSP08=; b=gwaA77JEputRyPQes4iLLI3Ieb2cgOyy4QdP6du4dFlbt5+Y9SajPXjmGEyUwkvuoC 7/yvlAVgR+qx0JNU6e/YoCds3qIIZ2/vKXw+pM3fg3mf2nyLrkGGGjvD9O29gSt7VGeM PKAR1ax/osDaSzI1SqJbNn+71voSnXQg2S2YowVyltPP33wPXwahwPUIVOG35TBB0B+y FQQCyPPNlz/3T+r+qF2kS6o5xGNuM8m15FQtJyRf5iiQ57J2sUNT5e8/hjXjo02jB+M1 fJBZefxzFQrPhOs3eKlt1tnRcNGQdiuXtlVkPJ4k8vP3yRJ/hUJGgtxMV0TUdGjIJ3W4 75bA== X-Gm-Message-State: ANoB5pnTAJKllaGPzeE3dCc8us4k42PjGu3xt+Cb5d2RXyViyyc/AxZ8 OVEn+5YQjQZuPQ9DxJtb78jZL7wcCAc= X-Google-Smtp-Source: AA0mqf7xyTj8h3fd80xWGw9u5/b5PLFwxUGnThcPxj0YPggVMoo+lp21c5Klkri2hDL3VfhElBOSUQ== X-Received: by 2002:a17:902:e94c:b0:186:af3d:dd5f with SMTP id b12-20020a170902e94c00b00186af3ddd5fmr32679583pll.64.1671209006609; Fri, 16 Dec 2022 08:43:26 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:26 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 5/6] Dockerfile: switch to ubuntu:jammy for >python3.8 Date: Fri, 16 Dec 2022 08:42:54 -0800 Message-Id: <807be421fd3c5d5a300e2a9c59b64747bad9d820.1671208436.git.tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:35 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58828 From: Michael Halstead ubuntu:jammy provides python 3.10.6 which supports current bitbake. Dropped unneeded python2 packages. Moved locale generation high to reduce error messages during image building. Signed-off-by: Michael Halstead Signed-off-by: Tim Orling --- Dockerfile | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index a6c7ad2..d8c38e1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # See README for how to use this. -FROM debian:buster +FROM ubuntu:jammy LABEL maintainer="Michael Halstead " ENV PYTHONUNBUFFERED=1 \ @@ -17,30 +17,29 @@ ENV PYTHONUNBUFFERED=1 \ COPY requirements.txt / RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && apt-get install -y locales \ + && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \ + && locale-gen en_US.UTF-8 \ + && update-locale \ && apt-get install -y --no-install-recommends \ autoconf \ g++ \ gcc \ make \ - python-pip \ - python-mysqldb \ - python-dev \ - python-pil \ - python-wheel \ + python2 \ python3-pip \ python3-mysqldb \ python3-dev \ python3-pil \ python3-wheel \ - libz-dev \ + zlib1g-dev \ libfreetype6-dev \ libjpeg-dev \ - libmariadbclient-dev \ - locales \ + libmariadb-dev-compat \ netcat-openbsd \ curl \ wget \ - git-core \ + git \ vim \ rpm2cpio \ rpm \ @@ -51,7 +50,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update \ && pip3 install gunicorn \ && pip3 install setuptools \ && pip3 install -r /requirements.txt \ - && apt-get purge -y autoconf g++ make python3-dev libjpeg-dev libmariadbclient-dev \ + && apt-get purge -y autoconf g++ make python3-dev libjpeg-dev \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ && apt-get clean From patchwork Fri Dec 16 16:42:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 16868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 967F8C4332F for ; Fri, 16 Dec 2022 16:43:35 +0000 (UTC) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mx.groups.io with SMTP id smtpd.web11.18023.1671209011421782727 for ; Fri, 16 Dec 2022 08:43:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YBoGGXgI; spf=pass (domain: gmail.com, ip: 209.85.216.51, mailfrom: ticotimo@gmail.com) Received: by mail-pj1-f51.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso6685937pjt.0 for ; Fri, 16 Dec 2022 08:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ipoGwnZ7/vMq14zJd0yHCyL/ENR/y99AJiCJdgCQliA=; b=YBoGGXgIQTVGXddmonmgLmeI0P9Wil02K4slGy66O1+6ISou3zBdkeknUy3DnPooA6 j/KoWTpCU9RywY4vnKRCZ+JYPNkwVxWTvMi0Z1TUPL7txpqOzUTLZM+HSf0zTM4pAFm2 GEyTf2onyFVeKHWANF6hRQfC2uDTK4ZcZBSnL7d9BHGJ01P2Js1Q0rR/wobCapl2ZByc 5r5fjkamVwT1ODw/GaP1ZY7Kx6I7/zCIHOwxny8gJpRaQhdzDFQomLr90/VagpHOjuow tYmRtFzR9ZSBx3td8FTnqMnAcCTIT5rf4gWClGDJCopDhpLXJ3905oxIzYyl2/5VApAP Bs+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ipoGwnZ7/vMq14zJd0yHCyL/ENR/y99AJiCJdgCQliA=; b=691hXgN5Yuoe7bhmpLDtclscU6JWdNERlL6OX5np9vWsk/aoUHiSOekGCqPn2O2j1O ZFAtydst4ja9LW9MGemVpovBVKfbSRKc63YSVMjphc6UMPoKdVCWjrs/bVMre7OX6ij8 ruQ/OF6bU+nKcZCL6foospyJrM92/7uN4tKU9eFjasRKJj4TTlY5+yX/noLGlFxYbTtn x2hX3JN4GzZ91e5pD27XHAWOW2sQugcNgDs8hb/ZZiXGnWxhJMEPFPIXY5MqyNNfihAx WYMWUEtiUXeEzG5uAckpAyowLBjvMkpKijO592MT31sWENMyfHDY4Gw3+HNoKyNKtNhX ulyg== X-Gm-Message-State: ANoB5pmYljwTUIFHuA7oEl3HxA78uJlr1pe2ePAFW9Jy4GBAnp2voCNY pQYdTC21sIIKIzb4qL1+ykTNqfOA2UI= X-Google-Smtp-Source: AA0mqf7zEOhkgzLd4ITNvY2zBdzpGJgQ/5vxRR/yQDetJbqfG7RsLR0eI1pbrX56bhmaYIdnDZTMow== X-Received: by 2002:a17:902:ab54:b0:189:6bda:e98f with SMTP id ij20-20020a170902ab5400b001896bdae98fmr32651796plb.58.1671209010410; Fri, 16 Dec 2022 08:43:30 -0800 (PST) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:6325:4753:57d5:805f]) by smtp.gmail.com with ESMTPSA id v1-20020a1709029a0100b001897e2fd65dsm1874588plp.9.2022.12.16.08.43.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 08:43:30 -0800 (PST) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Subject: [layerindex-web][PATCH 6/6] global: replace deprecated distutils Date: Fri, 16 Dec 2022 08:42:55 -0800 Message-Id: <125fe439624b307582389aad8c8a6b920bb6b2c8.1671208436.git.tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 16 Dec 2022 16:43:35 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/58829 Replace distutils.version.LooseVersion with pkg_resource.parse_version https://majornetwork.net/2021/05/comparing-version-numbers-in-python/ [YOCTO #14990] Signed-off-by: Tim Orling --- layerindex/recipedesc.py | 1 - layerindex/tools/import_classic.py | 1 - layerindex/tools/import_otherdistro.py | 1 - layerindex/update.py | 4 ++-- layerindex/update_layer.py | 6 +++--- layerindex/views.py | 6 ++---- rrs/tools/upgrade_history_internal.py | 4 ++-- 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/layerindex/recipedesc.py b/layerindex/recipedesc.py index a844186..33aef31 100644 --- a/layerindex/recipedesc.py +++ b/layerindex/recipedesc.py @@ -13,7 +13,6 @@ import logging import subprocess from datetime import datetime import fnmatch -from distutils.version import LooseVersion logger = None diff --git a/layerindex/tools/import_classic.py b/layerindex/tools/import_classic.py index 0216221..44f8f88 100755 --- a/layerindex/tools/import_classic.py +++ b/layerindex/tools/import_classic.py @@ -22,7 +22,6 @@ import fnmatch import re import tempfile import shutil -from distutils.version import LooseVersion import utils import recipeparse diff --git a/layerindex/tools/import_otherdistro.py b/layerindex/tools/import_otherdistro.py index 0c6640f..5c00115 100755 --- a/layerindex/tools/import_otherdistro.py +++ b/layerindex/tools/import_otherdistro.py @@ -23,7 +23,6 @@ import subprocess import string import shlex import codecs -from distutils.version import LooseVersion sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))) sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), 'lib'))) diff --git a/layerindex/update.py b/layerindex/update.py index 5a2642b..7de9c0d 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -17,7 +17,7 @@ import codecs import logging import subprocess from datetime import datetime, timedelta -from distutils.version import LooseVersion +from pkg_resources import parse_version import utils import operator import re @@ -130,7 +130,7 @@ def extract_value(valuename, output): return '' def main(): - if LooseVersion(git.__version__) < '0.3.1': + if parse_version(git.__version__) < parse_version('0.3.1'): logger.error("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script") sys.exit(1) diff --git a/layerindex/update_layer.py b/layerindex/update_layer.py index e8b210e..e0ecc94 100644 --- a/layerindex/update_layer.py +++ b/layerindex/update_layer.py @@ -19,7 +19,7 @@ import re import tempfile import shutil import errno -from distutils.version import LooseVersion +from pkg_resources import parse_version import itertools import utils import recipeparse @@ -239,7 +239,7 @@ def update_distro_conf_file(path, distro, d): distro.description = desc def main(): - if LooseVersion(git.__version__) < '0.3.1': + if parse_version(git.__version__) < parse_version('0.3.1'): logger.error("Version of GitPython is too old, please install GitPython (python-git) 0.3.1 or later in order to use this script") sys.exit(1) @@ -808,7 +808,7 @@ def main(): logger.error(traceback.format_exc().rstrip()) sys.exit(1) finally: - if tinfoil and (LooseVersion(bb.__version__) > LooseVersion("1.27")): + if tinfoil and (parse_version(bb.__version__) > parse_version("1.27")): tinfoil.shutdown() if tempdir: diff --git a/layerindex/views.py b/layerindex/views.py index 6f22c0c..e660578 100644 --- a/layerindex/views.py +++ b/layerindex/views.py @@ -41,7 +41,6 @@ from django.views.generic.base import RedirectView from django.views.generic.edit import (CreateView, DeleteView, FormView, UpdateView) from django_registration.backends.activation.views import RegistrationView -from pkg_resources import parse_version from reversion.models import Revision import settings @@ -1736,7 +1735,6 @@ class BranchCompareView(FormView): form_class = BranchComparisonForm def get_recipes(self, from_branch, to_branch, layer_ids): - from distutils.version import LooseVersion class BranchComparisonResult: def __init__(self, pn, short_desc): self.pn = pn @@ -1791,9 +1789,9 @@ class BranchCompareView(FormView): changed = [] removed = [] for _, recipe in sorted(recipes.items(), key=lambda item: item[0]): - recipe.from_versions = sorted(recipe.from_versions, key=lambda item: LooseVersion(item.pv)) + recipe.from_versions = sorted(recipe.from_versions, key=lambda item: parse_version(item.pv)) from_version_exprs = [x.version_expr() for x in recipe.from_versions] - recipe.to_versions = sorted(recipe.to_versions, key=lambda item: LooseVersion(item.pv)) + recipe.to_versions = sorted(recipe.to_versions, key=lambda item: parser_version(item.pv)) to_version_exprs = [x.version_expr() for x in recipe.to_versions] if not from_version_exprs: added.append(recipe) diff --git a/rrs/tools/upgrade_history_internal.py b/rrs/tools/upgrade_history_internal.py index e3a96d9..2ba96b1 100644 --- a/rrs/tools/upgrade_history_internal.py +++ b/rrs/tools/upgrade_history_internal.py @@ -16,7 +16,7 @@ import os import optparse import logging import re -from distutils.version import LooseVersion +from pkg_resources import parse_version import git from datetime import datetime import calendar @@ -561,7 +561,7 @@ def generate_history(options, layerbranch_id, commit, logger): pass finally: - if tinfoil and hasattr(tinfoil, 'shutdown') and (LooseVersion(bb.__version__) > LooseVersion("1.27")): + if tinfoil and hasattr(tinfoil, 'shutdown') and (parse_version(bb.__version__) > parse_version("1.27")): tinfoil.shutdown() utils.rmtree_force(tempdir)