Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Arkadiusz Miskiewicz
On Friday 09 of November 2007, Patryk Zawadzki wrote:
 Last year rpm switched the /etc/rpm/sysinfo syntax. Now it expects
 /etc/rpm/sysinfo to be a directory with following files inside:

Not expects. It simply supports both schemas.

 Therefore I propose fixing the packaging to adapt the new upstream format.

Go for it :-)

-- 
Arkadiusz MiƛkiewiczPLD/Linux Team
arekm / maven.plhttp://ftp.pld-linux.org/
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Patryk Zawadzki
2007/11/9, Arkadiusz Miskiewicz [EMAIL PROTECTED]:
 On Friday 09 of November 2007, Patryk Zawadzki wrote:
  Last year rpm switched the /etc/rpm/sysinfo syntax. Now it expects
  /etc/rpm/sysinfo to be a directory with following files inside:

 Not expects. It simply supports both schemas.

  Therefore I propose fixing the packaging to adapt the new upstream format.

 Go for it :-)

Would do that already but I have some questions:

* do we provide all (empty) files marked as config,noreplace or do we
just ship Filelinktos?

* rename rpm.sysinfo to rpm.sysinfo.Filelinktos or just create them
inline in the spec (cat  EOF)?

* which branches to fix?

-- 
Patryk Zawadzki
PLD Linux Distribution
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Patryk Zawadzki
2007/11/9, Jeff Johnson [EMAIL PROTECTED]:
 On Nov 9, 2007, at 9:13 AM, Arkadiusz Miskiewicz wrote:
  On Friday 09 of November 2007, Patryk Zawadzki wrote:
  Last year rpm switched the /etc/rpm/sysinfo syntax. Now it expects
  /etc/rpm/sysinfo to be a directory with following files inside:
 
  Not expects. It simply supports both schemas.
 
  Therefore I propose fixing the packaging to adapt the new upstream
  format.
 
  Go for it :-)
 But be prepared for the next generalization (and levels of
 incompatibility)
 when I get around to using YAML instead of the /etc/rpm/sysinfo file
 (originally)
 or directory tree (currently).

 What I'd like to see is a seamless representation where the YAML
 hierarchy
 or the directory hierarchy can be used interchangeably for carrying
 around
 wads of metadata organized in a hierarchical fashion.

Are there plans on supporting an API to modify this data? I mean other
than launching vim and typing stuff by hand I'd like to be able to use
- say - Python and write:

rpmds.AddNode(parent = None, type = rpmds.REQUIRES, nevra = someNevra,
rel = rpmdb.GREATER_EQUAL)

or something similar not having to care about the file format.

-- 
Patryk Zawadzki
PLD Linux Distribution
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Jakub Bogusz
On Fri, Nov 09, 2007 at 03:06:23PM +0100, Patryk Zawadzki wrote:
 Last year rpm switched the /etc/rpm/sysinfo syntax. Now it expects
 /etc/rpm/sysinfo to be a directory with following files inside:
 
 Providename,
 Requirename,
 Conflictname,
 Obsoletename,
 Dirnames,
 Filelinktos
 
 (Taken from rpm/lib/rpmds.c)
 
 In PLD we still provide it as a file which limits its use (the
 fallback treats everything in the file as Providename).
 
 After doing:
 
 mv /etc/rpm/sysinfo{,.old}
 mkdir /etc/rpm/sysinfo
 mv /etc/rpm/sysinfo{.old,/Filelinktos}
 
 We can do useful stuff like:
 
 echo foo = 0.2  /etc/rpm/sysinfo/Requirename
 
 to pin a certain package a'la Gentoo's world package. Both sysadmins
 and poldek could benefit from this feature (poldek would need a helper
 binary called via sudo to alter the contents but it uses sudo for rpm
 anyway).
 
 Therefore I propose fixing the packaging to adapt the new upstream format.

Uhm, could it be /etc/rpm/sysinfo.d/* ?
Switching a name between being file and directory is PITA with rpm.


-- 
Jakub Boguszhttp://qboosh.pl/
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Patryk Zawadzki
2007/11/9, Jakub Bogusz [EMAIL PROTECTED]:
 On Fri, Nov 09, 2007 at 03:06:23PM +0100, Patryk Zawadzki wrote:
  Last year rpm switched the /etc/rpm/sysinfo syntax. Now it expects
  /etc/rpm/sysinfo to be a directory with following files inside:
 
  Providename,
  Requirename,
  Conflictname,
  Obsoletename,
  Dirnames,
  Filelinktos
 
  (Taken from rpm/lib/rpmds.c)
 
  In PLD we still provide it as a file which limits its use (the
  fallback treats everything in the file as Providename).
 
  After doing:
 
  mv /etc/rpm/sysinfo{,.old}
  mkdir /etc/rpm/sysinfo
  mv /etc/rpm/sysinfo{.old,/Filelinktos}
 
  We can do useful stuff like:
 
  echo foo = 0.2  /etc/rpm/sysinfo/Requirename
 
  to pin a certain package a'la Gentoo's world package. Both sysadmins
  and poldek could benefit from this feature (poldek would need a helper
  binary called via sudo to alter the contents but it uses sudo for rpm
  anyway).
 
  Therefore I propose fixing the packaging to adapt the new upstream format.

 Uhm, could it be /etc/rpm/sysinfo.d/* ?
 Switching a name between being file and directory is PITA with rpm.

The default (rpm/lib/rpmds.c ~ 1546) is:
#define _ETC_RPM_SYSINFOSYSCONFIGDIR /sysinfo

We can patch either that line or just override the macro used to get
the path later (same file ~ 1571):
rpmExpand(%{?_rpmds_sysinfo_path}, NULL)

The function rpmdsSysinfo is always called with NULL as filename so it
always resorts to evaluating that macro.

-- 
Patryk Zawadzki
PLD Linux Distribution
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en


Re: [th] rpm.spec - packaging problem

2007-11-09 Thread Patryk Zawadzki
2007/11/9, Patryk Zawadzki [EMAIL PROTECTED]:
 The default (rpm/lib/rpmds.c ~ 1546) is:
 #define _ETC_RPM_SYSINFOSYSCONFIGDIR /sysinfo

Upon further investigation, this is used as a callback when the macro
below returns nothing, so the answer is clear:

 We can patch either that line or just override the macro used to get
 the path later (same file ~ 1571):
 rpmExpand(%{?_rpmds_sysinfo_path}, NULL)

 The function rpmdsSysinfo is always called with NULL as filename so it
 always resorts to evaluating that macro.

And that's defined in /etc/rpm/macros

-- 
Patryk Zawadzki
PLD Linux Distribution
___
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en