[Libguestfs] [PATCH libnbd] golang: make-dist.sh: Generate the list file

Eric Blake eblake at redhat.com
Mon Feb 7 13:13:40 UTC 2022


On Sun, Feb 06, 2022 at 07:21:02PM +0200, Nir Soffer wrote:
> Generated the list file when creating the distribution. Since the Go
> tool treat the list file on the proxy server as the source of truth, we
> do the same. The new list file is created by downloading the current
> list file, sorting it, and appending the current version.
> 
> Creating a distribution tarball requires now access to
> download.libguestfs.org.
> 
> With this change the distribution tarball can be extract on the server
> without any additional manual process.
> 
> Signed-off-by: Nir Soffer <nsoffer at redhat.com>
> ---

>  
> +# Create the list file by amending the curent file on the server.
> +list_url=https://download.libguestfs.org/libnbd/golang/libguestfs.org/libnbd/@v/list
> +curl --silent --show-error "$list_url" | sort > $v_dir/list

Do we want to use 'LC_ALL=C sort' for deterministic sorting, rather
than facing differences when different maintainers use locales with
slightly different collation rules?

Because the curl command is piped to sort, we don't exit the script
with non-zero status if the curl step fails.  Is that problematic?

> +grep -q "$version" $v_dir/list || echo "$version" >> $v_dir/list
> +
>  # Create tarball to upload and extract on the webserver. It should be
>  # extracted in the directory pointed by the "go-import" meta tag.
>  output=$PWD/libnbd-golang-$version.tar.gz
>  tar czf $output libguestfs.org
>  
>  rm -rf libguestfs.org
>  
>  echo output written to $output
> -- 
> 2.34.1
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




More information about the Libguestfs mailing list