From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Reza Alizadeh Majd" Subject: Re: query for package updates Date: Sat, 14 Mar 2020 10:03:25 +0330 Message-ID: References: <58b65c16-f3bd-4503-9870-5d168fcbe69d@www.fastmail.com> <87eeu4a7hf.fsf@ambrevar.xyz> <64253f3e-646a-47d1-83a5-ead90844cbe1@www.fastmail.com> <87ftek89o4.fsf@ambrevar.xyz> <0c573dbd-6bd8-4ab0-9674-c75d5c5fa173@www.fastmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:54603) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jD0Mp-0003ZW-3r for help-guix@gnu.org; Sat, 14 Mar 2020 02:33:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jD0Mn-00068q-H6 for help-guix@gnu.org; Sat, 14 Mar 2020 02:33:50 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:37955) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jD0Mm-00065m-U1 for help-guix@gnu.org; Sat, 14 Mar 2020 02:33:49 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 3A5AA863 for ; Sat, 14 Mar 2020 02:33:46 -0400 (EDT) In-Reply-To: <0c573dbd-6bd8-4ab0-9674-c75d5c5fa173@www.fastmail.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: help-guix mailing list Just wanted to ping this up/ does anyone have any suggestion about following script, that I wrote to check about available package updates for a profile? On Thu, Mar 12, 2020, at 1:00 AM, Reza Alizadeh Majd wrote: > playing with the Guix sources, I wrote following Guile script in order to > check available updates for a profile. > > Is it suitable for this purpose or I need to include additional checks > on my script? > > > (define-module (px tools updater) > #:use-module (guix profiles) > #:use-module (guix utils) > #:use-module (srfi srfi-1) > #:export (check-entry > check-manifest > check-profile)) > > (define (check-entry entry manifest) > "Recursive update check for a manifest entry" > (let* ((pattern (manifest-pattern > (name (manifest-entry-name entry)) > (output (manifest-entry-output entry)))) > (previous (manifest-lookup manifest pattern)) > (newer? (and previous > (version>? (manifest-entry-version entry) > (manifest-entry-version previous))))) > (fold (lambda (child-entry result) > (or result > (check-entry child-entry manifest))) > newer? (manifest-entry-dependencies entry)))) > > > (define (check-manifest manifest) > "Check if any update available for a manifest" > (fold (lambda (entry previous) > (or previous (check-entry entry manifest))) > #f (manifest-entries manifest))) > > > (define* (check-profile #:optional (profile %current-profile)) > "Check if any update is available for a profile" > (let ((manifest (profile-manifest profile))) > (check-manifest manifest))) > > > -- > Regards > Reza Alizadeh Majd > PantherX Team > > -- Regards Reza Alizadeh Majd PantherX Team