Patch Detail
Show a patch.
GET /api/1.1/patches/14109/?format=api
{ "id": 14109, "url": "https://patchwork.libcamera.org/api/1.1/patches/14109/?format=api", "web_url": "https://patchwork.libcamera.org/patch/14109/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20211012152410.978077-2-naush@raspberrypi.com>", "date": "2021-10-12T15:24:09", "name": "[libcamera-devel,RFC,1/2] utils: Add an option to override SHA string in gen-version.sh", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4e8dfb99ebd6f616e0bda6d8cf25ebf9c44dbd82", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/14109/mbox/", "series": [ { "id": 2618, "url": "https://patchwork.libcamera.org/api/1.1/series/2618/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2618", "date": "2021-10-12T15:24:08", "name": "Add new build option to override generate SHA", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2618/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/14109/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/14109/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 210A9C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 12 Oct 2021 15:24:31 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DFD6468F53;\n\tTue, 12 Oct 2021 17:24:29 +0200 (CEST)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 412FD68F4C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Oct 2021 17:24:28 +0200 (CEST)", "by mail-wr1-x433.google.com with SMTP id t2so68095151wrb.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 12 Oct 2021 08:24:28 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:26ae:314c:5c3f:f0df])\n\tby smtp.gmail.com with ESMTPSA id\n\ts14sm10683449wro.76.2021.10.12.08.24.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 12 Oct 2021 08:24:26 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ICg2pXwm\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=OvMhSQhG+5/bk6lR+tOIZyQf2Gts38eW8TySEnyx7kM=;\n\tb=ICg2pXwm7tgC1Vt1lFUiagKyXA+ap7z4Al2dz6gjjJH/8hrjQnERTmejhGeDhmlft5\n\trglBCxc2lSb1Vzko6NHgg4tNfiFI81OsBhuVCFcFLnMLJeZHdtHO3EqQwPGReBKknvSB\n\tvIIreI52/nNWfFNuFmeQluNlmTpt94dtI9X1zK97madc9s2tKZfKpC15gtysWLKha9mF\n\tUwrwt9ausVD1tWii3cxfLfjYFkQgg0A8ssXEUWm8nCU+skJL+0oWv4yVNkLmf+2WHpyo\n\t2tJvJ5/hu7KmrFUcV0SjHHFdhYVQV3mDKsqNloimhseyRbmYmJR70pxb/4vNA0xxZIYH\n\tkdCQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=OvMhSQhG+5/bk6lR+tOIZyQf2Gts38eW8TySEnyx7kM=;\n\tb=eoCX93YKUiS/jtC3Dsjp88YAZ5bfwe4zo13R9Db1XTosFb6f4NQD7K5ogHp0Pqe5E8\n\t1wBj+HnKAtX3kJ59EILB22xxCUUAgkNCaQTjZEKFCXWOemqOo7gEs81YQm9vDxKigL1T\n\trZcwPHkNKQDQ8sZZjo8b1hPgU6MSOj9dqpkANLOnkl5uEg5+l8yuDU8anPvO/dPlppCd\n\tKmJt0WsOYF+I3/oCjcXAHHs7GwXXpzrmJGVZl0eZmIVNnpC0IgjfIGuBz3vONJ/SPDJV\n\tfXXdaMsWmDAvp0ukntv6n3nnK75n3DNdN1KgjkvYqRU7iczJ0xbEm0abR3TJ92ThGdaf\n\tCxDw==", "X-Gm-Message-State": "AOAM530F7Kve82232ULUS+vl6QVG+uibolYDhugDdZRAuLa6NN6n3kew\n\tAKt/XrfdKsel0V4lCtUfrWRwQyrm3IoyUA==", "X-Google-Smtp-Source": "ABdhPJxt8lueEJw6S2FI5B54f9WtvOHanNi92x8bvRsv8HHJ+Kw96/JEu9gJoiDDEOAlYYQs0Ay7Nw==", "X-Received": "by 2002:adf:d1cb:: with SMTP id\n\tb11mr33346850wrd.418.1634052267654; \n\tTue, 12 Oct 2021 08:24:27 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 12 Oct 2021 16:24:09 +0100", "Message-Id": "<20211012152410.978077-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211012152410.978077-1-naush@raspberrypi.com>", "References": "<20211012152410.978077-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC 1/2] utils: Add an option to override SHA\n\tstring in gen-version.sh", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add an optional second command line argument to the gen-version.sh shell script\nthat would be used as the SHA value in the version string.\n\nAn override is needed if distributions make libcamera builds outside of the\nupstream git tree. In these cases, the user can then use the correct SHA value\nof the upstream tree instead of the local downstream build tree.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n utils/gen-version.sh | 25 ++++++++++++++++++-------\n 1 file changed, 18 insertions(+), 7 deletions(-)", "diff": "diff --git a/utils/gen-version.sh b/utils/gen-version.sh\nindex b09ad495f86a..ba5185fa264c 100755\n--- a/utils/gen-version.sh\n+++ b/utils/gen-version.sh\n@@ -2,15 +2,26 @@\n \n # SPDX-License-Identifier: GPL-2.0-or-later\n # Generate a version string using git describe\n+#\n+# An optional sha string can be passed as the second command line argument\n+# if the caller wishes to override the SHA value picked up by git. This may be\n+# useful when distribution packages are build outside of the upstream repo.\n \n build_dir=\"$1\"\n+sha_override=\"$2\"\n \n-# Bail out if the directory isn't under git control\n-src_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n-src_dir=$(readlink -f \"$src_dir/..\")\n-\n-# Get a short description from the tree.\n-version=$(git describe --abbrev=8 --match \"v[0-9]*\" 2>/dev/null)\n+if [ -n \"$sha_override\" ]\n+then\n+\t# Use the sha provided on the command line.\n+\tversion=\"v0.0.0-g$sha_override\"\n+else\n+\t# Bail out if the directory isn't under git control\n+\tsrc_dir=$(git rev-parse --git-dir 2>&1) || exit 1\n+\tsrc_dir=$(readlink -f \"$src_dir/..\")\n+\n+\t# Get a short description from the tree.\n+\tversion=$(git describe --abbrev=8 --match \"v[0-9]*\" 2>/dev/null)\n+fi\n \n if [ -z \"$version\" ]\n then\n@@ -26,7 +37,7 @@ if [ -z \"$build_dir\" ] || (echo \"$build_dir\" | grep -q \"$src_dir\")\n then\n \tgit update-index --refresh > /dev/null 2>&1\n fi\n-git diff-index --quiet HEAD || version=\"$version-dirty ($(date --iso-8601=seconds))\"\n+[ -n \"$sha_override\" ] || git diff-index --quiet HEAD || version=\"$version-dirty ($(date --iso-8601=seconds))\"\n \n # Replace first '-' with a '+' to denote build metadata, strip the 'g' in from\n # of the git SHA1 and remove the initial 'v'.\n", "prefixes": [ "libcamera-devel", "RFC", "1/2" ] }