Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195591/?format=api
{ "id": 2195591, "url": "http://patchwork.ozlabs.org/api/patches/2195591/?format=api", "web_url": "http://patchwork.ozlabs.org/project/swupdate/patch/20260211132740.597019-3-stefano.babic@swupdate.org/", "project": { "id": 58, "url": "http://patchwork.ozlabs.org/api/projects/58/?format=api", "name": "swupdate development", "link_name": "swupdate", "list_id": "swupdate.googlegroups.com", "list_email": "swupdate@googlegroups.com", "web_url": "https://github.com/sbabic/swupdate", "scm_url": "git://github.com/sbabic/swupdate", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260211132740.597019-3-stefano.babic@swupdate.org>", "list_archive_url": null, "date": "2026-02-11T13:27:33", "name": "[2/9] hawkbit: add rules for incoming artifacts", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "93684314db1e4fd113e43deab9285c43cd4c7687", "submitter": { "id": 86869, "url": "http://patchwork.ozlabs.org/api/people/86869/?format=api", "name": "Stefano Babic", "email": "stefano.babic@swupdate.org" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/swupdate/patch/20260211132740.597019-3-stefano.babic@swupdate.org/mbox/", "series": [ { "id": 491836, "url": "http://patchwork.ozlabs.org/api/series/491836/?format=api", "web_url": "http://patchwork.ozlabs.org/project/swupdate/list/?series=491836", "date": "2026-02-11T13:27:32", "name": "Introduce delta update with Hawkbit", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491836/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195591/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195591/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<swupdate+bncBD2ZDGN6SEKRBUUHWLGAMGQE4L4BBHI@googlegroups.com>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=googlegroups.com header.i=@googlegroups.com\n header.a=rsa-sha256 header.s=20230601 header.b=gYBszr0F;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com\n (client-ip=2a00:1450:4864:20::138; helo=mail-lf1-x138.google.com;\n envelope-from=swupdate+bncbd2zdgn6sekrbuuhwlgamgqe4l4bbhi@googlegroups.com;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from mail-lf1-x138.google.com (mail-lf1-x138.google.com\n [IPv6:2a00:1450:4864:20::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9zl12DbDz1yBS\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 00:27:57 +1100 (AEDT)", "by mail-lf1-x138.google.com with SMTP id\n 2adb3069b0e04-59e14ac0ed7sf2701374e87.0\n for <incoming@patchwork.ozlabs.org>;\n Wed, 11 Feb 2026 05:27:57 -0800 (PST)", "by 2002:ac2:43db:0:b0:59e:6056:c4d0 with SMTP id\n 2adb3069b0e04-59e6056c6e8ls135795e87.2.-pod-prod-05-eu;\n Wed, 11 Feb 2026 05:27:44 -0800 (PST)", "from mout.kundenserver.de (mout.kundenserver.de. [212.227.17.24])\n by gmr-mx.google.com with ESMTPS id\n 38308e7fff4ca-387068d5dc7si362551fa.3.2026.02.11.05.27.44\n for <swupdate@googlegroups.com>\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 11 Feb 2026 05:27:44 -0800 (PST)", "from paperello ([88.217.136.221]) by mrelayeu.kundenserver.de\n (mreue109 [212.227.17.181]) with ESMTPSA (Nemesis) id\n 1MG9c2-1w081L2QrE-00AhSv; Wed, 11 Feb 2026 14:27:43 +0100" ], "ARC-Seal": [ "i=2; a=rsa-sha256; t=1770816469; cv=pass;\n d=google.com; s=arc-20240605;\n b=furTQLQONCTMsrJ3MzciEFSP+Qkjc82mZGHN6vKUZBYTfWdTrvv96GzYMYKxujq4EO\n ajq8HVlf7mTQrbOkESwPllYqUsRHXTW294Sif3e4e4hq55PsBKLBVxY3++cxRGNPqIpe\n SR0e41t+sdM3CEi87Au42yKBmNyu1YJqBu5PhLGrkkYB+14kIhSFcoCn+SfVEflHXHqA\n mPijRVfLAxVm3/2AETWHWSuccscg0glSJhWQ0CNM2EaToSYrvbPG6ofS5rAohADNnlXf\n L3dWuH3uywOx5f5N44Pp4paBaaEeZ45XAeF04/GYNRfGOFw1PYYEauSH9QVKG0UqhIrf\n 2rcw==", "i=1; a=rsa-sha256; t=1770816464; cv=none;\n d=google.com; s=arc-20240605;\n b=DHMAy0GONylJPgnJtctXXewMukUtVHtzxVvmzgDf5kJth1ozqQ+QnK8Dzsbxes4AMv\n U3tWCt+pRT/2oc007RGlf66r/aHatF2Et5+v/525oFxdN0JD2ja42ocGQP8/hr2G0I61\n CPT9F85u/H+u6x3vHdNjSYSPkQlabuCAa9EBZ/FEbJGmTIzhaw0ZV6ZtV4PVRc5vKcz7\n OIpgl6gQOIVY1OC+/s/rgzTp4JTeed4fSqlAmZ5zEABxP83YNkna+isrniFSVjb/5EUH\n lcvqvjTez+Jmg8/LvGcdALiM2O/maNNJ/2/LNVUXgwFGvxT8xqcKj8K2ZSRT4wslKsVD\n zh5w==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n :list-id:mailing-list:precedence:ui-outboundreport:mime-version\n :references:in-reply-to:message-id:date:subject:cc:to:from:sender\n :dkim-signature;\n bh=QIo/85AEPZsG3ub0pjLCNS8e9MSq28a6yUJziR+YDcU=;\n fh=rmWbDArxj3eQiChhSGAZmAP6TAU3C6/6IDEabLPnO+Y=;\n b=MOqEk8eVLv+qANXjhyz3IPik6wdFA8Vdr9ykkikzTyLy8WYd2Vo0+B89/ZrmBD/9d5\n 9yfAdQ5NWSVFBugj3keAiCgLpVDNJyK/dHBNT/Xyp34JlYdJ3JqXenM6mhGb+I91YoCN\n GmN6ulgqah3ZIupg8dlyZzl1nbH+QibeWiqokkhMRLJGnhFU3S6BEaAr8VGt7rxgelJa\n mL98LZ8Ai3YhcGC4bpj7c+ITzT8huTLztDy0y2KlWa5vrJhzoHuebKurvxmkdMdEgblt\n HI6MQWWfrd9sCNvjDiWEwvf/alPSWQ9nyeASjcz6m/hIax0pAwgtlFK4BAylR1C1Wjxk\n Y+Rg==;\n darn=patchwork.ozlabs.org", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=ui-outboundreport:content-transfer-encoding:mime-version:references\n :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature;\n bh=VkznRjZ2iwzWJCR49+9FXbnPc6nxrYb8gyACFKs3Ta0=;\n fh=TiEWcqMcKpHk5s7uErzpntoONrNfOXwKpI5P8bIlggk=;\n b=GIfYnJfYRDtqVAih7Mq/r2ftlAiSDKE/Ney9rJU9ZJyV9tQ5IVK5pXDuzVhD2hLzP7\n 2UJfWX4skyREB1j7bA/HSlyX0lQxYXg1Hu6pFlmdPoElh+aPURcNY59j9Ef6qpr3NeD7\n 7yonsZDVlpdXkonmh0uqJlXmqjIq47QD0bVOtYV3ZDkhkI/InwTSgQB5PfwRriehKPTV\n yMkx7w1qLrWUw+qLm53cGcfb0GVGuqBSbX7teZKdNu7Y3KvJ1Av++1VNhiH8N3gNOKOR\n EU7aOA3kvW7FI7+trvuCHlsciGjy87AP/o0yTwxJZCQ2k3KusWoYXp+9nF+TUQGfyHXP\n yr8Q==;\n dara=google.com" ], "ARC-Authentication-Results": [ "i=2; gmr-mx.google.com;\n dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=lCRXbWbW;\n spf=pass (google.com: domain of stefano.babic@swupdate.org designates\n 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org;\n dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=swupdate.org", "i=1; gmr-mx.google.com;\n dkim=pass header.i=@swupdate.org header.s=s1-ionos header.b=lCRXbWbW;\n spf=pass (google.com: domain of stefano.babic@swupdate.org designates\n 212.227.17.24 as permitted sender) smtp.mailfrom=stefano.babic@swupdate.org;\n dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=swupdate.org" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=googlegroups.com; s=20230601; t=1770816469; x=1771421269;\n darn=patchwork.ozlabs.org;\n h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n :list-id:mailing-list:precedence:x-original-authentication-results\n :x-original-sender:ui-outboundreport:mime-version:references\n :in-reply-to:message-id:date:subject:cc:to:from:sender:from:to:cc\n :subject:date:message-id:reply-to;\n bh=QIo/85AEPZsG3ub0pjLCNS8e9MSq28a6yUJziR+YDcU=;\n b=gYBszr0F1D1Jj0YmRysebkSznFjDxalhMYJtdE46E5DGuFNie7fBBrPy5C+qR464X8\n jNywXBG/sZEMllD+2KFH11GHBPav+/A3t1Q6wjbr9ClHlsYn7NNpRj7AR06o7Wp3+opS\n gntLO4SMm8JX1xK/QT5AOI3owvtGzyJyJ677UBel2Hav1tooLfg6LrA4eEAXdjqTo9Os\n pkXE4ryeaawCL+zFTw0E7n0olJELPxzgMp3BZMGCP4t65k3mGlUOUcJpcxcpUyc5Dcmp\n 5aL5PKIVFMtxeoGlOqf1J5a7rlHnoIIQ/lu7PpLoHmnj8uV3YX+Tgg/kVdF4be9JSDpD\n jz/w==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770816469; x=1771421269;\n h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post\n :x-spam-checked-in-group:list-id:mailing-list:precedence\n :x-original-authentication-results:x-original-sender\n :ui-outboundreport:mime-version:references:in-reply-to:message-id\n :date:subject:cc:to:from:x-beenthere:x-gm-message-state:sender:from\n :to:cc:subject:date:message-id:reply-to;\n bh=QIo/85AEPZsG3ub0pjLCNS8e9MSq28a6yUJziR+YDcU=;\n b=BKpo3f8xX24QfSS9OPhx+7lFoEdLlfuLVBB7pvommicm6UmUOK+oG+PMPQY7CX+JF4\n FJ6TCGJ35E5fDTc2cf8NqhD4N/pIDASa0pkeu4WjqmDvIVmEIwwfpl5yO+qKicwqk6A3\n 2m9SB+sMDzKNk5eX/QzF57KXuXPaPi845r6tAeYGWjPuT7hDNQwcWxk7Hxn/YABTyZqA\n J2fryBddReg3h5GfLEV6tOKNjJTBfejb7I2x+ES85bqY3qrxL8Jdm7Aq1guLNwM6zCQ0\n 5xo7SYOllWgSQkGUeCsRSppAIO1hxg8eitCQou+lgBEDx5fen4iWvyPCANjqepP+OjJf\n /0Ig==", "Sender": "swupdate@googlegroups.com", "X-Forwarded-Encrypted": "i=2;\n AJvYcCVPxOFc2eFBF0vK6K8zH1gvp7xwbwh9QWwqRVZfEqMUszTm0Nvs7VkbmSsSPh2FoDYmBwlK++rjRg==@patchwork.ozlabs.org", "X-Gm-Message-State": "AOJu0YzV7UORigRZ16QigG6yV5wSGs5bmav+N+CR1hQyan2mr6quaRJI\n\tGtxqrEU4EVDixE1tsB2Ix9gx2yINxCBVkrnoqsmx9KuLP84F2Entx9qi", "X-Received": [ "by 2002:a05:6512:2243:b0:59d:dd50:f2e6 with SMTP id\n 2adb3069b0e04-59e5c2cac43mr920827e87.21.1770816469326;\n Wed, 11 Feb 2026 05:27:49 -0800 (PST)", "by 2002:a05:6512:2c09:b0:59e:3ce:bfff with SMTP id\n 2adb3069b0e04-59e5c2bacb1mr1104878e87.11.1770816464418;\n Wed, 11 Feb 2026 05:27:44 -0800 (PST)" ], "X-BeenThere": "swupdate@googlegroups.com;\n h=\"AV1CL+F9vdbwVZQZNzCzjgTpjD0NsuvDJbQofZrwCaMXPQOenQ==\"", "Received-SPF": "pass (google.com: domain of stefano.babic@swupdate.org\n designates 212.227.17.24 as permitted sender) client-ip=212.227.17.24;", "X-UI-Sender-Class": "55c96926-9e95-11ee-ae09-1f7a4046a0f6", "From": "Stefano Babic <stefano.babic@swupdate.org>", "To": "swupdate@googlegroups.com", "Cc": "Stefano Babic <stefano.babic@swupdate.org>", "Subject": "[swupdate] [PATCH 2/9] hawkbit: add rules for incoming artifacts", "Date": "Wed, 11 Feb 2026 14:27:33 +0100", "Message-ID": "<20260211132740.597019-3-stefano.babic@swupdate.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260211132740.597019-1-stefano.babic@swupdate.org>", "References": "<20260211132740.597019-1-stefano.babic@swupdate.org>", "MIME-Version": "1.0", "X-Provags-ID": "V03:K1:phwV1HEA/foeQwy4zdWnli8P7IvzjakrnL2aJpxLOSvox+CMxje\n TnFSw72o/LThpP4cBPIrGyUXckOOv4DOnLkWSvgW0xceNZzbBop/n2Uql+UnC1fNg454GGS\n UicsgP9u7WyBHFyj1ZhYCuhuEYvs7P3e5Hdu1X9FFW+oBV1k6Rito+Xwy5kDthFnXeE1vGR\n fpBozErzUgKLz6RtLQsxQ==", "X-Spam-Flag": "NO", "UI-OutboundReport": "notjunk:1;M01:P0:wfUO25jTYds=;90slrhK/Qz+nuWyVD7g6nb6gbUV\n AEioEYohOxCoOeyDM+Jop5vYyjUrntdbR2PxXsF5x8fNI7r9ioRyvexC5wKE5HKmti/qoqU4l\n r+Sp+6pykAD4/mGVmxYALyqgCB+EOIp2rOH1GwbGQMwz6byPkJco9oceAV+ckoCjkSEnaNQuB\n jWu0GTXDJOpLhDtR2Qx4rMWZavuIHjp4sLgGEI/g/mfb1SuiCz/KTnBtr2p6A4J953lXy/tTG\n Gp5V3hMfYai07h3bDRlxK4XGWMLuiaGdk3+lpZYnSS2MxKSCFN+F1vbQf34T4+kUFc2XYWAe1\n WFnvyEOtUgHocNrtnCeKi2xUqfS4ZNHQLDyIYl9VgTo0hXcmC807OuKgi1GDdO44n0wpV/Gap\n FL3Am2lg2/uc4QPAuigyNhCBc2W8Me/PmFVQqhhkuz7WhjcsiQMrDkPLQEiKIIQbzjy04poGv\n +kqfAyGOWMT19UaVvRj3QDICV6193ZuAMHaMIiP4hZZfEvAf6FonWsgjGNZMZfVNJHmbtbArm\n SxmL49CIbIAoS/q+kr6JLt43u4m/rEHiNWN/IzbQSd5KDyMHiy77e+LwjIVhvGUARsupRir0N\n Hzx7sW6LJG2dMd4GtGdXpFi/NV0txJ8wtHbdWKNLDyxZyROdccwzdP5dCEu5zin1Erb/Enj48\n IyYUanUPQC43N/+bA9c/q8n+7OTYjtaeymugr57I8GXE9DdGzLg1+50KmSH1viU5N00D5azhG\n ZDyqE2p9JqM8NGJmZbpSmHpcY9YLWMYc9b9+7nBwRee0dEg7U6dzsM1vPFJ2wvdqCNZom3lZO\n wlDiTG3PUYjouEpy90Ilr2alPtjIwG2m7DMG9qD64xl9NZ3F30Lne6gxZSusQLDWiG9DpkBZr\n wQyCWST7pG3UpF16rvwaKgd3dqFJi2MGC7qZ0r0UC9dDtXKLaycxYGHXMZkMQyoVa2SX4ysCA\n d26wh5AM07WMsTPKNkdepCdeOmBVhqwBEqro9SLUCgl3jwOvhqmFO7VxleLHJ68ZpQssQecC3\n eLG1ZSYrClzPQReEz/DzMiUKVx/NdI1NVFl6JsSWdxvMyDbUBTCsqZk0LXeOBQ7Oypl7VG4JB\n r1TUIAhAc8n3kYIf5+gj64sxon1RWoifW1YdRLrSb2AUcbcomu4eM5fR+6lTj1QFK69r3Y9RN\n E+OpHr4K0JCc5xItSOgIwjNVz5uDhJBjueCDwlT5/Hb1Ff0X6d3QUE/n4vXUiKDGMsNsY+QHE\n ADwWuAwjo/yaMPsXme33cOUaU49v5wU027D/NOEQMPJckA9I+sbZA2OOdvq9tKLr+oGUDPobf\n U+SjGJvjj8Ukm2K2gkLUfZlyRZEtBOSjE9AhupCiVE7HjfyYydkqt5Ojd4mcbvHHx5EnN7f+8\n 6CjPllvTbuAbFliHQgRz3qukkvnyIqlBzAAGrYI7p1Fjz3R7qCqy2QG7ibtzm4nuVYDTk/mf+\n wlw0w1Bzm4Z+fuvAuzzdtEBO0EF04wCjTvFh2nNvsFQnkcZ4uPRs2500rdO6d++wMbpilitR1\n PQ3Y5oaTwSYFW+k5XkZC9QfT17Bk9gH7Fus8N67zWv3kwDWOiCd1fAhj/k3ttvXKqnt5ojTIy\n 61TTGOFzw//TC1kTIQoM0vkd8rN8k9XgCbdRgLCt4nqfQp4Zhp/2wIx+A0iWcvwfnTwanVo7g\n cXtkN014ONQPT97Rmi5YJJKJkiKfNbL7ALC4nFcc+zfhRbt5NUetI3h9wp3ycsOn0nVNOcrfp\n tmSctH18UpQY0xcbGuZgYLNM+FnhdQIgIN77v/EgyiO+6YwXKzqjGiLwi7XMElsl1GBZNBV8T\n b/NAZ+l757RIdJcBwpdO8+U+Y+uhWLYpsVFUjMtHOZTYbbjdP7Z+QEIa9YjR3kWgzjTqmADDk\n ZzZdGUtU2RfAsODUg==", "X-Original-Sender": "stefano.babic@swupdate.org", "X-Original-Authentication-Results": "gmr-mx.google.com; dkim=pass\n header.i=@swupdate.org header.s=s1-ionos header.b=lCRXbWbW; spf=pass\n (google.com: domain of stefano.babic@swupdate.org designates 212.227.17.24 as\n permitted sender) smtp.mailfrom=stefano.babic@swupdate.org; dmarc=pass\n (p=NONE sp=NONE dis=NONE) header.from=swupdate.org", "Content-Type": "text/plain; charset=\"UTF-8\"", "Precedence": "list", "Mailing-list": "list swupdate@googlegroups.com;\n contact swupdate+owners@googlegroups.com", "List-ID": "<swupdate.googlegroups.com>", "X-Spam-Checked-In-Group": "swupdate@googlegroups.com", "X-Google-Group-Id": "605343134186", "List-Post": "<https://groups.google.com/group/swupdate/post>,\n <mailto:swupdate@googlegroups.com>", "List-Help": "<https://groups.google.com/support/>,\n <mailto:swupdate+help@googlegroups.com>", "List-Archive": "<https://groups.google.com/group/swupdate", "List-Subscribe": "<https://groups.google.com/group/swupdate/subscribe>,\n <mailto:swupdate+subscribe@googlegroups.com>", "List-Unsubscribe": "\n <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>,\n <https://groups.google.com/group/swupdate/subscribe>" }, "content": "Hawkbit can deliver multiple files for each update, while SWUpdate\nrelies on a single SWU. In case of delta update, a second file in the\nZCK format is necessary.\n\nAdd rules to be applied for each artifact to execute taks before an\nupdate is started.\n\nSigned-off-by: Stefano Babic <stefano.babic@swupdate.org>\n---\n suricatta/server_hawkbit.c | 64 +++++++++++++++++++++++++++++++++-----\n suricatta/server_hawkbit.h | 2 ++\n 2 files changed, 58 insertions(+), 8 deletions(-)", "diff": "diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c\nindex dbd3e63c..c7b3f1fc 100644\n--- a/suricatta/server_hawkbit.c\n+++ b/suricatta/server_hawkbit.c\n@@ -38,6 +38,39 @@\n #define JSON_OBJECT_FREED 1\n #define SERVER_NAME \"hawkbit\"\n \n+/*\n+ * Rules depending on artifact extension\n+ * Standard SWU are always forwarded to SWUpdate core\n+ * Other files can be managed according to the rule\n+ * Previous version have always rejected not SWU files,\n+ * so add a rule to reject if previous rules do not apply.\n+ */\n+static bool swu_rule(artifact_t __attribute__ ((__unused__)) *artifact) {\n+\treturn true;\n+}\n+static bool zck_rule(artifact_t *artifact) {\n+\tartifact = artifact;\n+\treturn true;\n+}\n+static bool reject_rule(artifact_t __attribute__ ((__unused__)) *artifact) {\n+\treturn false;\n+}\n+\n+struct artifact_rule {\n+\tconst char *fileext;\n+\trule fn;\n+};\n+\n+/*\n+ * Rule to be applied when an artifact is found\n+ * Last rule in the array is applied when there is not match\n+ */\n+static struct artifact_rule rules[] = {\n+\t{ \"swu\", swu_rule },\n+\t{ \"zck\", zck_rule },\n+\t{ \"*\" , reject_rule }\n+};\n+\n static struct option long_options[] = {\n {\"tenant\", required_argument, NULL, 't'},\n {\"id\", required_argument, NULL, 'i'},\n@@ -1156,16 +1189,31 @@ static server_op_res_t json_extract_artifact(struct array_list *json_data_artifa\n \t\tartifacts[json_data_artifact_count].size = json_object_get_int(json_data_artifact_size);\n \n \t\t/*\n-\t\t * Check if the file is a .swu image\n-\t\t * and skip if it not\n+\t\t * Check filename and apply rules\n+\t\t * default: skip if it is not a SWU\n \t\t */\n-\t\tconst char *s = artifacts[json_data_artifact_count].filename;\n-\t\tint endfilename = strlen(s) - strlen(\".swu\");\n-\t\tif (endfilename <= 0 ||\n-\t\t strncmp(&s[endfilename], \".swu\", 4)) {\n-\t\t\tDEBUG(\"File '%s' is not a SWU image, skipping\", s);\n+\t\tchar **fnames;\n+\t\tfnames = string_split(artifacts[json_data_artifact_count].filename, '.');\n+\t\tint cnt = count_string_array((const char **)fnames);\n+\t\tTRACE(\"Number of strings CNT %d\", cnt);\n+\t\tif (cnt > 0) {\n+\t\t\tint iter;\n+\t\t\tfor (iter = 0; iter < ARRAY_SIZE(rules); iter++) {\n+\t\t\t\tif (!strcmp(rules[iter].fileext, fnames[cnt - 1])) {\n+\t\t\t\t\tTRACE(\"FOUND RULE %s\", rules[iter].fileext);\n+\t\t\t\t\trules[iter].fn(&artifacts[json_data_artifact_count]);\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\t/* Not found, run last rule */\n+\t\t\tif (iter == ARRAY_SIZE(rules))\n+\t\t\t\trules[ARRAY_SIZE(rules) - 1].fn(&artifacts[json_data_artifact_count]);\n+\t\t} else {\n+\t\t\t/* No file without extension, rejected */\n+\t\t\tTRACE(\"File '%s' has no extension, skipping\", fnames[cnt - 1]);\n \t\t\tartifacts[json_data_artifact_count].skip = true;\n \t\t}\n+\t\tfree_string_array(fnames);\n \t}\n \n \treturn SERVER_OK;\n@@ -1216,7 +1264,7 @@ server_op_res_t server_process_update_artifact(int action_id,\n \t}\n \n \t/*\n-\t * Elaborate aritifacts, extract URL for download\n+\t * Elaborate artifacts, extract URL for download\n \t * and check if some of them need some extra work or should be skipped\n \t */\n \tif (json_extract_artifact(json_data_artifact_array, json_data_artifact_max, artifacts) != SERVER_OK)\ndiff --git a/suricatta/server_hawkbit.h b/suricatta/server_hawkbit.h\nindex 69113b3f..4c17ebb9 100644\n--- a/suricatta/server_hawkbit.h\n+++ b/suricatta/server_hawkbit.h\n@@ -90,3 +90,5 @@ typedef struct {\n \tssize_t size;\n \tbool skip;\n } artifact_t;\n+\n+typedef bool(*rule)(artifact_t *artifact);\n", "prefixes": [ "2/9" ] }