[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A side note on depricated components vs packagage possibilties (debian)


Le 03/12/2024 à 22:25, gbWilly a écrit :
We see that for example gb.report has been replaced by gb.report2
And you would like to encourage people using the newer one.

Soon, we will see that gb.db2 becomes the norm as gambas3-ide needs it.
So, gb.db should slowly be discouraged or maybe it can even be replaced.

All that depends on code compatibility.
If I for example use gb.db in my projects and a simple change to gb.db2 would not cause trouble and it would be 100% code compatible with my existing code. Then it could easily be replaced, without breaking packages made in the past depending in the old gb.db (or gb.report and so on).

So the question is, are there components that can replace existing onces, without breaking older code?

As an example how to do in a debian recipe I will take gb.db (but it could be gb.report as well):

Package: gambas3-gb-db
Architecture: any
Section: oldlibs
Priority: optional
Depends: gambas3-gb-db2,
          ${misc:Depends}
Description: transitional package
  This is a dummy transitional package. It can safely be removed.

Package: gambas3-gb-db2
Architecture: any
Section: libdevel
Depends: ${misc:Depends},
          gambas3-runtime (>= ${binary:Version})
Breaks: gambas3-gb-db (<< 3.20.0)
Replaces: gambas3-gb-db
Description: Gambas database access common libraries
  Gambas is a free development environment based on a Basic interpreter
  with object extensions, like Visual Basic(tm) (but it is NOT a clone!).
  .
  This package provides the needed common libraries for data access.

If an application is packaged depending on gambas3-gb-db, it will install gambas3-gb-db2.
2 important questions need a positive answer for that:

 1. Does gambas know how to deal with that change?
 2. Are new components code compatible with code once written using the
    old component?
    In short can you just switch the component for the new one, in an
    opened project in IDE,  and then still run the project like before,
    without any code change?

I do not know all the ins and outs of how gambas deals with stuff like that.
The packaging possibilities are there. just saying
And I bet other distro's can do that kind of magic as well.

gbWilly

Gambas3 for Debian <https://gitlab.com/gbWilly/gambas3-debian-repository>

Sent with Proton Mail <https://proton.me/mail/home> secure email.

Even if, for example, 'gb.db2' has the same API (at the moment) as 'gb.db', the replacement of 'gb.db' by 'gb.db2' in a program is entirely up to the program's author.

Automatic replacement is too dangerous, because it can break a program outside of the author's responsability if there is a compatibility bug in the new component.

If the author want to switch to the new component, it will have to make a new version and a new package of its program.

So no automatic replacement, thanks!

Regards,

--
Benoît Minisini.