Message ID | 20201117094122.2153374-3-sbabic@denx.de |
---|---|
State | Accepted |
Headers | show
Return-Path: <swupdate+bncBCXPLOXJ6IKRBS5VZ36QKGQEUFTXVSI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13b; helo=mail-lf1-x13b.google.com; envelope-from=swupdate+bncbcxploxj6ikrbs5vz36qkgqeuftxvsi@googlegroups.com; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20161025 header.b=UXjgDtbM; dkim-atps=neutral Received: from mail-lf1-x13b.google.com (mail-lf1-x13b.google.com [IPv6:2a00:1450:4864:20::13b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Cb1DH0f6Hz9sRK for <incoming@patchwork.ozlabs.org>; Tue, 17 Nov 2020 20:41:34 +1100 (AEDT) Received: by mail-lf1-x13b.google.com with SMTP id 205sf6179715lfb.17 for <incoming@patchwork.ozlabs.org>; Tue, 17 Nov 2020 01:41:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1605606091; cv=pass; d=google.com; s=arc-20160816; b=uUsm6zAUkpCsX17h95b9gf1bx5J0DWTLT1iecViMjldcU25O5pa63TaUi9SGId9/Yi gYC0xAjcooSn3y8xHxo/rhKnEK0OABmNH245/uDW8jLHwjufL9yk7e569a1JBUI5nNBs WfBP5jRn82+QaNElZxGe5c/NV+rXBWYu01v4nbvQ8gYYmcAxK51wNzBHiVenFFx3qXpO hg+vwIwijFRD6cO7Dn+AyxwaZsuIEV6sI2aPz811TWqHn5b/kPp0SDNJG/AtIS04iT0x Eox8s0LpCc2RDxwm58ztcQKDc90wBs5W71OTZICfATysUJts6UdIGJVFjfaXQ3BnRHOv UMqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=rYDr5B+QiyZE7f9I0arNByFyFRY8JSoKIkKi4UcLR7F2MUqd47bn6O/8gA+QEEe4JM pi0D+oWUdSeL+Cyf49AYyGt8HMULZ1TlKGbmdX44s+JvlGAFlRMhyV5TdT74a0NRC4hR VEbDqPvcc3Y4sRkoYWiH0p6RYwOXUKlnT/WaYNSfeQ/p3jVu8BJzyGBiKjdCRIAr4pEF ElPubXasxcfE+fRfhRPp0H4mhTI6s8Tdud0rZ5b+O64Q08jydQNhR76Z/paYCpGernZz eqE1g59jD53U9FLTZiS/PKhNPc20AMWuIxgUgUSnXJC2p1Mc9uI0Ats64kv3M0B7tWgX PXyg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=UXjgDtbMGCQUpSZdKaxwce+jtqqaJOyd7udsQy8BQkAfAcAiDOFliSheKRIUBDSIaq p1jde2R3h4ZpOd0/Jcmgjn+6/0w6KUWFEZ03/lFMj8Au/zhPmHGKBfwdmNI6af8FRCk/ 09wSb3NBWKDbc+tolTrvTXK8e480YcR/OQmHMvlZR3M6vxlgd9RVZEeogidGZk0AH9x3 MaI5DvoEpA7jhl6NaeeVOOy8HqKb6CbhQQu2Rb4cM4YmsGI1VwfyV2IWmxLXvzhgJVqa AliHKfTuozxWA2vKxsc/0tjmPiBE2co33/OqBRHOXikDFsdrKV8x72K9ftZiLXkFsLkM /6YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=IZ6Xor9mFcY1zuD6WmoQVb1/P2EPqVfLubefyoMjE+o=; b=sCxw1wPA1QAkDbc7tytNKpC56IeKRllk4Nmh+IiiZyLm0sHeC4JV8FXmToBVVEOrZT KekewM3IuaEUa1k0/dDaW7BrDDO/BDbmv/L5EBQ56+1V+qcJ1zB5/CJpVZUE5LMmuaSn 95MyRufLFUo0sD1BXIqp1yaeY3vfFUDcWXg38Xrub7CmqY4i4nCo3OYv0vyXrjTCmkt7 fnVzREVimkb3Kuu4ta/2t4EXM7ShWJvCV/FQRxKzSVqQyOO5ltSts5PEIHZ1WCIYrdEp aWDfXPgxmLhhUJd8yNRymTJ7Oyz8AHXsFL3kxiiPZoMq2WjWtgynd4KymkfcVuru5q4D ZDvg== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOAM5327UpjjJ01xaAY5yxY2fo5N/UnrCri+Z2wM8oe+qlgjZreaNSfy aqqI8RMQ6PvHI8mMxRxVj4k= X-Google-Smtp-Source: ABdhPJx1tnzR5KRcmo0NGaReBh65Mdyo5A17u7O0aFmCh5ErOLUT3SDFrFOPYAGPIUqIsJ23tx/waQ== X-Received: by 2002:a19:54f:: with SMTP id 76mr1482172lff.202.1605606091627; Tue, 17 Nov 2020 01:41:31 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:b0c1:: with SMTP id g1ls2472361ljl.5.gmail; Tue, 17 Nov 2020 01:41:30 -0800 (PST) X-Received: by 2002:a05:651c:152:: with SMTP id c18mr1550757ljd.228.1605606090125; Tue, 17 Nov 2020 01:41:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605606090; cv=none; d=google.com; s=arc-20160816; b=N8/TNqvcbHSR+oYQj5JonyrTLoVwr1P6EZoOnzYaMH3wn0uxKsWCHK19iE5GfCXpF5 NRYXcEITWApq8dMjnmSpbaHBtDY22DDzB8O5aabAeAXlpF1pSf2eM37x7JPeww/esKQb Tg+ezuJV8GMGrGRS1as2eoSkOLUxAmtM5pdGoHumZ1LWqDgrCShDM7ZnT5UmlRR5Urd5 4Wd86tAHMo7xx04cYJgddfCN/psv0Oaac0zPEN9EVk8wfh7zqMLnA94a2caRQwjJBtWa gGeZ160/1rP/G3b2NiLof/TleoFkfixtmIM24tcTrfp0GGgAcNEAOCl9oCi1nmxSGHyP LEEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=F5JFaGg5VnNlRpgEoyZrY+UiyOJCQtb42xFre021XPc=; b=fJMmi/9eHNWjZEuHVhSikLvFL6b4VDj50cU4vjOaUisILZHBppf6XLMEQgJIyodWNN XpE38n8QzaxBr6J5ND1lRf7XJIoSYx2LSF0kSUjvemxTGVBPZBTPLUHfU8GqBndvvLxL fLPJ76tMjNC2Y8QtnYi3GgSBNQt9pG+E1GlmETSy0yDhqgaY+quScJ5GNKIO+hWafgXT MWbSORYhN7BEhBR00jQhzQU+wn/iNjQylgM7TOslqGe7G0Uq0+HVpfuzX0FLcgf5N6pM WTjOB9rZdAhA6lzz5IOnPdYgrms8TbQxnNdsIagIqHUDVrxhv/sAsLbivEuIC907y0y1 KwCw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Received: from mail-out.m-online.net (mail-out.m-online.net. [2001:a60:0:28:0:1:25:1]) by gmr-mx.google.com with ESMTPS id z19si69219lfd.7.2020.11.17.01.41.29 for <swupdate@googlegroups.com> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Nov 2020 01:41:29 -0800 (PST) Received-SPF: neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) client-ip=2001:a60:0:28:0:1:25:1; Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4Cb1D93Rttz1s1JC; Tue, 17 Nov 2020 10:41:29 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4Cb1D93KCQz1rYFK; Tue, 17 Nov 2020 10:41:29 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 2ju_k1xENQtu; Tue, 17 Nov 2020 10:41:28 +0100 (CET) Received: from babic.homelinux.org (host-88-217-136-221.customer.m-online.net [88.217.136.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS; Tue, 17 Nov 2020 10:41:28 +0100 (CET) Received: from localhost (mail.babic.homelinux.org [127.0.0.1]) by babic.homelinux.org (Postfix) with ESMTP id 9DAA74540191; Tue, 17 Nov 2020 10:41:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at babic.homelinux.org Received: from babic.homelinux.org ([127.0.0.1]) by localhost (mail.babic.homelinux.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F9ri6j_-blgh; Tue, 17 Nov 2020 10:41:26 +0100 (CET) Received: from paperino.fritz.box (paperino.fritz.box [192.168.178.64]) by babic.homelinux.org (Postfix) with ESMTP id B4FCE454093B; Tue, 17 Nov 2020 10:41:23 +0100 (CET) From: Stefano Babic <sbabic@denx.de> To: swupdate@googlegroups.com Cc: Stefano Babic <sbabic@denx.de> Subject: [swupdate] [PATCH 3/3] Lua: add function to get selection Date: Tue, 17 Nov 2020 10:41:22 +0100 Message-Id: <20201117094122.2153374-3-sbabic@denx.de> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201117094122.2153374-1-sbabic@denx.de> References: <20201117094122.2153374-1-sbabic@denx.de> MIME-Version: 1.0 X-Original-Sender: sbabic@denx.de X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 2001:a60:0:28:0:1:25:1 is neither permitted nor denied by best guess record for domain of sbabic@denx.de) smtp.mailfrom=sbabic@denx.de Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; 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>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/3] Connect the internal data tree to the shared data structure
|
expand
|
diff --git a/corelib/lua_interface.c b/corelib/lua_interface.c index 73f5a9c..a0d9297 100644 --- a/corelib/lua_interface.c +++ b/corelib/lua_interface.c @@ -831,6 +831,20 @@ static int l_set_bootenv(lua_State *L) { return 0; } +static int l_get_selection(lua_State *L) { + char tmp[SWUPDATE_GENERAL_STRING_SIZE]; + + tmp[0] = '\0'; + get_install_swset(tmp, sizeof(tmp)); + lua_pushstring(L, tmp); + tmp[0] = '\0'; + get_install_running_mode(tmp, sizeof(tmp)); + lua_pushstring(L, tmp); + + return 2; +} + + #ifdef CONFIG_HANDLER_IN_LUA static int l_get_tmpdir(lua_State *L) { @@ -870,6 +884,7 @@ static const luaL_Reg l_swupdate[] = { static const luaL_Reg l_swupdate_bootenv[] = { { "get_bootenv", l_get_bootenv }, { "set_bootenv", l_set_bootenv }, + { "get_selection", l_get_selection }, { NULL, NULL } };
Signed-off-by: Stefano Babic <sbabic@denx.de> --- corelib/lua_interface.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)