Re: [Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

2017-03-24 Thread Panu Matilainen

On 03/23/2017 08:22 PM, Gleb Fotengauer-Malinovskiy wrote:

It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.

Signed-off-by: Gleb Fotengauer-Malinovskiy 


After spending a few minutes looking at what it'd take to properly link 
etc ... applied. I dont have a whole lot of sympathy for untested code, 
and rpm has survived 20+ years without a local implementation of this.


On a related note, I suspect the allegedly increased portability in the 
patch adding this local implementation actually broke rpm on some OS'es 
where it previously working because that __progname is not a glibc-only 
thing, and replacing it with a broken implementation...


- Panu -
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

2017-03-24 Thread Panu Matilainen

On 03/24/2017 11:02 AM, Panu Matilainen wrote:

On 03/23/2017 10:48 PM, Dmitry V. Levin wrote:

On Thu, Mar 23, 2017 at 03:08:57PM -0400, Neal Gompa wrote:

On Thu, Mar 23, 2017 at 2:22 PM, Gleb Fotengauer-Malinovskiy wrote:

It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.


Are you sure of this? Because this is supposed to be wired up so RPM
builds and runs correctly on BSDs and Mac OS X... If it's not, then
that's a problem...


Just have a look at the code, it's pretty obvious that it's never been
compiled.


My weary old eyes only spotted some const-correctness issues, I needed
gcc to point out the misspelled variable and the stray #endif.

So yes it's never been compiled and it doesn't seem to get linked
anywhere and ... oh my. Just realized that only fts is being used from
misc/ and everything else there is just dead weight (ditto for
rpmio/stubs) for the last ten years. And seems nobody noticed.



Erm, never mind about the rest being unused, they get included as needed 
via "other means" that are less obvious on the outset.


- Panu -
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

2017-03-24 Thread Panu Matilainen

On 03/23/2017 09:08 PM, Neal Gompa wrote:

On Thu, Mar 23, 2017 at 2:22 PM, Gleb Fotengauer-Malinovskiy
 wrote:

It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.



Are you sure of this? Because this is supposed to be wired up so RPM
builds and runs correctly on BSDs and Mac OS X... If it's not, then
that's a problem...


That's my hazy recollection of this too, but if you look at what it 
actually does...


#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 
|| defined(__DragonFly__) || defined(__APPLE__)

[...]
# include  /* Make sure this header is included */
# define xsetprogname(pn) setprogname(pn)
# define xgetprogname(pn) getprogname(pn)
#elif defined(__GLIBC__) /* GNU LIBC ships with (const *char *) 
__progname */

# define xsetprogname(pn) /* No need to implement it in GNU LIBC. */
  extern const char *__progname;
# define xgetprogname(pn) __progname
#else /* Reimplement setprogname and getprogname */
# include "misc/rpmxprogname.h"
# define xsetprogname(pn) _rpmxsetprogname(pn)
# define xgetprogname() _rpmxgetprogname()
#endif

So Apple and BSD etc dont need any of this, they have native 
setprogname() and getprogname(), and glibc just does it a bit 
differently. The local implementation is for anything unknown, and 
clearly nobody has actually tried it on those other platforms.

Then again this hasn't even been in any released rpm version yet.

I also wonder why it's just not checking for setprogname() existence in 
configure and use that information instead of this "did we remember all 
BSD-based variants" game.


- Panu -

- Panu -
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

2017-03-24 Thread Panu Matilainen

On 03/23/2017 10:48 PM, Dmitry V. Levin wrote:

On Thu, Mar 23, 2017 at 03:08:57PM -0400, Neal Gompa wrote:

On Thu, Mar 23, 2017 at 2:22 PM, Gleb Fotengauer-Malinovskiy wrote:

It can be dropped because this code was never actually enabled.
Actually, this implementation *surely* never ever compiled.


Are you sure of this? Because this is supposed to be wired up so RPM
builds and runs correctly on BSDs and Mac OS X... If it's not, then
that's a problem...


Just have a look at the code, it's pretty obvious that it's never been
compiled.


My weary old eyes only spotted some const-correctness issues, I needed 
gcc to point out the misspelled variable and the stray #endif.


So yes it's never been compiled and it doesn't seem to get linked 
anywhere and ... oh my. Just realized that only fts is being used from 
misc/ and everything else there is just dead weight (ditto for 
rpmio/stubs) for the last ten years. And seems nobody noticed.


- Panu -

___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [PATCH 3/5] Drop local implementation of xsetprogname/xgetprogname

2017-03-23 Thread Dmitry V. Levin
On Thu, Mar 23, 2017 at 03:08:57PM -0400, Neal Gompa wrote:
> On Thu, Mar 23, 2017 at 2:22 PM, Gleb Fotengauer-Malinovskiy wrote:
> > It can be dropped because this code was never actually enabled.
> > Actually, this implementation *surely* never ever compiled.
> 
> Are you sure of this? Because this is supposed to be wired up so RPM
> builds and runs correctly on BSDs and Mac OS X... If it's not, then
> that's a problem...

Just have a look at the code, it's pretty obvious that it's never been
compiled.


-- 
ldv


signature.asc
Description: PGP signature
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint