Re: [CVS] RPM: rpm/ CHANGES configure.ac rpm/perl/ Makefile.PL.in

2009-03-14 Thread Per Øyvind Karlsen
2009/3/12 Ralf S. Engelschall rse+rpm-de...@rpm5.orgrse%2brpm-de...@rpm5.org


 On Wed, Mar 11, 2009, Per Øyvind Karlsen wrote:

  perl: make sure to link against all required libraries to fix
  build with --no-undefined. (probably room for improval..)

 Yes, and it has to be improved because linking -lpthread breaks on
 platforms where Pthreads are part of libc and no extra libpthread
 is existing! So, this really fixes your particular situation and
 unfortunately breaks others...

 The correct solution is to improve the --with-pthread
 handling itself and then use just its results.

Ah, I suck at with autoconf, I already spent some time on figuring out
how to best deal with this, especially since I noted that it also might
link against a libthread library if present.. I ended up figuring that
it at least would always link against pthread and that wouldn't break
any stuff by always linking perl module against, but I see now that
the check for pthread library doesn't make it mandatory..

I'll try do better. :)

--
Regards,
Per Øyvind


Re: [CVS] RPM: rpm/ CHANGES configure.ac rpm/perl/ Makefile.PL.in

2009-03-14 Thread Jeff Johnson


On Mar 14, 2009, at 12:07 PM, Per Øyvind Karlsen wrote:


2009/3/12 Ralf S. Engelschall rse+rpm-de...@rpm5.org
On Wed, Mar 11, 2009, Per Øyvind Karlsen wrote:

 perl: make sure to link against all required libraries to fix
 build with --no-undefined. (probably room for improval..)

Yes, and it has to be improved because linking -lpthread breaks on
platforms where Pthreads are part of libc and no extra libpthread
is existing! So, this really fixes your particular situation and
unfortunately breaks others...

The correct solution is to improve the --with-pthread
handling itself and then use just its results.
Ah, I suck at with autoconf, I already spent some time on figuring out
how to best deal with this, especially since I noted that it also  
might

link against a libthread library if present.. I ended up figuring that
it at least would always link against pthread and that wouldn't break
any stuff by always linking perl module against, but I see now that
the check for pthread library doesn't make it mandatory..



FWIW, pthreads (or lack thereof) needs to be buried opaquely
in yarn.c, with -lpthreads (or not) attached to -lrpmio
linkage with pkgconfig or (any other means of discovering
what compile/linkage flags are needed like librpmio.la) to
use -lrpmio.

There's a hugely complicated combinatorial failure if
AutoFu alone is used to distribute configuration flags
across various attached meta-components like
rpm-perl and rpm-python that won't ever work well
if/when components (like rpm-perl and rpm-python)
are built outside of the rpm tarball/tree itself.

hth

73 de Jeff

Re: [CVS] RPM: rpm/ CHANGES rpm/lib/ psm.c

2009-03-14 Thread Jeff Johnson

Can you make this truly lazy please?

What you've done is tie mkdir -p for a set
of directories to a single point.

What needs to be done instead is to create the directories as
needed during install.

The hack will be in lib/rpmfi.c, not in lib/psm.c, where
directories for SRPM's are expanded and added to a rpmfi
for a SRPM.

And then --rebuilddb likely doesn't need to go through
rpmInstallSourcePackage at all.


Thanks!

73 de Jeff

On Mar 14, 2009, at 7:46 PM, Per Øyvind Karlsen wrote:


 RPM Package Manager, CVS Repository
 http://rpm5.org/cvs/
  



 Server: rpm5.org Name:   Per Øyvind Karlsen
 Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
 Module: rpm  Date:   15-Mar-2009 00:46:21
 Branch: HEAD Handle: 2009031423461901

 Modified files:
   rpm CHANGES
   rpm/lib psm.c

 Log:
   do lazy mkdir of %_topdir, %_builddir, %_rpmdir  %_srcrpmdir  
when doing
   '--rebuild' so that it should mostly work easily for user.  
(should be done

   better, but code is about to die anyways..)

 Summary:
   RevisionChanges Path
   1.2820  +2  -0  rpm/CHANGES
   2.345   +30 -30 rpm/lib/psm.c
  



 patch -p0 '@@ .'
 Index: rpm/CHANGES
  
= 
= 
= 
= 
= 
= 
==

 $ cvs diff -u -r1.2819 -r1.2820 CHANGES
 --- rpm/CHANGES14 Mar 2009 01:49:00 -  1.2819
 +++ rpm/CHANGES14 Mar 2009 23:46:20 -  1.2820
 @@ -1,5 +1,7 @@

  5.2a3 - 5.2a4:
 +- proyvind: do lazy mkdir of %_topdir, %_builddir, %_rpmdir   
%_srcrpmdir
 +	when doing '--rebuild' so that it should mostly work easily for  
user.
  - proyvind: make it possible to set preferred build  
architectures when using

libcpuinfo with ie. '%_prefer_buildarchs x86_64:i686:i586'.
  - proyvind: get the list of compatible archs printed with '-- 
showrc' from

 @@ .
 patch -p0 '@@ .'
 Index: rpm/lib/psm.c
  
= 
= 
= 
= 
= 
= 
==

 $ cvs diff -u -r2.344 -r2.345 psm.c
 --- rpm/lib/psm.c  7 Mar 2009 13:38:09 -   2.344
 +++ rpm/lib/psm.c  14 Mar 2009 23:46:19 -  2.345
 @@ -144,6 +144,30 @@
  return RPMRC_OK;
  }

 +static rpmRC createDir(rpmts ts, const char ** fn, const char *  
name)

 +{
 +rpmRC rc;
 +const char * N = rpmGenPath(rpmtsRootDir(ts), name, );
 +char * t = xstrdup(name+2);
 +t[strlen(t)-1] = '\0';
 +
 +if(fn) *fn = N;
 +
 +rc = rpmMkdirPath(N, t+1);
 +if (!rc)
 +{
 +  if (Access(N, W_OK))
 +  rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
 +  t, N);
 +#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

 +  else
 +  chown(N, fi-uid, fi-gid);
 +#endif
 +}
 +t = _free(t);
 +return rc;
 +}
 +
  rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd,
const char ** specFilePtr, const char ** cookie)
  {
 @@ -287,37 +311,13 @@
}
  }

 -_sourcedir = rpmGenPath(rpmtsRootDir(ts), %{_sourcedir}, );
 -rpmrc = rpmMkdirPath(_sourcedir, sourcedir);
 -if (rpmrc) {
 -  rpmrc = RPMRC_FAIL;
 +if(createDir(ts, NULL, %{_topdir}) ||
 +  createDir(ts, NULL, %{_builddir}) ||
 +  createDir(ts, NULL, %{_rpmdir}) ||
 +  createDir(ts, NULL, %{_srcrpmdir}) ||
 +  createDir(ts, _sourcedir, %{_sourcedir}) ||
 +  createDir(ts, _specdir, %{_specdir}))
goto exit;
 -}
 -if (Access(_sourcedir, W_OK)) {
 -  rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
 -  _sourcedir, _sourcedir);
 -  rpmrc = RPMRC_FAIL;
 -  goto exit;
 -}
 -#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

 -chown(_sourcedir, fi-uid, fi-gid);
 -#endif
 -
 -_specdir = rpmGenPath(rpmtsRootDir(ts), %{_specdir}, );
 -rpmrc = rpmMkdirPath(_specdir, specdir);
 -if (rpmrc) {
 -  rpmrc = RPMRC_FAIL;
 -  goto exit;
 -}
 -if (Access(_specdir, W_OK)) {
 -  rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
 -  _specdir, _specdir);
 -  rpmrc = RPMRC_FAIL;
 -  goto exit;
 -}
 -#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

 -chown(_specdir, fi-uid, fi-gid);
 -#endif

  /* Build dnl/dil with {_sourcedir, _specdir} as values. */
  if (i  (int)fi-fc) {
 @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-...@rpm5.org


__
RPM Package Manager   

Re: [CVS] RPM: rpm/ CHANGES rpm/lib/ psm.c

2009-03-14 Thread Jeff Johnson


On Mar 14, 2009, at 7:54 PM, Jeff Johnson wrote:


Can you make this truly lazy please?

What you've done is tie mkdir -p for a set
of directories to a single point.

What needs to be done instead is to create the directories as
needed during install.

The hack will be in lib/rpmfi.c, not in lib/psm.c, where
directories for SRPM's are expanded and added to a rpmfi
for a SRPM.



Actually no hack is needed in lib/rpmfi.c. Installing
wiythe fsm/iosm will always create any orphan directories
needed to install files.


And then --rebuilddb likely doesn't need to go through
rpmInstallSourcePackage at all.



The real flwa here is --rebuild continuing to use  
rpmInstallSourcePackage.


Meanwhile, you likely need exactly this patch to keep urpmi (and
other rpm-perl applications) happy.

I hope that clarifies. If not, holler ...

73 de Jeff



Thanks!

73 de Jeff

On Mar 14, 2009, at 7:46 PM, Per Øyvind Karlsen wrote:


RPM Package Manager, CVS Repository
http://rpm5.org/cvs/


Server: rpm5.org Name:   Per Øyvind Karlsen
Root:   /v/rpm/cvs   Email:  pkarl...@rpm5.org
Module: rpm  Date:   15-Mar-2009 00:46:21
Branch: HEAD Handle: 2009031423461901

Modified files:
  rpm CHANGES
  rpm/lib psm.c

Log:
  do lazy mkdir of %_topdir, %_builddir, %_rpmdir  %_srcrpmdir  
when doing
  '--rebuild' so that it should mostly work easily for user.  
(should be done

  better, but code is about to die anyways..)

Summary:
  RevisionChanges Path
  1.2820  +2  -0  rpm/CHANGES
  2.345   +30 -30 rpm/lib/psm.c


patch -p0 '@@ .'
Index: rpm/CHANGES
= 
= 
= 
= 
= 
= 
= 
=

$ cvs diff -u -r1.2819 -r1.2820 CHANGES
--- rpm/CHANGES 14 Mar 2009 01:49:00 -  1.2819
+++ rpm/CHANGES 14 Mar 2009 23:46:20 -  1.2820
@@ -1,5 +1,7 @@

 5.2a3 - 5.2a4:
+- proyvind: do lazy mkdir of %_topdir, %_builddir, %_rpmdir   
%_srcrpmdir
+	when doing '--rebuild' so that it should mostly work easily for  
user.
 - proyvind: make it possible to set preferred build  
architectures when using

libcpuinfo with ie. '%_prefer_buildarchs x86_64:i686:i586'.
 - proyvind: get the list of compatible archs printed with '-- 
showrc' from

@@ .
patch -p0 '@@ .'
Index: rpm/lib/psm.c
= 
= 
= 
= 
= 
= 
= 
=

$ cvs diff -u -r2.344 -r2.345 psm.c
--- rpm/lib/psm.c   7 Mar 2009 13:38:09 -   2.344
+++ rpm/lib/psm.c   14 Mar 2009 23:46:19 -  2.345
@@ -144,6 +144,30 @@
 return RPMRC_OK;
 }

+static rpmRC createDir(rpmts ts, const char ** fn, const char *  
name)

+{
+rpmRC rc;
+const char * N = rpmGenPath(rpmtsRootDir(ts), name, );
+char * t = xstrdup(name+2);
+t[strlen(t)-1] = '\0';
+
+if(fn) *fn = N;
+
+rc = rpmMkdirPath(N, t+1);
+if (!rc)
+{
+   if (Access(N, W_OK))
+   rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
+   t, N);
+#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

+   else
+   chown(N, fi-uid, fi-gid);
+#endif
+}
+t = _free(t);
+return rc;
+}
+
 rpmRC rpmInstallSourcePackage(rpmts ts, void * _fd,
const char ** specFilePtr, const char ** cookie)
 {
@@ -287,37 +311,13 @@
}
 }

-_sourcedir = rpmGenPath(rpmtsRootDir(ts), %{_sourcedir}, );
-rpmrc = rpmMkdirPath(_sourcedir, sourcedir);
-if (rpmrc) {
-   rpmrc = RPMRC_FAIL;
+if(createDir(ts, NULL, %{_topdir}) ||
+   createDir(ts, NULL, %{_builddir}) ||
+   createDir(ts, NULL, %{_rpmdir}) ||
+   createDir(ts, NULL, %{_srcrpmdir}) ||
+   createDir(ts, _sourcedir, %{_sourcedir}) ||
+   createDir(ts, _specdir, %{_specdir}))
goto exit;
-}
-if (Access(_sourcedir, W_OK)) {
-   rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
-   _sourcedir, _sourcedir);
-   rpmrc = RPMRC_FAIL;
-   goto exit;
-}
-#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

-chown(_sourcedir, fi-uid, fi-gid);
-#endif
-
-_specdir = rpmGenPath(rpmtsRootDir(ts), %{_specdir}, );
-rpmrc = rpmMkdirPath(_specdir, specdir);
-if (rpmrc) {
-   rpmrc = RPMRC_FAIL;
-   goto exit;
-}
-if (Access(_specdir, W_OK)) {
-   rpmlog(RPMLOG_ERR, _(cannot write to %%%s %s\n),
-   _specdir, _specdir);
-   rpmrc = RPMRC_FAIL;
-   goto exit;
-}
-#if defined(RPM_VENDOR_OPENPKG) /* switch-from-susr-to-musr-on- 
srpm-install */

-chown(_specdir, fi-uid, fi-gid);
-#endif

 /* Build dnl/dil with {_sourcedir, _specdir} as values. */
 if (i