Jeff, Kindly, it would be possible to know better the objective of this patch ?
Perhaps the plan of re-unification or interoperability with deb has resumed? Just for a better understanding. Best regards On Fri, Jun 13, 2008 at 10:32 AM, Jeff Johnson <[EMAIL PROTECTED]> wrote: > RPM Package Manager, CVS Repository > http://rpm5.org/cvs/ > > ____________________________________________________________________________ > > Server: rpm5.org Name: Jeff Johnson > Root: /v/rpm/cvs Email: [EMAIL PROTECTED] > Module: rpm Date: 13-Jun-2008 10:32:02 > Branch: HEAD Handle: 2008061308320101 > > Modified files: > rpm CHANGES rpmpopt.in > rpm/rpmdb hdrfmt.c > > Log: > - add --deb:foo aliases for *.deb spewage. > > Summary: > Revision Changes Path > 1.2411 +1 -0 rpm/CHANGES > 1.107 +68 -7 rpm/rpmdb/hdrfmt.c > 2.66 +89 -1 rpm/rpmpopt.in > > ____________________________________________________________________________ > > patch -p0 <<'@@ .' > Index: rpm/CHANGES > > ============================================================================ > $ cvs diff -u -r1.2410 -r1.2411 CHANGES > --- rpm/CHANGES 13 Jun 2008 06:18:56 -0000 1.2410 > +++ rpm/CHANGES 13 Jun 2008 08:32:01 -0000 1.2411 > @@ -1,5 +1,6 @@ > > 5.1.0 -> 5.2a0: > + - jbj: add --deb:foo aliases for *.deb spewage. > - jbj: rework :strsub find-and-replace to use mire patterns. > - jbj: mire: add REG_NEWLINE to default regex compilation. > - jbj: add :strsub format extension find-and-replace using posix > RE's. > @@ . > patch -p0 <<'@@ .' > Index: rpm/rpmdb/hdrfmt.c > > ============================================================================ > $ cvs diff -u -r1.106 -r1.107 hdrfmt.c > --- rpm/rpmdb/hdrfmt.c 13 Jun 2008 06:18:57 -0000 1.106 > +++ rpm/rpmdb/hdrfmt.c 13 Jun 2008 08:32:02 -0000 1.107 > @@ -20,7 +20,7 @@ > *__inbuf, *__inbytesleft, *__outbuf, *__outbytesleft @*/; > > extern int iconv_close(/[EMAIL PROTECTED]@*/ iconv_t __cd) > - /[EMAIL PROTECTED] __cd @*/; > + /[EMAIL PROTECTED] __cd @*/; > /[EMAIL PROTECTED] =incondefs @*/ > #endif > #endif > @@ -2345,6 +2345,65 @@ > return _fnTag(h, he); > } > > +/** > + * Retrieve digest/path pairs for --deb:md5sums. > + * @param h header > + * @retval *he tag container > + * @return 0 on success > + */ > +static int debmd5sumsTag(Header h, HE_t he) > + /[EMAIL PROTECTED] he @*/ > +{ > + HE_t nhe = memset(alloca(sizeof(*nhe)), 0, sizeof(*nhe)); > + HE_t dhe = memset(alloca(sizeof(*dhe)), 0, sizeof(*dhe)); > + char * t, * te; > + size_t nb = 0; > + int rc = 1; > + int xx; > + int i; > + > + nhe->tag = RPMTAG_FILEPATHS; > + if (!(xx = headerGet(h, nhe, 0))) > + goto exit; > + dhe->tag = RPMTAG_FILEDIGESTS; > + if (!(xx = headerGet(h, dhe, 0))) > + goto exit; > + > + he->tag = tagValue("Debmd5sums"); > + he->t = RPM_STRING_ARRAY_TYPE; > + he->c = 0; > + he->freeData = 1; > + for (i = 0; i < (int)dhe->c; i++) { > + if (!(dhe->p.argv[i] && *dhe->p.argv[i])) > + continue; > + nb += sizeof(*he->p.argv); > + nb += strlen(dhe->p.argv[i]) + sizeof(" ") + strlen(nhe->p.argv[i]) > - 1; > + he->c++; > + } > + nb += sizeof(*he->p.argv); > + > + he->p.argv = xmalloc(nb); > + te = (char *) &he->p.argv[he->c+1]; > + > + he->c = 0; > + for (i = 0; i < (int)dhe->c; i++) { > + if (!(dhe->p.argv[i] && *dhe->p.argv[i])) > + continue; > + he->p.argv[he->c++] = te; > + t = rpmExpand(dhe->p.argv[i], " ", nhe->p.argv[i]+1, NULL); > + te = stpcpy(te, t); > + te++; > + t = _free(t); > + } > + he->p.argv[he->c] = NULL; > + rc = 0; > + > +exit: > + nhe->p.ptr = _free(nhe->p.ptr); > + dhe->p.ptr = _free(dhe->p.ptr); > + return rc; > +} > + > static int filestatTag(Header h, HE_t he) > /[EMAIL PROTECTED] he @*/ > { > @@ -3777,6 +3836,8 @@ > { .tagFunction = F1sqlTag } }, > { HEADER_EXT_TAG, "RPMTAG_FILESSQLENTRY2", > { .tagFunction = F2sqlTag } }, > + { HEADER_EXT_TAG, "RPMTAG_DEBMD5SUMS", > + { .tagFunction = debmd5sumsTag } }, > { HEADER_EXT_FORMAT, "armor", > { .fmtFunction = armorFormat } }, > { HEADER_EXT_FORMAT, "base64", > @@ -3928,11 +3989,11 @@ > */ > struct sprintfToken_s { > enum { > - PTOK_NONE = 0, > - PTOK_TAG = 1, > - PTOK_ARRAY = 2, > - PTOK_STRING = 3, > - PTOK_COND = 4 > + PTOK_NONE = 0, > + PTOK_TAG = 1, > + PTOK_ARRAY = 2, > + PTOK_STRING = 3, > + PTOK_COND = 4 > } type; > union { > struct sprintfTag_s tag; /*!< PTOK_TAG */ > @@ -4624,7 +4685,7 @@ > /[EMAIL PROTECTED]@*/ > > if (dst != NULL) > - *dst = '\0'; > + *dst = '\0'; > > for (i = 0; i < (unsigned) numTokens; i++) { > token = format + i; > @@ . > patch -p0 <<'@@ .' > Index: rpm/rpmpopt.in > > ============================================================================ > $ cvs diff -u -r2.65 -r2.66 rpmpopt.in > --- rpm/rpmpopt.in 29 May 2008 13:45:20 -0000 2.65 > +++ rpm/rpmpopt.in 13 Jun 2008 08:32:01 -0000 2.66 > @@ -2,7 +2,7 @@ > # \verbatim > # > # @USRLIBRPM@/@configure_input@ > -# $Id: rpmpopt.in,v 2.65 2008/05/29 13:45:20 jbj Exp $ > +# $Id: rpmpopt.in,v 2.66 2008/06/13 08:32:01 jbj Exp $ > # > # This file *should not be modified*. Local customizations > # belong in /etc/popt, not here. This file will be replaced > @@ -103,6 +103,94 @@ > --POPTdesc=$"list metadata in yaml" > > > #============================================================================== > +rpm alias --deb:control --qf '\ > +Package: %{NAME}\ > +\nVersion: %|EPOCH?{%{EPOCH}:}|%{VERSION}-%{RELEASE}\ > +\nSection: %{GROUP}\ > +%|Priority?{\ > +\nPriority: %{Priority}\ > +}:{\ > +\nPriority: standard\ > +}|\ > +\nArchitecture: %{ARCH:strsub(noarch,all,src,source)}\ > +%|Essential?{\ > +\nEssential: %{Essential}\ > +}|\ > +%|REQUIRENAME?{\ > +\nDepends:[ %{REQUIRENAME:contains(N)}]\ > +}|\ > +%|Predepends?{\ > +\nPre-Depends:[ %{Predepends}]\ > +}|\ > +%|Recommends?{\ > +\nRecommends:[ %{Recommends}]\ > +}|\ > +%|Suggests?{\ > +\nSuggests:[ %{Suggests}]\ > +}|\ > +%|Enhances?{\ > +\nEnhances:[ %{Enhances}]\ > +}|\ > +%|Breaks?{\ > +\nBreaks:[ %{Breaks}]\ > +}|\ > +%|CONFLICTNAME?{\ > +\nConflicts:[ %{CONFLICTNAME:contains(N)}]\ > +}|\ > +\nInstalled-Size: %{SIZE}\ > +%|PACKAGER?{\ > +\nMaintainer: %{PACKAGER}\ > +}|\ > +\nDescription: %{SUMMARY}\ > +\n%{DESCRIPTION:strsub(^, )}\ > +%|URL?{\ > +\nHomepage: %{URL}\ > +}|\ > +\n' \ > + --POPTdesc=$"display binary debian/control file" > + > +rpm alias --deb:preinst --qf '\ > +%|PREIN?{\ > +%|PREINPROG?{#!%{PREINPROG})}:{#!/bin/sh}|\ > +\n%{PREIN}\ > +}|\ > +\n' \ > + --POPTdesc=$"display debian/preinst script" > + > +rpm alias --deb:postinst --qf '\ > +%|POSTIN?{\ > +%|POSTINPROG?{#!%{POSTINPROG})}:{#!/bin/sh}|\ > +\n%{POSTIN}\ > +}|\ > +\n' \ > + --POPTdesc=$"display debian/postinst script" > + > +rpm alias --deb:prerm --qf '\ > +%|PREUN?{\ > +%|PREUNPROG?{#!%{PREUNPROG})}:{#!/bin/sh}|\ > +\n%{PREUN}\ > +}|\ > +\n' \ > + --POPTdesc=$"display debian/prerm script" > + > +rpm alias --deb:postrm --qf '\ > +%|POSTUN?{\ > +%|POSTUNPROG?{#!%{POSTUNPROG})}:{#!/bin/sh}|\ > +\n%{POSTUN}\ > +}|\ > +\n' \ > + --POPTdesc=$"display debian/postrm script" > + > +rpm alias --deb:md5sums --qf '\ > +%|FILENAMES?{\ > +[\ > +%{Debmd5sums}\n\ > +]\ > +}|\ > +' \ > + --POPTdesc=$"display debian/md5sums manifest" > + > > > +#============================================================================== > rpm alias --yum:primary.xml --qf '\ > <package type="rpm">\ > \n <name>%{NAME:cdata}</name>\ > @@ . > ______________________________________________________________________ > RPM Package Manager http://rpm5.org > CVS Sources Repository [EMAIL PROTECTED] >