From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Wed, 11 Dec 2019 01:39:17 +0300 From: "Dmitry V. Levin" To: ALT Devel discussion list Message-ID: <20191210223917.GB31774@altlinux.org> References: <20191206131201.525279-1-mcpain@altlinux.org> <20191210003042.GF15867@altlinux.org> <2881077.pm4W107xvM@work-pc.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="H+4ONPRPur6+Ovig" Content-Disposition: inline In-Reply-To: <2881077.pm4W107xvM@work-pc.localdomain> 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 22:39:17 -0000 Archived-At: List-Archive: List-Post: --H+4ONPRPur6+Ovig Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 10, 2019 at 10:27:54AM +0300, Oleg Solovyov wrote: > On =D7=D4=CF=D2=CE=C9=CB, 10 =C4=C5=CB=C1=C2=D2=D1 2019 =C7. 03:30:42 MSK= Dmitry V. Levin wrote: > > On Fri, Dec 06, 2019 at 04:12:01PM +0300, Oleg Solovyov wrote: > > > --- > > >=20 > > > 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(-) > >=20 > > I agree the code should speak for itself, but it would be great > > if you could shed some light on what's going on. > We're introducing custom callback for higher layers (like packagekit), le= tting=20 > them pass their own callbacks to APT instead of using rpmShowProgress whe= n=20 > it's necessary. > It's useful in particular case of offline updating when packagekit can se= nd=20 > messages to plymouth letting user know about transaction progress but bec= ause=20 > APT does not send anything since it's using rpmShowProgress, packagekit= =20 > reports nothing because it's just nothing to report. Thanks, that's much better, and, btw, that's the main purpose of commit messages - to let people know why you are doing this. > > This looks ugly. Could we use the same values for corresponding > > APTCALLBACK_* and RPMCALLBACK_* constants instead? > They're passed to packagekit. > I don't think it's a good idea to let packagekit know something about RPM= =20 > internals. > Better introduce something similar in APT than include RPM headers in=20 > packagekit (which is two layers above RPM) I think. There is definitely no need to expose rpm internals to apt clients. If you prefer to define APTCALLBACK_* values this way, could you think of an alternative customCallback implementation that would be easy to verify? For example, despite being a C++ project, you are still allowed to use macros: #define DEF_CASE(name) case RPMCALLBACK_ ## name: return APTCALLBACK_ ## na= me --=20 ldv --H+4ONPRPur6+Ovig Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJd8B6VAAoJEAVFT+BVnCUI8hoQAI3+ploQiv2ted99pHBuoui/ SXVxTQkovtZGldB0sL7kflWLdebuAQfcpaBCSLS1JC7AA5YtsWAbndTydKMvG2y0 k3Y+8Ui3lwVu2ucapkyZvuMlRjBGS8MBOJPRQdAoHY2QUDOtLcwqztGv/3XfTNZo W8X6tAyiJUkPUkrbygD5vZJJsJuUEqHke45ISrcCjoQbNYcepQoBDwgD9OUTmH7/ GEXQSF4+ZeaJdmClVNEEjVugz8Trl5WZIJYIGOPfuUEmVToBkrRS4AgCjAbLUseb rID3G4lx6rEOBP7caNdeCdqC1s2lpZRKXB6Bbt+A0SLxbo4rdypbewD5jsIDqKHH UvvhcfYHggNK9WPybZEONaMVuPV83pcA1A5nXARn4E4t6IY07OwdLFplkQLsyrDX MIh/b1eXyS6Uilm3IWEXv1yu+IkHj9puJY49QvDH6aFzAbLZt5PiCehxn8XXlYJx WvGOu1jEZjczXga0g5+Ez5feInNklfVRaU1Bs88k6zQKHtj3/WI8hqVGm68Tx5Xd A50ULW6hkq+JBH98MoiikCm0nUCKWwQ4wNP4DdGEy6MbN5eAuHP3bApHJN9umJMQ rZ3HbSQYow7zhElPSpNibeeuCMbVcUoHrcJSwobEFgYtlNNJbGENqkmnlUhuRxKW JFMD8Lh+M6D9l7F4FFiS =Figa -----END PGP SIGNATURE----- --H+4ONPRPur6+Ovig--