From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 10 Dec 2019 03:30:42 +0300 From: "Dmitry V. Levin" To: Oleg Solovyov Message-ID: <20191210003042.GF15867@altlinux.org> References: <20191206131201.525279-1-mcpain@altlinux.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="MnLPg7ZWsaic7Fhd" Content-Disposition: inline In-Reply-To: <20191206131201.525279-1-mcpain@altlinux.org> Cc: ALT Devel discussion list Subject: Re: [devel] [PATCH for apt] Implemented generic callback system for package manager transactions X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Dec 2019 00:30:43 -0000 Archived-At: List-Archive: List-Post: --MnLPg7ZWsaic7Fhd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =3D APTCALLBACK_UNKNOWN; > + switch (what) { > + case RPMCALLBACK_INST_PROGRESS: > + callbackType =3D APTCALLBACK_INST_PROGRESS; > + break; > + case RPMCALLBACK_INST_START: > + callbackType =3D APTCALLBACK_INST_START; > + break; > + case RPMCALLBACK_TRANS_PROGRESS: > + callbackType =3D APTCALLBACK_TRANS_PROGRESS; > + break; > + case RPMCALLBACK_TRANS_START: > + callbackType =3D APTCALLBACK_TRANS_START; > + break; > + case RPMCALLBACK_TRANS_STOP: > + callbackType =3D APTCALLBACK_TRANS_STOP; > + break; > + case RPMCALLBACK_UNINST_PROGRESS: > + callbackType =3D APTCALLBACK_UNINST_PROGRESS; > + break; > + case RPMCALLBACK_UNINST_START: > + callbackType =3D APTCALLBACK_UNINST_START; > + break; > + case RPMCALLBACK_UNINST_STOP: > + callbackType =3D APTCALLBACK_UNINST_STOP; > + break; > + case RPMCALLBACK_UNPACK_ERROR: > + callbackType =3D APTCALLBACK_UNPACK_ERROR; > + break; > + case RPMCALLBACK_CPIO_ERROR: > + callbackType =3D APTCALLBACK_CPIO_ERROR; > + break; > + case RPMCALLBACK_SCRIPT_ERROR: > + callbackType =3D APTCALLBACK_SCRIPT_ERROR; > + break; > + case RPMCALLBACK_SCRIPT_START: > + callbackType =3D APTCALLBACK_SCRIPT_START; > + break; > + case RPMCALLBACK_SCRIPT_STOP: > + callbackType =3D APTCALLBACK_SCRIPT_STOP; > + break; > + case RPMCALLBACK_INST_STOP: > + callbackType =3D APTCALLBACK_INST_STOP; > + break; > + case RPMCALLBACK_ELEM_PROGRESS: > + callbackType =3D APTCALLBACK_ELEM_PROGRESS; > + break; > + default: > + break; > + } This looks ugly. Could we use the same values for corresponding APTCALLBACK_* and RPMCALLBACK_* constants instead? --=20 ldv --MnLPg7ZWsaic7Fhd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJd7ucyAAoJEAVFT+BVnCUItDIP/3XirsMHuO9NcHOV12zW5JKf 5niUafANB/3NeHY3SEBRP9jeEo8Vz4yNdE4xcrTPCneg/DSUyykoqBhPwTEkHgvt rn+UUdmcnqkd/vWoRqe8rAxKMhUN1TeWO7pDT/zcd1IV6kJJHYJoLHkYyLCLLeIo cT2jMkHbJnYdSXCEsJFvvDo+290GCPol6petqIJjbiu2tUbMV4pDKL7q4LeR8XoE IKNQSnrhsdGxRm03qJYeNYOpxKvWfds0ABwwTp/gBQ2j59SSTHZNBmOpHk6gmfcM ca2DRnjFaFg4Rbi20jSxmW7geINWMHO2rRZYUXs2ZvpKmgy198MX5LweHHkWwZNh DeB/qXFkK+CZAnSupRh9XJuXztOzTmGZBgqlPYMHupshzk/9NEVTcKNsE+iOZGWx t5sq4eAKeYysaTLWnwCW9c+1zK+iM2vv0tzIKA6ZiTGkSMJFebztHaFcX2k2/MYe eTH9pYKKc6a7c0125he5l/o4K5SQBNWz4ik7IlSPp7prVZH4yRQKjcOnnzS7Dvhm k2CTf1oa3cIsExvSm7Em6GwoD5je2iPToUPeAW2Hr91vqY4bWE+RET5lwyZ2TeoB h6A0qaRcEUgCOYMTXgR+PbqM/VwiVu3rCEsFjJGD30s1evJJBjb/Rtk0jSBRkrgk 4EGIRie7ad/Hd1eUIB/A =KzmB -----END PGP SIGNATURE----- --MnLPg7ZWsaic7Fhd--