ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Oleg Solovyov <mcpain@altlinux.org>
Cc: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] [PATCH for apt] Implemented generic callback system for package manager transactions
Date: Tue, 10 Dec 2019 03:30:42 +0300
Message-ID: <20191210003042.GF15867@altlinux.org> (raw)
In-Reply-To: <20191206131201.525279-1-mcpain@altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 2444 bytes --]

On Fri, Dec 06, 2019 at 04:12:01PM +0300, Oleg Solovyov wrote:
> ---
>  apt/apt-pkg/packagemanager.cc |   4 +-
>  apt/apt-pkg/packagemanager.h  |  30 +++++++-
>  apt/apt-pkg/rpm/rpmpm.cc      | 137 ++++++++++++++++++++++++++++++++--
>  apt/apt-pkg/rpm/rpmpm.h       |  16 ++--
>  4 files changed, 170 insertions(+), 17 deletions(-)

I agree the code should speak for itself, but it would be great
if you could shed some light on what's going on.

[...]
> +   aptCallbackType callbackType = APTCALLBACK_UNKNOWN;
> +   switch (what) {
> +      case RPMCALLBACK_INST_PROGRESS:
> +         callbackType = APTCALLBACK_INST_PROGRESS;
> +         break;
> +      case RPMCALLBACK_INST_START:
> +         callbackType = APTCALLBACK_INST_START;
> +         break;
> +      case RPMCALLBACK_TRANS_PROGRESS:
> +         callbackType = APTCALLBACK_TRANS_PROGRESS;
> +         break;
> +      case RPMCALLBACK_TRANS_START:
> +         callbackType = APTCALLBACK_TRANS_START;
> +         break;
> +      case RPMCALLBACK_TRANS_STOP:
> +         callbackType = APTCALLBACK_TRANS_STOP;
> +         break;
> +      case RPMCALLBACK_UNINST_PROGRESS:
> +         callbackType = APTCALLBACK_UNINST_PROGRESS;
> +         break;
> +      case RPMCALLBACK_UNINST_START:
> +         callbackType = APTCALLBACK_UNINST_START;
> +         break;
> +      case RPMCALLBACK_UNINST_STOP:
> +         callbackType = APTCALLBACK_UNINST_STOP;
> +         break;
> +      case RPMCALLBACK_UNPACK_ERROR:
> +         callbackType = APTCALLBACK_UNPACK_ERROR;
> +         break;
> +      case RPMCALLBACK_CPIO_ERROR:
> +         callbackType = APTCALLBACK_CPIO_ERROR;
> +         break;
> +      case RPMCALLBACK_SCRIPT_ERROR:
> +         callbackType = APTCALLBACK_SCRIPT_ERROR;
> +         break;
> +      case RPMCALLBACK_SCRIPT_START:
> +         callbackType = APTCALLBACK_SCRIPT_START;
> +         break;
> +      case RPMCALLBACK_SCRIPT_STOP:
> +         callbackType = APTCALLBACK_SCRIPT_STOP;
> +         break;
> +      case RPMCALLBACK_INST_STOP:
> +         callbackType = APTCALLBACK_INST_STOP;
> +         break;
> +      case RPMCALLBACK_ELEM_PROGRESS:
> +         callbackType = APTCALLBACK_ELEM_PROGRESS;
> +         break;
> +      default:
> +         break;
> +   }

This looks ugly.  Could we use the same values for corresponding
APTCALLBACK_* and RPMCALLBACK_* constants instead?


-- 
ldv

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  reply	other threads:[~2019-12-10  0:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 13:12 Oleg Solovyov
2019-12-10  0:30 ` Dmitry V. Levin [this message]
2019-12-10  7:27   ` Oleg Solovyov
2019-12-10 22:39     ` Dmitry V. Levin
2019-12-10  7:37   ` Aleksei Nikiforov
2019-12-10 14:38   ` [devel] [PATCH for apt v2] " Oleg Solovyov
2019-12-11  9:15   ` [devel] [PATCH for apt v3] " Oleg Solovyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191210003042.GF15867@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    --cc=mcpain@altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git