Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to master grimoire by Remko van der Vossen (001758c5753fae25ad647fa9492165e489fd7263)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Remko van der Vossen <wich AT sourcemage.org>
  • To: ismael AT sourcemage.org
  • Cc: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to master grimoire by Remko van der Vossen (001758c5753fae25ad647fa9492165e489fd7263)
  • Date: Mon, 6 May 2019 13:22:29 +0200

Ismael,

I made below changes to make the gnupg -> gnupg-2.2 upgrade go
succesfully, but in order to do so I am doing various calls from
PRE_BUILD into the internals of sorcery. I could of course copy all
behavior directly into the spell, but I would like to leverage what
sorcery already does and this way it hopefully all behaves in the same
way as any other spell, even if the implementation of some of these
functions change somewhat.

I thought you should at least be aware of it, and perhaps you have some
ideas on better solutions.

Personally I think that long term we should probably offer separate
functions and/or options on unpack_file to be able to force using
coreutils for the hash verification and/or be able to do verification
and unpacking itself separately.

Regards, Remko

On Mon, May 06, 2019 at 11:06:14AM +0000, Remko van der Vossen wrote:
> GIT changes to master grimoire by Remko van der Vossen
> <wich AT sourcemage.org>:
>
> crypto/gnupg-2.2/CONFLICTS | 3 ++-
> crypto/gnupg-2.2/DETAILS | 5 +----
> crypto/gnupg-2.2/HISTORY | 5 +++++
> crypto/gnupg-2.2/PRE_BUILD | 30 ++++++++++++++++++++++++++++++
> 4 files changed, 38 insertions(+), 5 deletions(-)
>
> New commits:
> commit 001758c5753fae25ad647fa9492165e489fd7263
> Author: Remko van der Vossen <wich AT sourcemage.org>
> Commit: Remko van der Vossen <wich AT sourcemage.org>
>
> gnupg-2.2: conflicts gnupg
>
> commit e71434012e387a79e5fb779b2b0c18435e7b8858
> Author: Remko van der Vossen <wich AT sourcemage.org>
> Commit: Remko van der Vossen <wich AT sourcemage.org>
>
> gnupg-2.2: allow casting of gnupg-2.2 without gpg
>
> When migrating from one gnupg spell to another, such as the migration
> from gnupg to gnupg-2.2 which is triggered by the deprecation of gnupg
> the source verification of the target spell fails as sorcery attempts to
> perform this with gpg, which is not present on the system as the
> originally installed spell for gnupg is already removed due to a
> conflict from either the original and/or new spell.
>
> This change allow casting of gnupg-2.2 without gpg present on the
> system, this is done by doing the source verification manually using
> sha512sum from coreutils in PRE_BUILD. Unpacking of the sources is done
> using sorcery, but as the external api does not provide a function to do
> unpacking without verification this is done by calling into the
> internals of sorcery.
>
> diff --git a/crypto/gnupg-2.2/CONFLICTS b/crypto/gnupg-2.2/CONFLICTS
> index 529e8d0..965212a 100755
> --- a/crypto/gnupg-2.2/CONFLICTS
> +++ b/crypto/gnupg-2.2/CONFLICTS
> @@ -1,2 +1,3 @@
> -conflicts gnupg-exp
> +conflicts gnupg y
> +conflicts gnupg-exp y
> conflicts gnupg-2.1 y
> diff --git a/crypto/gnupg-2.2/DETAILS b/crypto/gnupg-2.2/DETAILS
> index 46ba8fc..1959d3a 100755
> --- a/crypto/gnupg-2.2/DETAILS
> +++ b/crypto/gnupg-2.2/DETAILS
> @@ -3,10 +3,7 @@
> SECURITY_PATCH=1
> SOURCE=gnupg-$VERSION.tar.bz2
> SOURCE_URL[0]=https://gnupg.org/ftp/gcrypt/gnupg/$SOURCE
> - SOURCE2=$SOURCE.sig
> - SOURCE2_URL[0]=${SOURCE_URL[0]}.sig
> - SOURCE_GPG=GnuPG.gpg:$SOURCE.sig:UPSTREAM_KEY
> - SOURCE2_IGNORE=signature
> +
> SOURCE_HASH=sha512:7c6f0092d384fd71fc7a1c905ce23ae98df42ce131ee09fc190c275f9c8d0912be344b0782244cccb5b3938322ef3cfff8ed1ec7e949e761478b8c5110dde36a
> SOURCE_DIRECTORY=$BUILD_DIRECTORY/gnupg-$VERSION
> WEB_SITE=https://www.gnupg.org
> ENTERED=20141108
> diff --git a/crypto/gnupg-2.2/HISTORY b/crypto/gnupg-2.2/HISTORY
> index e81c14e..5ec2435 100644
> --- a/crypto/gnupg-2.2/HISTORY
> +++ b/crypto/gnupg-2.2/HISTORY
> @@ -1,3 +1,8 @@
> +2019-05-06 Remko van der Vossen <wich AT sourcemage.org>
> + * DETAILS, PRE_BUILD: allow casting of gnupg-2.2 without gpg present
> on
> + the system
> + * CONFLICTS: conflict with gnupg
> +
> 2019-03-26 Treeve Jelbert <treeve AT sourcemage.org>
> * DETAILS: version 2.2.15
>
> diff --git a/crypto/gnupg-2.2/PRE_BUILD b/crypto/gnupg-2.2/PRE_BUILD
> new file mode 100755
> index 0000000..986567c
> --- /dev/null
> +++ b/crypto/gnupg-2.2/PRE_BUILD
> @@ -0,0 +1,30 @@
> +# Manual verification using sha512sum as we cannot be sure that gpg is
> +# available. The code is mostly copied from sorcery's libunpack
> +sha512_verify() {
> + local FILENAME="$( guess_filename "$SOURCE_CACHE/$1" )"
> + local HASHSUM="$( echo "$2" | cut -d: -f2 )"
> +
> + local HASH="$(sha512sum "$FILENAME" | cut -d' ' -f1)"
> + local rc=$?
> +
> + if [[ "$HASH" != "$HASHSUM" ]] || [[ $rc != 0 ]]
> + then
> + error_message "${PROBLEM_COLOR}$ALGORITHM check failed!" &&
> + error_message "$HASH (computed) != $HASHSUM (expected)!$DEFAULT_COLOR"
> &&
> + hash_user_query 1 "$SPELL" spell || return 1
> + else
> + is_allowed_hash "$ALGORITHM" "$HLEVEL"
> + rc=$?
> + hash_user_query $rc "$SPELL" spell || return 1
> + fi
> + return 0
> +}
> +
> +mk_source_dir "$SOURCE_DIRECTORY" &&
> +cd "$BUILD_DIRECTORY" &&
> +sha512_verify "$SOURCE" "$SOURCE_HASH" &&
> +
> +# cheating and using internal function uncompress_unpack instead of
> unpack_file
> +# so as not to trigger the gpg based verification, which we already did
> +# ourselves before
> +uncompress_unpack "$SOURCE"
> _______________________________________________
> SM-Commit mailing list
> SM-Commit AT lists.ibiblio.org
> https://lists.ibiblio.org/mailman/listinfo/sm-commit




Archive powered by MHonArc 2.6.24.

Top of Page