Re: [Rpm-maint] [rpm] Rename to pythonX.Ydist, read .dist-info, support legacy pythoneggs()(), and cleanups (#50)

2016-02-11 Thread Florian Festi
Closed #50.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/50#event-547469932___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Rename to pythonX.Ydist, read .dist-info, support legacy pythoneggs()(), and cleanups (#50)

2016-02-11 Thread Florian Festi
Ok, squashed the last three commits and adjusted the commit message a bit. 

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/50#issuecomment-182966562___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Rename to pythonX.Ydist, read .dist-info, support legacy pythoneggs()(), and cleanups (#50)

2016-02-11 Thread Neal Gompa
Florian,

It should be all nice and fixed up in the GitHub PR. I added an extra
patch on top to resolve getopt related issues, so everything should be
peachy. :)

Thanks for the patch. :)

On Thu, Feb 11, 2016 at 11:34 AM, Florian Festi  wrote:
> I think the different cli flags are not orthogonal enough. Here is the
> latest version from the PR plus what I think should be done to get a
> clean behavior.
>
> Anyone missing anything?
>
> Florian
>
> --
>
> Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
> Commercial register: Amtsgericht Muenchen, HRB 153243,
> Managing Directors: Charles Cachera, Michael Cunningham, Michael
> O'Neill, Charles Peters
>
> ___
> Rpm-maint mailing list
> Rpm-maint@lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-maint
>



-- 
真実はいつも一つ!/ Always, there's only one truth!
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Rename to pythonX.Ydist, read .dist-info, support legacy pythoneggs()(), and cleanups (#50)

2016-02-11 Thread Florian Festi
I think the different cli flags are not orthogonal enough. Here is the
latest version from the PR plus what I think should be done to get a
clean behavior.

Anyone missing anything?

Florian

-- 

Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters
>From 3c2c063694b5afe6f5333fda8db721747c952421 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Neal=20Gompa=20=28=E3=83=8B=E3=83=BC=E3=83=AB=E3=83=BB?=
 =?UTF-8?q?=E3=82=B3=E3=82=99=E3=83=B3=E3=83=8F=E3=82=9A=29?=
 
Date: Sun, 29 Nov 2015 08:32:03 -0500
Subject: [PATCH 1/2] Rename to pythonX.Ydist, read .dist-info, support legacy
 pythoneggs()()

Per the recommendation of Nick Coghlan and Toshio Kuratomi,
pythonXegg(M) is being renamed to pythonX.Ydist(M).

An option has also been added to add a pythonXdist(M)
Provides for distributions that may prefer to have it.
The option '--majorver-provides' is intended for use
if only one Python stack per major version will be
available at a given time, as unexpected results may
occur if there are multiple independent Python stacks
per major version available.

Consequently, it will not be on by default when using
the generator for generating Provides.

Additionally, .egg-info data is being replaced with
.dist-info data, so we need to handle that case, too.

See for more details:
https://lists.fedoraproject.org/archives/list/python-devel%40lists.fedoraproject.org/thread/SQBSAS4T25HK5YJBNBSFDD7KDQWDELL6/

Also, Thierry Vignaud brought up on rpm-maint that Mageia
currently uses "pythonegg(X)(M)" (e.g. "pythonegg(3)(rpm)"
for python3 rpm bindings package) in their Python packages
to pull in Python dependencies and requested a way to
not break Mageia.

After discussing with Florian Festi about it, Mageia's
pythonegg(X)(M) will be supported by adding '--legacy'
as a switch to generate legacy Provides/Requires to maintain
compatibility with Mageia's existing usage and to give
them a path to transition from this usage over time.

This switch will also enable pythonXdist(M) Provides format
to allow for a transition, as the conditions for
using pythonXdist(M) are the same as pythonegg(X)(M).

Additionally, the switch '--majorver-prov-with-legacy'
uses new-style dependencies while additionally adding
old-style "pythonegg(X)(M)" Provides for compatibility.
---
 scripts/pythondistdeps.py | 223 ++
 scripts/pythoneggs.py | 191 ---
 2 files changed, 223 insertions(+), 191 deletions(-)
 create mode 100755 scripts/pythondistdeps.py
 delete mode 100755 scripts/pythoneggs.py

diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py
new file mode 100755
index 000..0b94dbd
--- /dev/null
+++ b/scripts/pythondistdeps.py
@@ -0,0 +1,223 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# Copyright 2010 Per Øyvind Karlsen 
+# Copyright 2015 Neal Gompa 
+#
+# This program is free software. It may be redistributed and/or modified under
+# the terms of the LGPL version 2.1 (or later).
+#
+# RPM python dependency generator, using .egg-info/.egg-link/.dist-info data
+#
+
+from __future__ import print_function
+from getopt import getopt
+from os.path import basename, dirname, isdir, sep
+from sys import argv, stdin, version
+from distutils.sysconfig import get_python_lib
+
+
+opts, args = getopt(
+argv[1:], 'hPRrCOEMml:',
+['help', 'provides', 'requires', 'recommends', 'conflicts', 'extras', 'majorver-provides', 'majorver-prov-with-legacy' , 'legacy'])
+
+Provides = False
+Requires = False
+Recommends = False
+Conflicts = False
+Extras = False
+Provides_PyMajorVer_Variant = False
+legacy_Provides = False
+legacy = False
+
+for o, a in opts:
+if o in ('-h', '--help'):
+print('-h, --help\tPrint help')
+print('-P, --provides\tPrint Provides')
+print('-R, --requires\tPrint Requires')
+print('-r, --recommends\tPrint Recommends')
+print('-C, --conflicts\tPrint Conflicts')
+print('-E, --extras\tPrint Extras ')
+print('-M, --majorver-provides\tPrint extra Provides with Python major version only')
+print('-m, --majorver-prov-with-legacy\tPrint extra Provides with Python major version only and extra legacy Provides')
+print('-l, --legacy\tPrint extra legacy pythonegg Provides/Requires instead (also enables --majorver-provides)')
+exit(1)
+elif o in ('-P', '--provides'):
+Provides = True
+elif o in ('-R', '--requires'):
+Requires = True
+elif o in ('-r', '--recommends'):
+Recommends = True
+elif o in ('-C', '--conflicts'):
+Conflicts = True
+elif o in ('-E', '--extras'):
+Extras = True
+elif o in ('-M', '--majorver-provides'):
+Provides_PyMajorVer_Variant = True
+elif o in ('-m', '--majorver-prov-with-legacy'):
+Provides_PyMajorVer_Variant = Tr

Re: [Rpm-maint] PATCH 4/2013 Reimplement setprogname() and getprogname() to be generic and portable

2016-02-11 Thread Florian Festi
Looks like this fell through the cracks back then. I can only guess why.
May be everyone was on vacation...

Anyway this topic came up recently and this looks like the proper
solution. Pushed upstream as 61109446ac67ca8f3d96a5592814561db908d83c
with only very minor corrections as followup patches.

Thanks for the patch!

Florian

On 08/17/2013 09:36 PM, Kamil Rytarowski wrote:
> Hello,
>  
> I'm attaching a big patch refactoring deeply the current setprogname()
> and getprogname() feature.
>  
> Change-log explains everything:
> The RPM code contains setprogname()/getprogname() support implemented
> through compatiblity layer with very old GLIBC (internals supported back
> to '95 and earlier), before stabilization of the GNU C library. This
> compatiblity layer (__progname, __assert_progname, setprogname()) is
> supposed to support well archaic GLIBC, but on the other hand it
> pollutes the library namespace and introduces unpredicable compillation
> errors on BSD systems.
>  
> The functions setprogname() and getprogname() are natively supported in
> NetBSD and work the same way as __progname from the GNU C library (they
> are even implemented in the same way - but with a slightly changed
> logic). The support for very old (20 years and older) GNU C Library is
> obfuscating the code, because it uses defines over defines without a
> word of explaination why to do so.
>  
> It's important to note that the setprogname()/getprogname() was
> inconstiently implemented in the codebase, duplicating the code and/or
> functionality.
>  
> Add new generic functions getprogname() and setprogname() and bind it to:
> - the current and for two decades stable GNU LIB C implementation,
> - the current NetBSD implementation (introduces to NetBSD in 2002),
> - fallback reimplementation functions of the setprogname() and
> getprogname() functionality for other systems.
>  
> Don't support anymore old GNU Lib C internals and don't support older
> NetBSD systems, as they aren't supported for many years.
>  
> Add to the codebase comments explaining the relevant codeparts.
>  
>  
>  
>  
> PLEASE DOUBLE CHECK the patch and changes.
>  
> The patch was originally prepard against RPM 4.11.0.1 (as is my working
> version) and was just matched against the current git repository
> revision. I want to upstream these changes as soon as possible -- as it
> will allow me to work with the vanilla source sooner -- for an upstream
> developer this is very important to work without layer of dozen
> compatiblity patches around the whole code-base.
>  
> As, I'm now away from my working machine, now and I will be away for
> some time -- I can't currently develop it farther (introducing support
> of other Unices, it was really tested and made run on NetBSD-6.1).
>  
> If you agree with the changes, please commit it as it is. If there are
> any bugs introduced (like compilation errors) -- please commit it as it
> is and fix them with a new patch.
>  
> Thank you and regards!
> 
> 
> ___
> Rpm-maint mailing list
> Rpm-maint@lists.rpm.org
> http://lists.rpm.org/mailman/listinfo/rpm-maint
> 


-- 

Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Support Apache Subversion as SCM in the BUILD arena. (#55)

2016-02-11 Thread Andreas Scherer
That's not for me to address. SVN doesn't report an error in applying patches 
when invoked with the `-q`option. You can invoke `%autosetup` with its `-v` 
option to ad 'verbosity'. See also [this 
post](http://mail-archives.apache.org/mod_mbox/subversion-dev/201602.mbox/%3C4451361.UxCNakeCms%40komputer%3E).

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/55#issuecomment-182863063___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Support Apache Subversion as SCM in the BUILD arena. (#55)

2016-02-11 Thread Lubos Kardos
It can be applied also without support for compressed patches but it would be 
nice at least to show some error and fail build when somebody will try to use 
compressed patches with svn. Now no error is showed an build continues without 
applying patches.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/55#issuecomment-182856435___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] rpm scripts

2016-02-11 Thread Florian Festi
On 01/26/2016 01:57 PM, tele wrote:
> I can not find in source code where rpmbuild trying open scripts
> ( for example find-requires )
> Where or how I need looking ?

The dependency generator is using file attributes (see fileattrs/ [1]).
The code handling those can be found in build/rpmfc.[hc] [2].

Florian


[1] https://github.com/rpm-software-management/rpm/tree/master/fileattrs
[2]
https://github.com/rpm-software-management/rpm/blob/master/build/rpmfc.c
https://github.com/rpm-software-management/rpm/blob/master/build/rpmfc.h
-- 

Red Hat GmbH, http://www.de.redhat.com/ Registered seat: Grasbrunn,
Commercial register: Amtsgericht Muenchen, HRB 153243,
Managing Directors: Charles Cachera, Michael Cunningham, Michael
O'Neill, Charles Peters
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


[Rpm-maint] [PATCH] fixes for OS X

2016-02-11 Thread Peter Eisentraut
Attached is a set of patches to make rpm build cleanly on OS X.

Patches 0001, 0002, 0003 should be pretty straightforward and safe.

Patch 0004 looks like an outright bug.  Maybe it works on other
platforms because the rpm packaging of rpm fixes it up somehow.

Patch 0005 is more a hack to get it working, not something ready for
portable use yet.
From 025a52105398fb6f0fcc7d6e24832b67226c Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Mon, 28 Sep 2015 23:49:23 -0400
Subject: [PATCH 1/5] Don't define htonll() if already defined

OS X already has it as a macro in the system headers.
---
 lib/header.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/header.c b/lib/header.c
index d497a3a..81f2038 100644
--- a/lib/header.c
+++ b/lib/header.c
@@ -107,6 +107,7 @@ static const size_t headerMaxbytes = (32*1024*1024);
 	(((_e)->info.tag >= RPMTAG_HEADERIMAGE) && ((_e)->info.tag < RPMTAG_HEADERREGIONS))
 #define	ENTRY_IN_REGION(_e)	((_e)->info.offset < 0)
 
+#ifndef htonll
 /* Convert a 64bit value to network byte order. */
 RPM_GNUC_CONST
 static uint64_t htonll(uint64_t n)
@@ -119,6 +120,7 @@ static uint64_t htonll(uint64_t n)
 #endif
 return n;
 }
+#endif
 
 Header headerLink(Header h)
 {
-- 
2.6.4

From 5e1b39fe48304ae3d0515280933fe4ba2d128264 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Mon, 28 Sep 2015 23:49:24 -0400
Subject: [PATCH 2/5] Supply declaration of fdatasync if missing

OS X has the function but doesn't have a declaration for it.
---
 configure.ac | 1 +
 system.h | 4 
 2 files changed, 5 insertions(+)

diff --git a/configure.ac b/configure.ac
index d6e8c0f..fd73b33 100644
--- a/configure.ac
+++ b/configure.ac
@@ -560,6 +560,7 @@ dnl Checks for library functions.
 AC_CHECK_FUNCS(putenv)
 AC_CHECK_FUNCS(mempcpy)
 AC_CHECK_FUNCS(fdatasync)
+AC_CHECK_DECLS(fdatasync, [], [], [#include ])
 AC_CHECK_FUNCS(lutimes)
 AC_CHECK_FUNCS(mergesort)
 AC_CHECK_FUNCS(getauxval)
diff --git a/system.h b/system.h
index 40b9933..99691f4 100644
--- a/system.h
+++ b/system.h
@@ -78,6 +78,10 @@ char * stpncpy(char * dest, const char * src, size_t n);
 #endif
 #endif
 
+#if defined(HAVE_FDATASYNC) && !HAVE_DECL_FDATASYNC
+extern int fdatasync(int fildes);
+#endif
+
 #include "rpmio/rpmutil.h"
 /* compatibility macros to avoid a mass-renaming all over the codebase */
 #define xmalloc(_size) rmalloc((_size))
-- 
2.6.4

From 87355a35cc5b42248a29e18639e12a4b65291a93 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Mon, 28 Sep 2015 23:49:24 -0400
Subject: [PATCH 3/5] Add missing header files

They are generating warnings.
---
 build/parsePrep.c | 1 +
 build/rpmfc.c | 1 +
 lib/backend/db3.c | 1 +
 lib/transaction.c | 1 +
 misc/fnmatch.c| 2 ++
 5 files changed, 6 insertions(+)

diff --git a/build/parsePrep.c b/build/parsePrep.c
index 7c862ed..b70aee2 100644
--- a/build/parsePrep.c
+++ b/build/parsePrep.c
@@ -6,6 +6,7 @@
 #include "system.h"
 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/build/rpmfc.c b/build/rpmfc.c
index 3637f5c..7c61d9d 100644
--- a/build/rpmfc.c
+++ b/build/rpmfc.c
@@ -1,6 +1,7 @@
 #include "system.h"
 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 7f302a7..9262d04 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -10,6 +10,7 @@ static int _debug = 1;	/* XXX if < 0 debugging, > 0 unusual error returns */
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
diff --git a/lib/transaction.c b/lib/transaction.c
index 66888af..dd9972b 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -5,6 +5,7 @@
 #include "system.h"
 
 #include 
+#include 
 
 #include 		/* rpmMachineScore, rpmReadPackageFile */
 #include 	/* XXX for rpmExpand */
diff --git a/misc/fnmatch.c b/misc/fnmatch.c
index 77fbd93..8de22c8 100644
--- a/misc/fnmatch.c
+++ b/misc/fnmatch.c
@@ -17,7 +17,9 @@
Boston, MA 02111-1307, USA.  */
 
 # include "system.h"
+# include 
 # include 
+# include 
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
 static inline char *
-- 
2.6.4

From a65327700d6798ada18e8fedddf612b4380859d1 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Sat, 10 Oct 2015 22:31:12 -0400
Subject: [PATCH 4/5] Fix rpmquery and rpmverify symlinks

---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 4b5d1d8..134ff55 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -230,9 +230,9 @@ rpmvar_DATA =
 
 install-exec-hook:
 	@rm -f $(DESTDIR)$(bindir)/rpmquery
-	@LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery
+	@LN_S@ rpm $(DESTDIR)$(bindir)/rpmquery
 	@rm -f $(DESTDIR)$(bindir)/rpmverify
-	@LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify
+	@LN_S@ rpm $(DESTDIR)$(bindir)/rpmverify
 
 install-data-local:
 	DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
-- 
2.6.4

From 79cde6b6ffafa7af8a5b0dc02b484d6c6c6ea7a2 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut 
Date: Mon, 28 Sep 2015 23:49:23 -0400

[Rpm-maint] rpm scripts

2016-02-11 Thread tele

I can not find in source code where rpmbuild trying open scripts
( for example find-requires )
Where or how I need looking ?
___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] fixes for OS X (#57)

2016-02-11 Thread Florian Festi
OK, added the first 3 patches. The later two need to be done in a more 
compatible way. I'll have a look on the linked patch for the __progname issue.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/57#issuecomment-182793012___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] fixes for OS X (#57)

2016-02-11 Thread Florian Festi
Closed #57.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/57#event-546952766___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Pythoneggs cleanups (#46)

2016-02-11 Thread Florian Festi
Closed #46.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/46#event-546932390___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint


Re: [Rpm-maint] [rpm] Pythoneggs cleanups (#46)

2016-02-11 Thread Florian Festi
Added the fixes. Making the new dependency generator the default is probably 
going to be up to the distributions. May be we change the default later on.

---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/46#issuecomment-182787312___
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint