diff mbox series

[linux-snap,xenial,master] Copy host trusted.gpg keyring only when it exists

Message ID 20210525105445.2397034-1-jesse.sung@canonical.com
State New
Headers show
Series [linux-snap,xenial,master] Copy host trusted.gpg keyring only when it exists | expand

Commit Message

Wen-chien Jesse Sung May 25, 2021, 10:54 a.m. UTC
The file may not be available when the snap doesn't build on Launchpad.

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
 Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Stefan Bader June 2, 2021, 8:19 a.m. UTC | #1
On 25.05.21 12:54, Wen-chien Jesse Sung wrote:
> The file may not be available when the snap doesn't build on Launchpad.
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
> ---

I guess same why bother but it does not hurt as it is with bionic.

-Stefan

>   Makefile | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6f64547..4c1f7f0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -82,7 +82,9 @@ prepare-chroot:
>   	# already added there. This does not matter as long as adding the
>   	# key will not require installing some additional package.
>   	cp /etc/apt/sources.list chroot/etc/apt/sources.list
> -	cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg
> +	if [ -f /etc/apt/trusted.gpg ]; then \
> +		cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg; \
> +	fi
>   	echo "deb http://ppa.launchpad.net/snappy-dev/image/ubuntu $(RELEASE) main" >> chroot/etc/apt/sources.list
>   
>   	# install all updates
>
Kleber Sacilotto de Souza June 29, 2021, 8:11 a.m. UTC | #2
On 25.05.21 12:54, Wen-chien Jesse Sung wrote:
> The file may not be available when the snap doesn't build on Launchpad.
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>


Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

Thanks

> ---
>   Makefile | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6f64547..4c1f7f0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -82,7 +82,9 @@ prepare-chroot:
>   	# already added there. This does not matter as long as adding the
>   	# key will not require installing some additional package.
>   	cp /etc/apt/sources.list chroot/etc/apt/sources.list
> -	cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg
> +	if [ -f /etc/apt/trusted.gpg ]; then \
> +		cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg; \
> +	fi
>   	echo "deb http://ppa.launchpad.net/snappy-dev/image/ubuntu $(RELEASE) main" >> chroot/etc/apt/sources.list
>   
>   	# install all updates
>
Kleber Sacilotto de Souza June 29, 2021, 8:14 a.m. UTC | #3
On 25.05.21 12:54, Wen-chien Jesse Sung wrote:
> The file may not be available when the snap doesn't build on Launchpad.
> 
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
> ---
>   Makefile | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 6f64547..4c1f7f0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -82,7 +82,9 @@ prepare-chroot:
>   	# already added there. This does not matter as long as adding the
>   	# key will not require installing some additional package.
>   	cp /etc/apt/sources.list chroot/etc/apt/sources.list
> -	cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg
> +	if [ -f /etc/apt/trusted.gpg ]; then \
> +		cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg; \
> +	fi
>   	echo "deb http://ppa.launchpad.net/snappy-dev/image/ubuntu $(RELEASE) main" >> chroot/etc/apt/sources.list
>   
>   	# install all updates
> 

Applied to linux-snap/xenial/master branch.

Thanks,
Kleber
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 6f64547..4c1f7f0 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,9 @@  prepare-chroot:
 	# already added there. This does not matter as long as adding the
 	# key will not require installing some additional package.
 	cp /etc/apt/sources.list chroot/etc/apt/sources.list
-	cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg
+	if [ -f /etc/apt/trusted.gpg ]; then \
+		cp /etc/apt/trusted.gpg chroot/etc/apt/trusted.gpg.d/host-trusted.gpg; \
+	fi
 	echo "deb http://ppa.launchpad.net/snappy-dev/image/ubuntu $(RELEASE) main" >> chroot/etc/apt/sources.list
 
 	# install all updates