From 9de33a8a7cd9eae05c3c1df4b2c0e1e4cd2bd40a Mon Sep 17 00:00:00 2001 From: "biao716.wang" Date: Tue, 5 Jan 2021 14:51:28 +0900 Subject: [PATCH] upgrade rpm version to 4.14.1 Change-Id: Iab5438d6e4d45c937b191c03e9ef5dd3fad165c8 Signed-off-by: biao716.wang --- CHANGES | 2927 -- COPYING | 4 +- CREDITS | 133 +- INSTALL | 41 +- Makefile.am | 99 +- Makefile.maint | 7 - README | 2 +- autodeps/.gitignore | 2 - autodeps/aix.prov | 78 - autodeps/aix.req | 171 - autodeps/aix4.prov | 189 - autodeps/aix4.req | 99 - autodeps/amigaos.prov | 3 - autodeps/amigaos.req | 3 - autodeps/darwin.prov | 21 - autodeps/darwin.req | 26 - autodeps/freebsd.prov | 9 - autodeps/freebsd.req | 22 - autodeps/freebsdelf.prov | 9 - autodeps/freebsdelf.req | 46 - autodeps/hpux.prov | 175 - autodeps/hpux.req | 126 - autodeps/irix6.prov | 201 - autodeps/irix6.req | 164 - autodeps/linux.prov | 104 - autodeps/linux.req | 155 - autodeps/mint.prov | 5 - autodeps/mint.req | 5 - autodeps/none | 3 - autodeps/openbsd.prov | 9 - autodeps/openbsd.req | 22 - autodeps/osf.prov | 188 - autodeps/osf.req | 142 - autodeps/solaris.prov | 14 - autodeps/solaris.req | 16 - build/Makefile.am | 11 +- build/build.c | 26 +- build/expression.c | 4 +- build/files.c | 1832 +- build/pack.c | 779 +- build/parseBuildInstallClean.c | 2 +- build/parseChangelog.c | 113 +- build/parseDescription.c | 23 +- build/parseFiles.c | 18 +- build/parsePolicies.c | 5 +- build/parsePreamble.c | 258 +- build/parsePrep.c | 89 +- build/parseReqs.c | 374 +- build/parseScript.c | 139 +- build/parseSpec.c | 308 +- build/reqprov.c | 115 +- build/rpmbuild.h | 6 +- build/rpmbuild_internal.h | 132 +- build/rpmbuild_misc.h | 28 +- build/rpmfc.c | 775 +- build/rpmfc.h | 46 +- build/rpmspec.h | 8 + build/spec.c | 137 +- cliutils.c | 3 +- cliutils.h | 5 + compile | 347 + configure.ac | 424 +- doc/Makefile.am | 5 +- doc/hacking.doxy.in | 2509 +- doc/hacking/{Doxyheader => Doxyheader.h} | 0 doc/librpm.doxy.in | 2509 +- doc/librpm/Doxyheader | 58 - doc/librpm/Doxyheader.h | 136 + doc/manual/macros | 20 +- doc/rpm-misc.8 | 64 + doc/rpm-plugin-systemd-inhibit.8 | 36 + doc/rpm.8 | 212 +- doc/rpmbuild.8 | 32 +- doc/rpmdeps.8 | 2 +- doc/rpmsign.8 | 24 +- doc/rpmspec.8 | 59 +- fileattrs/Makefile.am | 7 +- fileattrs/debuginfo.attr | 1 + fileattrs/kernel.attr | 2 + fileattrs/kmp.attr | 4 + fileattrs/metainfo.attr | 2 + fileattrs/perllib.attr | 2 + installplatform | 84 +- lib/.gitignore | 1 - lib/Makefile.am | 34 +- lib/backend/db3.c | 943 +- lib/backend/dbi.c | 184 + lib/backend/dbi.h | 202 +- lib/backend/dbiset.c | 214 + lib/backend/dbiset.h | 130 + lib/backend/lmdb.c | 939 + lib/backend/ndb/glue.c | 492 + lib/backend/ndb/rpmidx.c | 1280 + lib/backend/ndb/rpmidx.h | 18 + lib/backend/ndb/rpmpkg.c | 1312 + lib/backend/ndb/rpmpkg.h | 20 + lib/backend/ndb/rpmxdb.c | 1221 + lib/backend/ndb/rpmxdb.h | 27 + lib/cpio.c | 320 +- lib/cpio.h | 113 +- lib/depends.c | 517 +- lib/formats.c | 639 +- lib/fprint.c | 186 +- lib/fsm.c | 1751 +- lib/fsm.h | 13 +- lib/header.c | 632 +- lib/header.h | 92 +- lib/header_internal.h | 92 +- lib/headerfmt.c | 83 +- lib/headerutil.c | 285 +- lib/legacy.c | 379 - lib/manifest.c | 12 +- lib/merge.c | 347 - lib/misc.h | 34 +- lib/order.c | 153 +- lib/package.c | 651 +- lib/poptALL.c | 89 +- lib/poptI.c | 16 +- lib/poptQV.c | 36 +- lib/psm.c | 925 +- lib/query.c | 70 +- lib/relocation.c | 560 + lib/rpmal.c | 188 +- lib/rpmal.h | 15 +- lib/rpmarchive.h | 149 + lib/rpmcallback.h | 21 +- lib/rpmchecksig.c | 418 +- lib/rpmcli.h | 17 +- lib/rpmdb.c | 1939 +- lib/rpmdb.h | 48 +- lib/rpmdb_internal.h | 92 +- lib/rpmds.c | 786 +- lib/rpmds.h | 207 +- lib/rpmds_internal.h | 67 +- lib/rpmfi.c | 2208 +- lib/rpmfi.h | 385 +- lib/rpmfi_internal.h | 180 +- lib/rpmfiles.h | 519 + lib/rpmfs.c | 11 +- lib/rpmfs.h | 3 + lib/rpmgi.c | 25 +- lib/rpmhash.C | 6 +- lib/rpminstall.c | 76 +- lib/rpmlead.c | 41 +- lib/rpmlead.h | 23 +- lib/rpmlib.h | 5 +- lib/rpmlock.c | 89 +- lib/rpmlock.h | 17 +- lib/rpmplugin.h | 145 + lib/rpmplugins.c | 422 +- lib/rpmplugins.h | 181 +- lib/rpmprob.h | 2 +- lib/rpmrc.c | 745 +- lib/rpmscript.c | 284 +- lib/rpmscript.h | 48 +- lib/rpmtag.h | 97 +- lib/rpmtd.c | 92 +- lib/rpmtd.h | 15 + lib/rpmte.c | 290 +- lib/rpmte.h | 22 +- lib/rpmte_internal.h | 56 +- lib/rpmtriggers.c | 632 + lib/rpmtriggers.h | 84 + lib/rpmts.c | 249 +- lib/rpmts.h | 67 +- lib/rpmts_internal.h | 54 +- lib/rpmtypes.h | 3 + lib/rpmug.c | 54 +- lib/rpmug.h | 4 +- lib/rpmvercmp.c | 2 +- lib/rpmvf.h | 7 +- lib/rpmvs.c | 456 + lib/rpmvs.h | 75 + lib/signature.c | 586 +- lib/signature.h | 59 +- lib/tagexts.c | 185 +- lib/tagname.c | 247 +- lib/transaction.c | 575 +- lib/verify.c | 200 +- luaext/linit.c | 9 - luaext/linit.h | 6 - luaext/linit.lch | 46 - luaext/lposix.c | 65 +- luaext/modemuncher.c | 2 +- macros.debug | 47 + macros.in | 430 +- misc/Makefile.am | 2 +- misc/fnmatch.c | 2 + misc/fts.c | 24 +- misc/{fts.h => rpmfts.h} | 33 +- mkinstalldirs | 9 +- packaging/rpm.spec | 22 +- platform.in | 11 +- plugins/Makefile.am | 32 +- plugins/exec.c | 51 - plugins/ima.c | 80 + plugins/msm-plugin.c | 64 +- plugins/prioreset.c | 50 + plugins/selinux.c | 196 + plugins/sepolicy.c | 655 - plugins/syslog.c | 116 + plugins/systemd_inhibit.c | 111 + po/LINGUAS | 2 +- po/POTFILES.in | 39 +- po/{bn_IN.po => ar.po} | 3202 +- po/br.po | 3210 +- po/ca.po | 4016 +-- po/cmn.po | 3935 +++ po/cs.po | 3283 +- po/cs_CZ.po | 3484 --- po/da.po | 3186 +- po/de.po | 3834 +-- po/el.po | 3030 +- po/eo.po | 3724 ++- po/es.po | 3393 ++- po/fi.po | 3202 +- po/fr.po | 3318 +- po/gu.po | 3484 --- po/id.po | 3051 +- po/is.po | 3025 +- po/it.po | 3418 ++- po/ja.po | 3335 +- po/ko.po | 3203 +- po/ms.po | 3120 +- po/nb.po | 3173 +- po/nl.po | 3144 +- po/pl.po | 3779 ++- po/pt.po | 3211 +- po/pt_BR.po | 3303 +- po/rpm.pot | 3006 +- po/ru.po | 3279 +- po/sk.po | 3320 +- po/sl.po | 3181 +- po/sr.po | 3264 +- po/sr@latin.po | 3262 +- po/sv.po | 3389 ++- po/te.po | 3053 +- po/tr.po | 3236 +- po/uk.po | 3381 +- po/vi.po | 4014 +++ po/zh_CN.po | 3855 +-- po/zh_TW.po | 3454 ++- preinstall.am | 12 +- python/.gitignore | 1 - python/MANIFEST.in | 1 - python/Makefile.am | 14 +- python/header-py.c | 113 +- python/rpm/__init__.py | 58 +- python/rpm/transaction.py | 58 +- python/rpmarchive-py.c | 275 + python/rpmarchive-py.h | 15 + python/rpmbmodule.c | 4 +- python/rpmds-py.c | 80 +- python/rpmfd-py.c | 58 +- python/rpmfi-py.c | 94 +- python/rpmfiles-py.c | 598 + python/rpmfiles-py.h | 18 + python/rpmii-py.c | 25 +- python/rpmmacro-py.c | 14 +- python/rpmmi-py.c | 51 +- python/rpmmodule.c | 149 +- python/rpmsmodule.c | 35 +- python/rpmstrpool-py.c | 156 + python/rpmstrpool-py.h | 14 + python/rpmsystem-py.h | 2 + python/rpmtd-py.c | 160 +- python/rpmtd-py.h | 1 + python/rpmte-py.c | 69 +- python/rpmts-py.c | 144 +- python/setup.py.in | 55 +- python/spec-py.c | 65 +- python/spec-py.h | 2 +- rpm.am | 3 + rpm.pc.in | 4 +- rpm2archive.c | 218 + rpm2cpio.c | 9 +- rpmbuild.c | 168 +- rpmdb.c | 68 +- rpmio/Makefile.am | 13 +- rpmio/argv.c | 28 +- rpmio/argv.h | 8 +- rpmio/base64.c | 2 +- rpmio/digest.c | 82 +- rpmio/digest.h | 5 +- rpmio/digest_beecrypt.c | 253 +- rpmio/digest_nss.c | 62 +- rpmio/digest_openssl.c | 839 + rpmio/macro.c | 1314 +- rpmio/rpmbase64.h | 6 + rpmio/rpmfileutil.c | 70 +- rpmio/rpmfileutil.h | 4 +- rpmio/rpmglob.c | 66 +- rpmio/rpmio.c | 1149 +- rpmio/rpmio.h | 1 + rpmio/rpmio_internal.h | 8 +- rpmio/rpmkeyring.c | 159 +- rpmio/rpmkeyring.h | 17 + rpmio/rpmlog.c | 372 +- rpmio/rpmlog.h | 56 - rpmio/rpmlua.c | 54 +- rpmio/rpmlua.h | 2 + rpmio/rpmmacro.h | 34 +- rpmio/rpmpgp.c | 262 +- rpmio/rpmpgp.h | 80 +- rpmio/rpmsq.c | 247 +- rpmio/rpmsq.h | 50 +- rpmio/rpmstrpool.c | 42 +- rpmio/rpmstrpool.h | 13 +- rpmio/rpmsw.h | 2 + rpmio/rpmurl.h | 2 + rpmio/rpmutil.h | 5 +- rpmio/stubs.c | 18 - rpmkeys.c | 10 +- rpmpopt.in | 70 +- rpmqv.c | 16 +- rpmrc.in | 104 +- rpmsign.c | 168 +- rpmspec.c | 7 +- scripts/Makefile.am | 24 +- scripts/brp-compress | 6 +- scripts/brp-python-bytecompile | 58 +- scripts/brp-python-hardlink | 28 +- scripts/brp-strip | 2 +- scripts/brp-strip-shared | 2 +- scripts/check-files | 33 +- scripts/check-rpaths-worker | 2 +- scripts/debuginfo.prov | 20 +- scripts/desktop-file.prov | 2 + scripts/find-debuginfo.sh | 525 +- scripts/find-lang.sh | 2 +- scripts/find-php-provides | 20 - scripts/find-php-requires | 30 - scripts/find-provides | 3 + scripts/find-provides.ksyms | 81 + scripts/find-requires | 3 + scripts/find-requires.ksyms | 29 + scripts/gendiff | 11 +- scripts/libtooldeps.sh | 2 +- scripts/macros.perl | 3 - scripts/macros.php | 3 - scripts/macros.python | 3 +- scripts/metainfo.prov | 19 + scripts/osgideps.pl | 388 - scripts/perl.prov | 18 +- scripts/perl.req | 34 +- scripts/perldeps.pl | 1116 - scripts/pkgconfigdeps.sh | 3 + scripts/python-macro-helper | 27 + scripts/pythondistdeps.py | 240 + scripts/rpm2cpio.sh | 93 +- scripts/rpm_fulldb_update | 386 - scripts/rpmsync | 1625 - scripts/sysvinitdeps.sh | 17 + scripts/tcl.req | 101 - scripts/vpkg-provides.sh | 10 +- sign/Makefile.am | 9 +- sign/rpmgensig.c | 756 +- sign/rpmsign.h | 13 +- sign/rpmsignfiles.c | 135 + sign/rpmsignfiles.h | 25 + system.h | 54 +- tests/Makefile.am | 51 +- tests/atlocal.in | 25 +- tests/data/RPMS/hello-2.0-1.i686.rpm | Bin 4447 -> 9984 bytes tests/data/RPMS/hello-2.0-1.x86_64-signed.rpm | Bin 0 -> 9915 bytes tests/data/RPMS/hello-2.0-1.x86_64.rpm | Bin 4446 -> 9915 bytes tests/data/SOURCES/hello.c | 8 + tests/data/SOURCES/poltest-1.0.tar.bz2 | Bin 409 -> 0 bytes tests/data/SOURCES/poltest-policy-1.0.tar.bz2 | Bin 553 -> 0 bytes tests/data/SPECS/attrtest.spec | 6 +- tests/data/SPECS/configtest.spec | 3 + tests/data/SPECS/conflicttest.spec | 3 + tests/data/SPECS/deptest.spec | 11 + tests/data/SPECS/filedep.spec | 49 + tests/data/SPECS/filetriggers.spec | 95 + tests/data/SPECS/flangtest.spec | 5 + tests/data/SPECS/hello-attr-buildid.spec | 27 + tests/data/SPECS/hello-cd.spec | 29 + tests/data/SPECS/hello-config-buildid.spec | 30 + tests/data/SPECS/hello-r2.spec | 58 + tests/data/SPECS/hello-script.spec | 2 + tests/data/SPECS/hello2-suid.spec | 67 + tests/data/SPECS/hello2.spec | 62 + tests/data/SPECS/hello2cp.spec | 64 + tests/data/SPECS/hello2ln.spec | 63 + tests/data/SPECS/hlinktest.spec | 16 +- tests/data/SPECS/parallel.spec | 50 + tests/data/SPECS/poltest.spec | 52 - tests/data/SPECS/prefixtest.spec | 42 + tests/data/SPECS/replacetest.spec | 4 +- tests/data/SPECS/scripts.spec | 4 + tests/data/SPECS/sigpipe.spec | 47 + tests/data/SPECS/test-subpackages-exclude.spec | 42 + .../data/SPECS/test-subpackages-pathpostfixes.spec | 39 + tests/data/SPECS/test-subpackages.spec | 47 + tests/data/SPECS/testdoc.spec | 32 + tests/data/SPECS/triggers.spec | 26 + tests/data/SPECS/vattrtest.spec | 29 + tests/data/keys/rpm.org-rsa-2048-test.pub | 30 + tests/data/keys/rpm.org-rsa-2048-test.secret | 57 + tests/package.m4 | 6 + tests/rpmbuild.at | 1176 +- tests/rpmbuildid.at | 1312 + tests/rpmconfig.at | 156 +- tests/rpmconfig2.at | 133 +- tests/rpmconfig3.at | 40 +- tests/rpmconflict.at | 40 +- tests/rpmdb.at | 92 +- tests/rpmdeps.at | 731 +- tests/rpmgeneral.at | 59 +- tests/rpmi.at | 249 +- tests/rpmio.at | 50 + tests/rpmmacro.at | 293 +- tests/rpmorder.at | 45 + tests/rpmpython.at | 138 +- tests/rpmquery.at | 417 +- tests/rpmreplace.at | 114 +- tests/rpmscript.at | 225 +- tests/rpmsigdig.at | 443 + tests/rpmtests | 30451 +++++++++++++++++++ tests/rpmtests.at | 4 + tests/rpmverify.at | 412 +- tools/debugedit.c | 1833 +- tools/elfdeps.c | 77 +- tools/rpmdeps.c | 64 +- tools/rpmgraph.c | 3 +- tools/sepdebugcrcfix.c | 366 + 427 files changed, 147569 insertions(+), 82348 deletions(-) delete mode 100644 CHANGES delete mode 100644 Makefile.maint delete mode 100644 autodeps/.gitignore delete mode 100644 autodeps/aix.prov delete mode 100755 autodeps/aix.req delete mode 100644 autodeps/aix4.prov delete mode 100644 autodeps/aix4.req delete mode 100644 autodeps/amigaos.prov delete mode 100644 autodeps/amigaos.req delete mode 100644 autodeps/darwin.prov delete mode 100644 autodeps/darwin.req delete mode 100644 autodeps/freebsd.prov delete mode 100644 autodeps/freebsd.req delete mode 100644 autodeps/freebsdelf.prov delete mode 100644 autodeps/freebsdelf.req delete mode 100644 autodeps/hpux.prov delete mode 100644 autodeps/hpux.req delete mode 100644 autodeps/irix6.prov delete mode 100644 autodeps/irix6.req delete mode 100644 autodeps/linux.prov delete mode 100644 autodeps/linux.req delete mode 100644 autodeps/mint.prov delete mode 100644 autodeps/mint.req delete mode 100644 autodeps/none delete mode 100644 autodeps/openbsd.prov delete mode 100644 autodeps/openbsd.req delete mode 100644 autodeps/osf.prov delete mode 100644 autodeps/osf.req delete mode 100644 autodeps/solaris.prov delete mode 100644 autodeps/solaris.req create mode 100755 compile rename doc/hacking/{Doxyheader => Doxyheader.h} (100%) delete mode 100644 doc/librpm/Doxyheader create mode 100644 doc/librpm/Doxyheader.h create mode 100644 doc/rpm-misc.8 create mode 100644 doc/rpm-plugin-systemd-inhibit.8 create mode 100644 fileattrs/kernel.attr create mode 100644 fileattrs/kmp.attr create mode 100644 fileattrs/metainfo.attr delete mode 100644 lib/.gitignore create mode 100644 lib/backend/dbi.c create mode 100644 lib/backend/dbiset.c create mode 100644 lib/backend/dbiset.h create mode 100644 lib/backend/lmdb.c create mode 100644 lib/backend/ndb/glue.c create mode 100644 lib/backend/ndb/rpmidx.c create mode 100644 lib/backend/ndb/rpmidx.h create mode 100644 lib/backend/ndb/rpmpkg.c create mode 100644 lib/backend/ndb/rpmpkg.h create mode 100644 lib/backend/ndb/rpmxdb.c create mode 100644 lib/backend/ndb/rpmxdb.h delete mode 100644 lib/legacy.c delete mode 100644 lib/merge.c create mode 100644 lib/relocation.c create mode 100644 lib/rpmarchive.h create mode 100644 lib/rpmfiles.h create mode 100644 lib/rpmplugin.h create mode 100644 lib/rpmtriggers.c create mode 100644 lib/rpmtriggers.h create mode 100644 lib/rpmvs.c create mode 100644 lib/rpmvs.h delete mode 100644 luaext/linit.c delete mode 100644 luaext/linit.h delete mode 100644 luaext/linit.lch create mode 100644 macros.debug rename misc/{fts.h => rpmfts.h} (94%) delete mode 100644 plugins/exec.c create mode 100644 plugins/ima.c create mode 100644 plugins/prioreset.c create mode 100644 plugins/selinux.c delete mode 100644 plugins/sepolicy.c create mode 100644 plugins/syslog.c create mode 100644 plugins/systemd_inhibit.c rename po/{bn_IN.po => ar.po} (57%) create mode 100644 po/cmn.po delete mode 100644 po/cs_CZ.po delete mode 100644 po/gu.po create mode 100644 po/vi.po delete mode 100644 python/.gitignore delete mode 100644 python/MANIFEST.in create mode 100644 python/rpmarchive-py.c create mode 100644 python/rpmarchive-py.h create mode 100644 python/rpmfiles-py.c create mode 100644 python/rpmfiles-py.h create mode 100644 python/rpmstrpool-py.c create mode 100644 python/rpmstrpool-py.h create mode 100644 rpm2archive.c create mode 100644 rpmio/digest_openssl.c delete mode 100644 rpmio/stubs.c mode change 100644 => 100755 scripts/debuginfo.prov delete mode 100644 scripts/find-php-provides delete mode 100644 scripts/find-php-requires create mode 100755 scripts/find-provides create mode 100755 scripts/find-provides.ksyms create mode 100755 scripts/find-requires create mode 100755 scripts/find-requires.ksyms create mode 100755 scripts/metainfo.prov delete mode 100644 scripts/osgideps.pl delete mode 100755 scripts/perldeps.pl create mode 100755 scripts/python-macro-helper create mode 100755 scripts/pythondistdeps.py delete mode 100644 scripts/rpm_fulldb_update delete mode 100644 scripts/rpmsync create mode 100755 scripts/sysvinitdeps.sh delete mode 100644 scripts/tcl.req create mode 100644 sign/rpmsignfiles.c create mode 100644 sign/rpmsignfiles.h create mode 100644 tests/data/RPMS/hello-2.0-1.x86_64-signed.rpm create mode 100644 tests/data/SOURCES/hello.c delete mode 100644 tests/data/SOURCES/poltest-1.0.tar.bz2 delete mode 100644 tests/data/SOURCES/poltest-policy-1.0.tar.bz2 create mode 100644 tests/data/SPECS/filedep.spec create mode 100644 tests/data/SPECS/filetriggers.spec create mode 100644 tests/data/SPECS/hello-attr-buildid.spec create mode 100644 tests/data/SPECS/hello-cd.spec create mode 100644 tests/data/SPECS/hello-config-buildid.spec create mode 100644 tests/data/SPECS/hello-r2.spec create mode 100644 tests/data/SPECS/hello2-suid.spec create mode 100644 tests/data/SPECS/hello2.spec create mode 100644 tests/data/SPECS/hello2cp.spec create mode 100644 tests/data/SPECS/hello2ln.spec create mode 100644 tests/data/SPECS/parallel.spec delete mode 100644 tests/data/SPECS/poltest.spec create mode 100644 tests/data/SPECS/prefixtest.spec create mode 100644 tests/data/SPECS/sigpipe.spec create mode 100644 tests/data/SPECS/test-subpackages-exclude.spec create mode 100644 tests/data/SPECS/test-subpackages-pathpostfixes.spec create mode 100644 tests/data/SPECS/test-subpackages.spec create mode 100644 tests/data/SPECS/testdoc.spec create mode 100644 tests/data/SPECS/triggers.spec create mode 100644 tests/data/SPECS/vattrtest.spec create mode 100644 tests/data/keys/rpm.org-rsa-2048-test.pub create mode 100644 tests/data/keys/rpm.org-rsa-2048-test.secret create mode 100644 tests/package.m4 create mode 100644 tests/rpmbuildid.at create mode 100644 tests/rpmio.at create mode 100644 tests/rpmorder.at create mode 100644 tests/rpmsigdig.at create mode 100755 tests/rpmtests create mode 100644 tools/sepdebugcrcfix.c diff --git a/CHANGES b/CHANGES deleted file mode 100644 index d6365c1..0000000 --- a/CHANGES +++ /dev/null @@ -1,2927 +0,0 @@ -4.4.2 -> 4.4.2.1: - - remove internal sqlite, zlib, gettext - - remove obsolete utilities - - remove vendor gpg keys - - fix spec parenthesis parsing - - allow building without neon - - disable hkp lookup by default - - re-enable file-conflicts detection (rhbz#151609) - - fix potential segfault in available file provides checking - - fix Requires(pre,postun) (rh#155700) - - fix db build wrt newer CFLAGS - - fix popt CHARSET for various languages (rhbz#172155) - - fix install size calculation with excludes in manifest (rhbz#89661) - - use full path in the rpm cronjob (rhbz#174211) - - filter out incorrect perl(main) provides (rhbz#177960) - - fix scriptlet deadlock (rhbz#146549) - - fix netshared path comparison (rhbz#52725) - - make fcntl lock sensitive to --root (rhbz#151255) - - fix rpmvercomp for strings with trailing null segments (rhbz#178798) - - fix doxygen generation (rhbz#187714) - - fix potential segfault if no rpmlock_path defined (rhbz#231146) - - fix for thinko in debugedit on ppc - - fix debugedit wrt OOo - - fix debugedit with ../../ in paths - - fix various other issues in debugedit (rhbz#205339) - - allow customisable diff and use -p by default (rhbz#146981) - - handle fork failure - - fix a typo causing compiler warning (susebz#178055) - - fix a %{buildsubdir} typo/thinko - - fix uncompress waitpid logic to shut up the compiler (susebz#160434) - - add support for %{_docdir} macro (rhbz#125514) - - fix segfault on rpmbuild with empty file list - - allow --ignoresize for erase operations - - don't attempt to execute empty transaction (susebz#43267) - - don't segfault if Fileno() is called with NULL - - abort build if cwd not determinable - - fix --noghost query option (rhbz#103207) - - fix off-by-one error in glob - - check rpmtsInitDB() return value - - build internal Lua without readline support - - make rpmdbSync obey the no_dbsync flag - - fix package verification for packages with header+payload RSA but - no header-only RSA - - drop any s-bits early when deleting files (susebz#50376, rhbz#125517) - - fix handling of old packages that use HEADERIMAGE - - catch disk-space errors when writing signed packages - - fix default verify flags for %doc (rhbz#235353) - - fix debugedit for relative paths (rhbz#232222) - - add configurable preferable elf colour policy (rhbz#235757) - - python: always treat changelog as list - - use older perl helper scripts by default - - add mono req/provides support - - remove SELinux context verification (rhbz#193488) - - fix building without Lua support - - fix --rebuilddb with --root option - - fix --setperms and --setugids with uninstalled packages - - don't run pre- and posttrans scripts in test mode - - dbmatch keys can be unicode objects also (rhbz#219008) - - gendiff: let diff arguments be specified in the environment - - gendiff: emit diff headers (rhbz#237561) - - improved error messages in verification of unreadable files - - python: raise exception if tsAdd fails - - check for supported package payload format (rhbz#140052) - - fail build if beecrypt headers not found - - build: check unpackaged files even if other errors are present - - restore SIGILL handler in machine detection code - - add --dupes popt alias for detecting duplicate packages in rpmdb - - fix typo in check-prereq (rhbz#203182) - - python: fix rpm.te Key() refcount (rhbz#182063) - - python: always treat fileverifyflags as list - - disable strict aliasing if compiler supports it (type-punning warns) - - add zh_TW translation - - add support for srcdefattr macro (susebz#48870, rhbz#125515) - - detect python 2.5 automatically in configure - - python: reference counting for match-iterators (rhbz#241751) - - updated fi translation - - fix format string errors in de translation - - allow characters > 127 that don't fit the current locale in spec - - treat null epoch equal to zero epoch in freshen (rhbz#143301) - - python: treat null epoch equal to zero labelCompare (rhbz#227860) - - permit installing multiple package versions with -i (rhbz#213399) - - fix . query output for non-installed package (rhbz#124016) - - updated pl translation - - don't read packages with non-verifiable signatures (rhbz#239557) - - don't try to open non-existent file twice in query - - flush query format buffer before listing files (rhbz#212833) - - check all header strings to resize buffer (rhbz#212833) - - don't segfault on a header without RPMTAG_NAME (rhbz#239557) - - fix file status for replaced files (rhbz#237478) - - make %_signature default to gpg instead of none - - don't skip directories in fingerprinting (rhbz#140055, 223639, ...) - - remove vendor, release specific dependency whitouts - - remove upstream spec files for rpm and popt - - don't open temporary databases in rpmdbOpenAll() - - open non-temporary db's before chroot (rhbz#103952, 173285) - - don't treat provides as implicit obsoletes (rhbz#111071, ...) - - fix CVE-2007-1536, CVE-2007-2799 in internal libmagic - - support specifying fuzz factor to %patch (rhbz#243720) - - enable ordering on erase mode - - transaction ordering fixes (rhbz#196590, 202540, 202542, ...) - - added IPv4/6 and EPSV support - - remove hardcoded /var/log/lastlog kludgery - - don't mmap large files (rhbz#139539, 177616) - - detect and provide a requirement for DT_GNU_HASH - - ARM architecture update - - update popt version for clean upgradability - - remove hardcoded libtermcap vs bash kludge - - updated Russian man pages (rhbz#185620) - - fix a sparse warning in popt.h (rhbz#202005) - - disable broken "make check" tests - - treat /usr/share/gtk-doc/html/ as a docdir - - plug some minor memory leaks - - use --wildcards with tar for compatibility with tar >= 1.15.91 - - fix segfault on errors if neon transport is used (rhbz#220392) - - new buildroot sanity checker scripts check-buildroot and check-rpaths - - new debugedit option for recomputing build ID - -4.4.1 -> 4.4.2: - - start 4.4.2 devel. - - sqlite3: revert cClose scoping, data is freed in cClose unlike db4. - - build against sqlite3-3.1.2. - - sqlite3: update encode/decode from sqlite-2.8.16. - - add --xml popt alias for query modes. - - remove _rpmdb now that python2.[34] are commonly available. - - remove remnant -I/opt/local hacks, --prefix=/usr is recommended. - - rework configure.ac et al to lose internal library baggage flexibly. - - updated sv.po . - - permit gpg to be used for RSA signatures. - - permit RSA key sizes larger than 1024 bits. - - permit RSA/{sha1,sha256,sha384,sha512} signature verification. - - updated de.po (#162756). - - added CVSId: tag and SVNId: alias (#162807). - - added brp-java-gcjcompile build helper. - - fix: java compiled with -O0 confuses debugedit (#161722). - - fix: % at end-of-line overflow (#161091). - - *_terminate_build macros set per-pkg, not per-invocation (#161081). - - use perldeps.pl, phase out perl.{req,prov} (#161921). - - fix: make sqlite3 rpmdb endian-neutral (#159425). - - fix: permit sqlite3 rpmdb with chroot (#159424). - - fix: find-debuginfo.sh not handling set[ug]id ELF files (#100963). - - fix: find-debuginfo.sh kernel voo-doo tweaks (#159346). - - fix: initialize variables used in debug msg (#160458). - - permit zlib in rpm to be built with make -j (#159404). - - avoid '?' for zero length file mmap failure doing md5 (#159405). - - permit scriptlet includes from builddir for spec files w/o %setup. - - upgrade to zlib-1.2.2.4 internal. - - macosx: avoid minigzip build failures. - - upgrade to file-4.14 internal. - - fix: magic_file() closes stdin when given directory path. - - use perldeps.pl, phase out perl.{req,prov} (again). - - document __vsflags (#147489). - - release rpm-4.4.2. - -4.4 -> 4.4.1: - - force *.py->*.pyo byte code compilation with brp-python-bytecompile. - - automagically detect and emit "python(abi) = 2.4" dependencies. - - popt 1.10.1 to preserve newer. - - use package color as Obsoletes: color. - - upgrade to db-4.3.27. - - revert MAGIC_COMPRESS, real fix is in libmagic (#143782). - - upgrade to file-4.12 internal. - - mac os x patches (#131943,#131944,#132924,#132926). - - mac os x patches (#133611, #133612, #134637). - - build against external/internal neon. - - add https://svn.uhulinux.hu/packages/dev/zlib/patches/02-rsync.patch - - changes to build on Mac OS X using darwinports neon/beecrypt. - - blueprint rpm-4_4 and HEAD to minimize diff spew. - - add missing #if defined(ENABLE_NLS) (#146184). - - python: force dbMatch() h# key to be 32 bit integer (#146477). - - add sqlite internal (build still expects external sqlite3-3.0.8). - - sqlite: revert to original narrow scoping of cOpen/cClose. - - fix: length of gpg V4 hash seed was incorrect (#146896). - - add support for V4 rfc-2440 signatures. - - sqlite3: run-time endian test rather than chasing (#146752). - - discover and use getmntinfo if present. - - perform callbacks as always (#147537). - - permit build scriptlet interpreters to be individually overridden. - - zlib: uniqify certain symbols to prevent name space pollution. - - macosx: include so that python sees the u_char typedef. - - macosx: change to --prefix=/usr rather than /opt/local. - - use waitpid rather than SIGCHLD reaper. - - rip out DB_PRIVATE revert if not NPTL, it's not the right thing to do. - - don't classify files in /dev (#146623). - - don't build with sqlite3 if is missing. - -4.3.3 -> 4.4: - - pentium3/pentium4 arch support (pluto@PLD). - - cpuid() cleanups for PIC/non-PIC and gcc 3.4 (pluto@PLD). - - rpmGlob() is now locale independent (wiget@PLD). - - conditional build support/unification (jajcus,malekith,qboosh,wiget@PLD). - - fix: readelf.c breakage on some non x86 arches (qboosh@PLD). - - find-lang.sh: implemented --with-kde (finds KDE help files); - - add --all-name option (finds every lang file); drop defattr() - from *.lang files (arekm,mkochano,pascalek,wiget@PLD). - - add type to tag array. - - add Disttag: syntax to spec file parser and header content. - - define Suggests:/Enhances: and Priority: tag values. - - prevent RPMSENSE_PREREQ from being set or tested. - - python: add rpm.ps() object to carry problem set info. - - python: permit rpm.ds() analogue to hdr.dsFromHeader() creator. - - python: permit rpm.fi() analogue to hdr.fiFromHeader() creator. - - silently add default %defattr(-,root,root) for all packages. - - fix: don't set handler if SIG_IGN is already set (#134474). - - disable expensive header+payload verifies in default config. - - adjust digest/signature stats to count #pkgs and bytes. - - obsolete Serial:, Copyright:, and RHNPlatform: syntax in spec files. - - permit Obsoletes: /path/to/file. - - permit Conflicts: /path/to/file. - - free rpmrc when looping on --target arches (#127730). - - fix: handle non-unique dirnames in rpmalAdd(). - - integrate rpmgi "generic iterator" with query/verify. - - bump popt version to 1.10. - - attempt dependency tree breadth, take 1. - - use external libneon for http/https transport. - - add --delsign to purge packages of digital signatures. - - neon used by default for http/https transport. - - upgrade to db-4.3.21 final internal. - - remove noNeon runtime switch, http through neon only. - - remove http put to be able to build against upstream neon. - - bump soname into libfoo-4.4.so everywhere. - - sparcv8: optflags changed to -mtune=ultrasparc (#140420). - - add BuildRequires: neon-devel. - - fix: chunked davRead returns 0 is EOF. - - python: bleeping keywords broke labelCompare. - - add support for automagic pubkey retrieval using HKP. - - detect and return errors from neon through Ferror. - - use package color as Obsoletes: color. - -4.3.2 -> 4.3.3: - - bump micro version. - - make peace with libtool-1.5.10 and automake-1.9.3. - - python: add python 2.4 support. - - selinux: use rpm_execcon, not execv, to run scriptlets (#136848). - - fix: segfault on --verifydb (#138589). - - sparcv8: optflags changed to -mtune=ultrasparc (#140420). - - port to internal file-4.10 libmagic rather than libfmagic. - - move global /var/lock/rpm/transaction to dbpath. - - permit fcntl path to be configured through rpmlock_path macro. - -4.3.1 -> 4.3.2: - - use /etc/selinux/targeted/contexts/files/file_contexts for now. - - disable file contexts into package metadata during build. - - fix: "/path/foo.../bar" was losing a dot (#123844). - - lua embedded in rpmio. - - use lua to identify desired selinux file context regexes. - - add 'requires' and 'conflicts' tag aliases. - - python: return ds, not tuple, for ds iteration. - - python: permit integer keys to ts.dbMatch(). - - xml: use markup for empty tags. - - xml: instead of 0 markup. - - fix: disable fingerprint generation on kernel paths. - - add ppc8[25]60 arches. - - fix: evaluate rather than default file_contexts path. (#127501). - - avoid "can't happen" recursion while retrieving pubkeys. - - add ppc32dy4 arch. - - make peace with automake 1.9.1. - - fix: defattr for rpm-libs (#130461). - - print dependency loops as warning iff --anaconda is specified. - - fix: mark uninstalled elf32 files in rpmdb to disable -Va checks. - - ia64: add autorelocate_dcolor to macros.in. - - disable static linking until libc*.a provides symbols. - - fix: revert Obsoletes: "fix" (#134497). - - fix: work around for dangling symlinks not globbed (#134362). - - display caught signals to diagnose #134474 (gonna be SIGPIPE). - - display N-V-R.A in dependency failure messages. - - selinux: set "rpm_script_t" always, not just for /bin/sh. - - honor inherited SIG_IGN when establishing rpmdb signal exit (#134474). - - don't add time stamp to compressed man pages (#132526). - - python: remove ".A" from creaky ts.check() tuple return (#135008). - - python: fix RPMPROB_BADRELOCATE segfault return in ts.check (#137116). - - revert selinux patch until fc3 release. - - reprise file conflicts yet again, flip/flop/flip/flop ... - - fix: buffer overrun displaying ko_KR (#135389). - -4.3 -> 4.3.1: - - fix: don't add leading space to %* argv expansion (#119059). - - scareMem = 0 everywhere, document deprecation phase out. - - fix: add u+w to FIXPERMS. - - add buildtime to rpmds, methods to retrieve. - - python: hide labelCompare() underneath ds.cmp(a,b). - - fix: segfault on --recontext if file_contexts unreadable (#117374). - - fix: /etc/security/selinux/file_contexts is default path. - - fix: no transaction lock if --test was specified (#119783). - - perl: skip new-fangled head[34] while generating deps (#118243). - - perl: use __perl for perl variable macros (#115156). - - make peace with libtool-1.5.6. - - fix: follow current is_selinux_enabled() return (#121004). - ? fix: exit fail when erasing multiple identical packages (#120519). - - add aurora/sparc patches (#124469). - - use poll(2) if available, avoid borked aurora/sparc select (#124574). - -4.2.3 -> 4.3: - - upgrade to zlib-1.2.beta7. - - fix: short option help missing string terminator. - - permit secondary tag match patterns with RPMQV_ALL. - - fix: cut-n-paste error setting nopromote for Conflicts: (#81965). - - don't use error string after gzclose (Dmitry V. Levin). - - only internal Berkeley db from now on. - - revive "make dist". - - fix: added index size wrong iff _transaction_color != 0/3 (#103865). - - fix: escape '+' in regex patterns through RPMMIRE_DEFAULT (#103851). - - RPMMIRE_DEFAULT is overkill, use RPMMIRE_STRCMP instead (#103851). - - don't use mktemp if mkstemp is available (#103850). - - python: return None for NEVRAO, [] for everything else. - - python: throw exception on bad arg to labelCompare (#113661). - - re-add --enable-posixmutexes to build. - - fix: set fcontext from pkg when file_contexts doesn't exist (#114040). - - fix: set fcontext for "mkdir -p" directories not in packages. - - fix: setfiles (aka rpmsx.c) dinna handle patterns correctly. - - establish rpm_script_t before scriptlet exec. - - python: add patch to rpm-4_3 to initialize RE contexts. - - fix: only first "mkdir -p" directory had context set. - - stable sort for policy specifications, patterns before paths. - - set "rpm_script_t" exec type for scriptlets iff /bin/sh, else default. - - force FD_CLOEXEC on 1st 100 inherited fdno's. - - serialize rpmtsRun() using fcntl on /var/lock/rpm/transaction. - - permit globs in macrofiles: directive (#117217). - - fix: segfault generating transaction serialization lock path. - - use /etc/security/selinux/file_contexts instead. - - selinux: ignore ENOTSUP return from lsetfilecon. - - add sparcv8 and enable elf32/elf64 Zon sparc64 (#117302). - - fix: --querybynumber looped. - - fix: ENOTSUP filter from lsetfilecon borkage. - - fix: increase file context regex parse buffer to BUFSIZ. - - fix: handle elf64 note sections correctly. - - fix: grrr, skip notes on non-i386 entirely. - - endian neutral rpmdb join keys (finally). - - fix: dev package build on s390x hack around. - -4.2.2 -> 4.2.3: - - bump rpm and popt versions to insure "newer". - - change default behavior to resolve file conflicts as LIFO. - - add --fileconflicts to recover rpm traditional behavior. - - prefer elf64 over elf32 files, everywhere and always (#126853). - - ia64: auto-relocate entire, not partial, directory contents (#126905). - - ia64: auto-relocate glibc.ix86 interpreter path (#100563). - - shared libraries in separate rpm-libs package. - - fix: defattr for rpm-libs (#130461). - - fix: static glibc/libgcc helpers always installed (#127522). - - ia64: make sure that autorelocated file dependencies are satisfied. - - ia64: relocate all scriptlet interpreters. - - ia64: don't bother trying to preload autorelocated modules. - - fix: filesystem package needs mail/lock w/o getgrnam. - - fix: do getpwnam/getgrnam to load correct modules before chroot. - -4.2.1 -> 4.2.2: - - unify signal handling in librpmio, use condvar to deliver signal. - - make peace with libtool-1.5, autoconf-2.59, automake-1.8. - - build with db-4.2.52 internal. - - refresh bsddb. - - detect (and remove) dbenv files while upgrading to db-4.2.52. - - ensure that librpmdb links against just built, not system, librpmio. - - fix: dangling pointer brain fart (#107835). - - fix: ds.Single() method needs malloc'd elements (#109919). - - convert ja and ko man pages to utf8 (#106050). - - man page corrections (#106415). - - perl.req typo (#106672). - - fix: wrong package count for trigger scriptlet 1st arg (#100509). - - fix: don't break header SHA1 if non-existent user/group (#97727). - - remove fuids/fgids from rpmfi, easier to lookup fuser/fgroup instead. - - merge sensible parts of openpkg rpm.patch.bugfix (#104780). - - mark _javadocdir as documentation (#102898). - - flush pipe before exit 1 in check-files (#103867). - - perl.req: avoid regex misfire on '^use' in "= <<" assign (#109934). - - find-debuginfo.sh: permit stripping unwritable by non-root (#112429). - - missing build dependency (#111104). - - spelling corrections (#112728). - - use -fPIC -DPIC on all platforms, not just mandatory (#112713). - - popt: pad to display length, not strlen, for i18n popt args (#106240). - - python: include Python.h before glibc features.h. - - python: return [], not None, accessing header tags (#112794). - - python: avoid invoking python to acquire ill-specified parameters. - - add ia32e arch. - - fix: sq->reaped needs sighold(SIGCHLD)/sigrelease(SIGCHLD) (#117620). - -4.2 -> 4.2.1: - - fix: nested %if handling, optind initialization posix vs. glibc. - - add version check for package with provides and obsoletes. - - hack out O_DIRECT support in db4 for now. - - build with external beecrypt-3.0.0. - - x86_64 -> athlon, ppc64[ip]series -> ppc64 arch compatibility. - - treat missing epoch's exactly the same as Epoch: 0. - - pass structure pointer, not args, through headerSprintf call chain. - - add ":xml" header format modifier. - - --queryformat '[%%{*:xml}\n]' to dump header content in XML. - - add ".arch" suffix to erase colored packages with identical NEVR. - - update ja man pages (#92261). - - backport rpmsw stopwatch, insturment rpmts operations. - ? toy method to enable --stats through bindings. - - fdCLose typo (#97257). - - brp-python-bytecompile to automagically bytecode compile python. - ? update for fr.po (#97829). - - don't attempt to remove dbenv on --rebuilddb. - - autorelocate ix86 package file paths on ia64. - - resurrect manifests, RPMRC_NOTFOUND returned by readLead(). - - python: missed tuple refcount in IDTXload/IDTXglob. - - fix: IDTXglob should return REMOVETID sorted headers (#89857). - - resolve elf32/elf64 file conflicts to prefer elf64. - - apply debugedit patch necessary to produce kernel -debuginfo files. - ? ia64: autorelocate only colored, not every, file when installing. - ? repair find-debuginfo.sh to avoid recursing in /usr/lib/debug. - ? fix: ia64: don't attempt autorelocate on .src.rpm's. - ? fix: debuginfo: -not -path /usr/lib/debug needed -prune too. - ? fix: packages w/o file colors segfault. - ? add amd64 as alias for x86_64 (#99553). - ? fix: add -n to brp-compress to avoid needless file conflicts. - ? fix: ia32 on ia64 segfaults because of automagic file relocations. - ? speed up convertdb1 (#103206). - ? revert i18n table change to preserve help array size. - ? add config directories for ppc64pseries/ppc64iseries. - ? filter GLIBC_PRIVATE dependencies. - - fix: check added provides against installed conflicts (#110317). - - changes for python 2.3 - - changes for libtool-1.5 - - changes for automake-1.7.8 - - changes for db-4.2.42. - - splint fiddles. - -4.1 -> 4.2: - - set cachesize without a dbenv, the default is far too small. - - db: don't return EACCES on db->close w/o environment. - - unify cachesize configuration, with (or without) a dbenv. - - comments regarding unsupported (yet) db-4.1.17 functionality. - - update to db-4.1.24 final. - - eliminate myftw, use Fts(3) instead. - - dump libelf, gulp elfutils, for now. - - python: permit headers to be hashed. - - use %%{_lib} for libraries. - - include file-3.39 (with homebrewed) libfmagic, for now. - - add debug sub-package patch. - - re-add elfutils/libdwarf (for dwarf.h), eliminate tools/dwarf2.h. - - resurrect genhdlist "greased lightning" pathway for now. - - elfutils: avoid gcc-3.2 ICE on x86_64 for now. - - add /usr/lib/rpm/rpmdeps. - - add /usr/lib/rpm/magic. - - fix: /dev/initctl has not MD5 segfault (#76718). - - rpm.8: gpg uses GNUPGHOME, not GPGPATH (#76691). - - add error message on glob failure (#76012). - - add _javadir/_javadocdir/_javaclasspath macros. - - fix: bash must have functional libtermcap.so.2. - - update to elfutils-0.56. - - have debug sub-subpackage use external, not internal, elfutils. - - apply patches 1-6 to db-4.1.24. - - resurrect availablePackages one more time. - - fix: option conflict error message (#77373). - - add AC_SYS_LARGFILE throughout. - - statically link rpmdeps against (internal) libfmagic. - - use rpmdeps rather than find-{requires,provides}. - - bundle libfmagic into librpmbuild for now. - - apply patches 7 and 8 to db-4.1.24. - - upgrade to elfutils-0.59. - - add -g to all platforms optflags. - - build with external elfutils (preferred), if available. - - upgrade to elfutils-0.63. - - link rpm libraries together, use shared helpers with external -lelf. - - move libfmagic to librpmio. - - use libtool-1.4.3, autoconf-2.56. - - add explicit -L/lib64 -L/usr/lib64 for libtool mode=relink on x86_64. - - use usrlib_LTLIBRARIES to install directly in /usr/lib64 instead. - - late rpmts reference causes premature free (#78862). - - internal automagic dependency generation (disabled for now). - - don't generate dependencies unless execute bit is set. - - enable internal automagic dependency generation as default. - - fix: add rpmlib(VersionedDependencies) if versioned Provides: found. - - fix: add %%ifnarch noarch to debug_package macro. - - debug_packages "works", but non-noarch w/o %setup has empty payload. - - make dependency generation "opt-in" in order to build in distro. - - fix: make sure each library has DT_NEEDED for all unresolved syms. - - generate Elf provides even if file is not executable. - - disable fcntl(2) lock on Packages until glibc+nptl is fixed. - - make cdb locks "private" for pthreads compatibility w/o NPTL. - - add --enable-posixmutexes to use NPTL. - - make dependency generation "opt-out" everywhere. - - rebuild against glibc with fcntl fixed in libpthread. - - re-enable CDB locking, removing "private" from %%__dbi_cdb macro. - - popt aliases for -U et al to achieve dynamic link with nptl. - - add --file{class,provide,require} popt aliases and header extensions. - - statically link against /usr/lib/nptl/libpthread.a, if present. - - remove popt aliases for -U et al. - - add -I/usr/include/nptl, Conflicts: kernel < 2.4.20. - - dynamically link /bin/rpm, link against good old -lpthread. - - test pthread_{mutex,cond}attr_setpshared(), add DB_ENV_PRIVATE if not. - - error on exclusive Packages fcntl lock if DB_ENV_PRIVATE is set. - - copy compressFilelist to convertdb1.c, remove internal legacy.h. - - add --enable-posixmutexes when configuring on linux. - - add rpmdb_{deadlock,dump,load,svc,stat,verify} utilities. - - include srpm pkgid in binary headers (#71460). - - add %check scriptlet to run after %install (#64137). - - simplify specfile query linkage loop. - - drill rpmts into parseSpec(), carrying Spec along. - - fix: remove rpmfi scareMem so that headers can be reloaded on ia64. - - fix: set DB_PRIVATE, not DB_ENV_PRIVATE, if unshared posix mutexes. - - remove useless kernel/glibc dependencies (#79872). - - add matching "config(N) = EVR" dependencies iff %%config is found. - - add %%pubkey attribute to read armored pubkey files into header. - - permit both relative/absolute paths, display 'P' when verifying. - - resurrect automagic perl(foo) dependency generation. - - add BETA-GPG-KEY (but not in headers using %%pubkey yet). - - disable perl module magic rule. - - ignore ENOENT return from db->close (#80514,#79314). - - fix builddir relative inclusion, add %%pubkeys to rpm header. - - fix: package relocations were broken (#75057). - - error if querying with iterator on different sized arrays. - - add rpmfi methods to access color, class, and dependencies. - - don't segfault with packages produced by rpm-2.93 (#80618). - - python: eliminate hash.[ch] and upgrade.[ch], methods too. - - fix :armor query extension, tgpg mktmp handling (#80684). - - use rpmfiFClass() underneath --fileclass. - - use rpmfiFDepends() underneath --fileprovide and --filerequire. - - python: add fi.FColor() and fi.FClass() methods. - - calculate dependency color and refernces. - - python: add ds.Color() and ds.Refs() methods. - - fix: typo in assertion. - - add rpmts/rpmte/rpmfi/rpmds element colors. - - ignore items not in our rainbow (i.e. colors are functional). - - fix: dependency helpers now rate limited at 10ms, not 1s. - - add per-arch canonical color, only x86_64 enabled for now. - - file: avoid ogg/vorbis file classification problems. - - portabilitly: solaris fixes. - - for DSO's, provide the file basename if DT_SONAME not found. - - add perldeps.pl, start to replace perl.{prov,req}. - - file: read elf64 notes correctly. - - python: put rpmmodule.so where python expects to find. - - add brp-strip-static-archive build root policy helper. - - add -lelf to rpm LDFLAGS, not LDADD, since there is no libelf.la now. - - fix: obscure corner case(s) with rpmvercmp (#50977). - - file: *really* read elf64 notes correctly. - - python: restore thread context on errorCB (#80744). - - teach rpmquery to return "owning" package(s) in spite of alternatives. - - duplicate package checks with arch/os checks if colored. - - file conflict checks with colors. - - fix: debugedit.c problem. - - permit anaconda to choose "presentation order". - - fix: more debugedit.c problems. - - fix: clean relocation path for --prefix=/. - - python: permit stdout/stderr to be remapped to install.log. - - pay attention to package color when upgrading identical packages. - - fix: trap SIGPIPE, close database(s). - - configurable default query output format. - - popt: diddle doxygen/splint annotations, corrected doco. - - file: fix ogg/vorbis file classification problems. - - skip fingerprints in /usr/share/doc and /usr/src/debug. - - add file(1) as /usr/lib/rpm/rpmfile. - - enable transaction coloring for s390x/ppc64. - - file: check size read from elf header (#85297). - - fix: memory leak (85522). - - build with internal elfutils if not installed. - -4.0.4 -> 4.1: - - loosely wire beecrypt library into rpm. - - drop rpmio/base64.[ch] in favor of beecrypt. - - drop lib/md5*.[ch] files in favor of beecrypt. - - legacy: drop brokenMD5 support (rpm-2.3.3 to rpm-2.3.8 on sparc). - - eliminate DYING code. - - bind beecrypt md5/sha1 underneath rpmio. - - create RFC-2440 OpenPGP API in rpmio. - - proof-of-concept GPG/DSA verification for legacy signatures. - - upgrade to beecrypt-2.2.0pre. - - proof-of-concept PGP/RSA verification for legacy signatures. - - ratchet up to lclint "strict" level. - - upgrade to db-4.0.7. - - use only header methods, routines are now static. - - beecrypt is at least as good as pgp/gpg on verify, pulling the plug. - - add :base64 and :armor format extensions, dump binary tags in hex. - - proof-of-concept pubkey retrieval from RPM-{PGP,GPG}-KEY. - - stupid macros to configure public key file paths. - - all symbols but hdrVec are now forward references in linkage. - - generate an rpm header on the fly for imported pubkeys. - - wire transactions through rpmcli signature modes. - - wire transactions through rpmcli query/verify modes. - - wire transactions through rpmcli install/erase modes. - - legacy signatures always checked (where possible) on package read. - - wire transactions through rpmcli build modes. - - lazy rpmdb open/close through transaction methods (mostly anyways). - - no-brainer refcounts for rpmdb object. - - check added header against transaction set, replace if newer. - - transaction sets created in cli main. - - no-brainer refcounts for ts object. - - memory indices for dependency check are typedef'd and abstract'd. - - no-brainer refcounts for fi object, debug the mess. - - dump the header early in transaction, recreate fi before installing. - - start hiding availablePackage data/methods in rpmal.c/rpmal.h. - - add some dinky availablePackage methods. - - transaction.c: cleanly uncouple availablePackage from TFI_t. - - add header refcount annotations throughout. - - depends.c: availablePackage is (almost) opaque. - - invent some toy transactionElement iterators. - - create rpmDepSet constructors/destructors. - - create toy rpmDepSet iterators. - - rpmRangesOverlap renamed to dsCompare, add dsNotify method as well. - - depends.c: rpmDepSet is (almost) opaque, move to rpmds.[ch]. - - rpmds: create dsProblem(), dsiGetDNEVR() retrieved DNEVR, not N. - - depends.h: hack around teIterator() et al from include for now. - - rpmds: move trigger dependencies into a rpmDepSet as well. - - rpmal: availablePackage is totally opaque, alKey with index replaces. - - linear search on added package provides is dumb. - - discarding entire signature header when using --addsign is dumb. - - rip out rpmDependencyConflict, replace with rpmProblem instead. - - no-brainer refcounts for rpmProblemSet object. - - header tag sets are per-transactionElement, not per-availablePackage. - - no-brainer refcounts for rpmDepSet and rpmFNSet objects. - - strip header tags for erased as well as installed transactionElements. - - common structure elements for unification of TFI_t and rpmFNSet. - - factor per-transactionElement data out of TFI_t through pointer ref. - - unify rpmFNSet into TFI_t. - - eliminate header reference in rpmtransAddPackage, use TFI_t data. - - commit to using rpmDepSet and TFI_t, not header. - - lclint rpmio fiddles. - - split file info tag sets into rpmfi.c. - - create toy TFI_t iterators. - - tweak overlapped file fingerprint retrieval for speed. - - transaction.c: use wrappers/iterators to access TFI_t. - - annotations to make a transactionElement opaque. - - use array of pointers rather than contiguous array for ts->order. - - methods to complete making transactionElement opaque. - - use TR_REMOVED relations as well as TR_ADDED for ordering. - - drop requirement that removed packages immediately follow added. - - hybrid chainsaw/presentation ordering algorithm. - - convert file md5sum's to binary on the fly, reducing memory footprint. - - header handling moved to librpmdb to avoid linkage loops. - - fix a couple dinky memory leaks. - - build with an internal zlib for now. - - protect brp-compress against /bin/ls output ambiguity (#56656,#56336). - - 3 madvise calls and a 16Mb mmapped buffer == ~5% install speedup. Wow. - - use db-4.0.14 final internally. - - 1st crack at making zlib rsync friendly. - - lclint-3.0.0.19 fiddles. - - simple automake wrapper for zlib. - - splint fiddles. - - make peace with gcc-3.1, remove compiler cruft. - - make peace with automake et al in 8.0, ugh. - - add payload uncompressed size to signature to avoid rewriting header. - - drill header sha1 into signature parallel to header+payload md5. - - mandatory "most effective" signature check on query/verify/install. - - don't bother adding empty filemd's to index. - - add Pubkey index, using signer id as binary key. - - display pubkeys in hex when debugging db access. - - retrieve pubkey(s) from rpmdb, not from detached signature file. - - add header DSA signature. - - add header RSA signature (untested, disabled for now). -` - don't bother with signing check if 16 bits of hash don't match. - - only V3 signatures for now. - - wire --nodigest/--nosignature options to checksig/query/verify modes. - - splint annotations, signature cleanup. - - drill ts/fi through verify mode, add methods to keep fi abstract. - - use mmap when calculating file digests on verify, ~20% faster. - - permit --dbpath and --root with signature (i.e. --import) modes. - - beecrypt: add types.h, eliminate need for config.gnu.h. - - rescusitate --rebuild. - - use rpmdb-redhat to suggest dependency resolution(s). - - merge conflicts into problems, handle as transaction set variable. - - use build time to choose one of multiple alternative suggestions. - - add --nosuggests to disable suggested resolutions. - - attempt to make peace with automake-1.6.1, autoconf-2.53. - - rip out two layers of dbN gook, internal Berkeley db is here to stay. - - eliminate db1 support. - - enable CDB by default. - - use DBT_DB_MALLOC to eliminate re-malloc'ing header blobs. - - rework most of rpmdb.c prepatory to implementing duplicates. - - fix: 2 memory leaks in headerSprintf. - - fix: db mire's access out-of-bounds memory. - - plug install mode leaks. - - opaque (well mostly) rpmTransactionSet using methods. - - Grand Renaming of rpm data types. - - fix: synthesize unpacking progress callbacks for packages w/o files. - - python: add rpmds/rpmfi/rpmts methods. - - python: re-enable rpm-python sub-package. - - fix: resurrect "()(64bit)" markings using objdump. - - python: add rpmal/rpmte/rpmfd methods. - - perl: drop cpanflute and cpanflute2, will be in Chip's CPAN package. - - python: eliminate legacy db methods, add ts.dbMatch method. - - fix: use getgrnam, not getpwnam, to convert gid -> group. - - fix: avoid sign extension, use only 16 bits, when verifying rdev. - - python: separate {add,del}Macro methods, prepare for macro dictionary. - - i18n: copy current production PO files to top-of-stack. - - python: include rpmdb module, renamed from bsddb3. - - use /etc/rpm/platform (if it exists), rather than uname(2), for arch. - - python: portability fiddles (#54350). - - check inodes (but not blocks) on FAT file systems (#64256). - - add /usr/lib/rpm/redhat/* per-vendor configuration. - - remove build mode compatibility aliases, documented and gone. - - document digital signature verification in rpm.8. - - fix: separate existence and number checks for problems found (#66552). - - beecrypt: merge changes from beecrypt-2.3.0. - - beecrypt: merge doxygen markup with rpmapi doco. - - beecrypt: revert cpu/arch compile option mixup (#66752). - - ix86: make sure that rpm can verify prelinked shared libraries. - - don't install /usr/lib/rpm/redhat per-vendor configuration anymore. - - add translated man pages from PLD. - - resurrect libelf with Elf64, prelink verify should work everywhere. - - fix: reading macro files can corrupt memory if BUFSIZ is teensy. - - fix: assertion failure iff incomplete package install (#66837). - - python: link internal libelf (if used) directly into rpmmodule.so. - - use rpmdb-redhat for suggestions if/when configured (#67430). - - disambiguate failures to import (with error messages, duh). - - fix: multiple relocations (#67596). - - add --build/--program-prefix, delete libtoolize, from %configure. - - find-lang.sh: make sure that mo pattern matches leading '/' (#67368). - - disambiguate added/installed dependency failures (#50388). - - rescusitate remote ftp globs (#67678). - - open rpmdb early RDONLY, reopen later RDWR, avoid signed srpm noise. - - turn off annoying gpg secmem warning. - - warn only once for each NOKEY/UNTRUSTED key id. - - factor common options into table, add rpmcliInit() and rpmcliFini(). - - add preliminary rpmgraph(8) and rpmcache(8) executables to rpm-devel. - - use rpmfi in showQueryPackage(), eliminating headerGetEntry(). - - fix: forgot lazy open of database on --freshen path (#67907). - - proof-of-concept rpmcache functionality. - - fix: do lazy open of database in rpmtsInitDB() (#67994). - - update rpmcache.8. - - fix: permit deletions of added packages (#67108). - - placeholders for manifest constants for SuSE patch packages. - - fix: repair 2ndary match criteria with rpmdb iterators. - - update for sv.po. - - display signature details using rpm -qi. - - skip signing packages already signed with same key (#62118). - - install rpmal.h and rpmhash.h, implicit rpmps.hinclude, for now. - - revert headerFree/headerLink/headerUnlink debugging. - - popt: mingw32 portability configure check (#67911). - - teach gendiff about unreadable files (#42666). - - python: sanity check fixes on rpmts/rpmte methods. - - have rpmdb-redhat autoconfigure rpm to use %%_solve_dbpath. - - popt: parse file into string of options (#56860). - - version added to *.la dependency libraries (#69063). - - expose digests in rpmio API, but hide internal beecrypt API (#68999). - - add methods to make signature handling opaque wrto rpmts. - - verify signatures/digests retrieved through rpmdbNextIterator(). - - imbue %ghost with missingok attribute with --verify (#68933). - - fix: segfault if given a text file as 2nd arg to -Uvh (#69508). - - python: add ts.hdrCheck(), ts.rebuildDB() methods. - - python: iterating on an ts object returns transaction elements now. - - add yellowdog as vendor. - - python: remove the old initdb/rebuilddb methods, use ts.fooDB(). - - python: 1st crack at backport to 1.5.2. - - popt: fix --usage (#62234). - - fix: --repackage repaired (#67217). - - fix: rpm2cpio disables signature checks (i.e. same behavior). - - popt: display sub-table options only once on --usage. - - wire --nosignatures et al as common options, rework CLI options. - - python: don't segfault in ts.GetKeys() on erased packages. - - update trpm. - - factor all mode-specific options into mode-specific tables. - - treat an unspecified epoch as Epoch: 0 everywhere. - - detect athlon/duron with CMOV (PLD). - - prevent stale locks in __db files by closing databases on signals. - - make --querytags a common option, fix errant regex (#70135). - - db3: increase mpool and cachesize, compile w/o --enable-debug. - - configurable (default off) build failure if missing %%doc files (PLD). - - configurable (default off) build failure iff unpackaged files (PLD). - - change from default off to default on. - - python: methods to disable all new features for benchmarking. - - preserve rpmdb file attributes across --rebuilddb (#70367). - - fix: identify athlon with 3DNOWEXT as "athlon", not "i786" (#70539). - - fix: repair --root with --verify (#70527). - - fix: signed pubkeys were imported incorrectly (#68291). - - include tgpg script to verify signatures using only gpg. - - check header blobs on export (i.e. rpmdbAdd()). - - enable iterator header blob checks for install/erase modes. - - python: _vsflags_up2date macro to configure verify signature flags. - - resurrect --rollback. - - renumber the callback types to be an orthogonal bit mask. - - provide repackage progress callbacks, compression is slow. - - fix: don't repackage %%ghost files. - - add --predefine to define macros before reading macro configuration. - - python: bare bones rollback bindings. - - python: enable threads on callbacks and longish rpmlib calls. - - python: expose RPMTAG_SOURCEPACKAGE to identify source headers. - - python: eliminate rpm.headerFromPackage() tuple return, deprecated. - - python: add ts.hdrFromFdno(fdno) method. - - fix: check for lead magic, better error message on failure (#69751). - - python: the death of rpmdb-py.[ch], use ts.fooDB() methods instead. - - python: the death of rpm.headerFromPackage(), use ts.hdrFromFdno(). - - python: permit direct ts.dbMatch() python iterations. - - python: the death of rpm.checksig(), use ts.hdrFromFdno() instead. - - add bitmask for precise control of signature/digest verification. - - python: bindings to import pubkeys and display openpgp packets. - - fix: src.rpm installs need fd pos at payload. - - python: add return codes for rollbacks and fooDB methods. - - avoid generating fingerprints for locale/zoneinfo sub-directories. - - python: add (optional) ts.check() callback. - - python: include instance in IDTXload, filename in IDTXglob, return - - python: argument to ts.addErase (if integer) deletes that instance. - - python: rpmmi methods to return this instance, and number of members. - - supply transitive closure for CLI packages from rpmdb-redhat database. - - fix: rebuilddb stat'ed target, not source, for rename sanity. - - create /var/lib/rpm if non-existent in, say, a chroot. - - erased packages are now repackaged into /var/spool/repackage. - - fix: rebuilddb stat'ed target, not source, for rename sanity, take 2. - - python: explicit method to set transFlags. - - python: stuff package name into a string for repackage callbacks. - - rollback: re-create empty transaction set for multiple rollbacks. - - fix: %%basename typo (Dmitry V. Levin). - - fix: queryformat segfaults (Dmitry V. Levin). - - add --with-efence to configure, check install/upgrade with efence. - - beecrypt: short hex string conversion overflows target buffer. - - mark "successors only" packages in transaction. - - reap scriptlets with SIGCHLD handler. - - rename PSM_t to rpmpsm, add methods and refcounts to manage. - - remove %%configure/%%makeinstall from arch-os/macros, default is OK. - - don't export MALLOC_CHECK_ to scriptlets. - - squeaky clean memory leak checking. - - always malloc rpmfi structure, refcounts are correct in rpmtsRun(). - - skip redundant /sbin/ldconfig scripts on upgrade (if possible). - - python: stupid typo broke ts.check(). - - fix: add epoch to "already installed" check. - - check for interrupt during iteration. - - python: add ts.setProbFilter() method, remove ts.run() argument. - - fix: region trailer offset sanity check wrong (#71996). - - fix: don't stop if db1 database is currently in /var/lib/rpm (#72224). - - add a macro to create a sub-package with debugging symbols. - - merge signature returns into rpmRC. - - python: exceptions on NOKEY/NOTTRUSTED. - - python: don't remap NOKEY/UNTRUSTED to OK. - - beecrypt: change local absolute symbols to defines for prelinking. - - update ru.po. - - fix: handle NOKEY/NOTTRUSTED returns as if OK, always return header. - - portability: carry libelf in src rpm, include signal.h. - - fix: segfault with --checksig, plug memory leak (#72455). - - rpm-4.1 release candidate. - - requirement on libelf >= 0.8.2 to work around incompatible soname (#72792). - - fix: common sanity check on headers, prevent segfault (#72590). - - limit number of NOKEY/UNTRUSTED keys that will be warned once. - - libadd -lelf to rpmdb (#73024). - - portability: non-linux is easier, more to do (#72893). - - fix: SIGCHLD reaper race (#73134). - - fix: don't exit with open cursor, there be a stale lock. - - fix: check for signal induced exit more often (#73193). - - reinterpret the _unsafe_rollbacks macro as earliest rollback. - - fix: always do rpmalMakeIndex. - - fix: resurrect --triggers (#73330). - - python: typo in NOKEY exception string. - - fix: parse pgp packets more carefully. - - fix: parse header data more carefully. - - fix: register SIGCHLD handler before forking (#73134). - - better diagnostics on failed header parsing. - - lclint clean. - - rpm-4.1 release. - - fix: make sure that psm->child pid is set before SIGCHLD is handled. - - fix: use size_t consistently, avoid segfault on ia64. - - use %%{_lib} for libraries. - - fix: permit build with --disable-nls (#76258). - -4.0.3 -> 4.0.4: - - solaris: translate i86pc to i386 (#57182). - - fix: %GNUconfigure breaks with single quotes (#57264). - - fix: typo in find-requires. - - tru64 compiler message cleanup. - - add buildarch lines for hppa (#57728). - - sparc: make dbenv per-rpmdb, not per-dbi. - - handle lazy db open's in chroot with absolute path, not prefix strip. - - Depends should use CDB if configured. - - autodetect python 1.5/2.2. - - make rpm-perl package self-hosting (#57748). - - permit gpg/pgp/pgp5 execs to be reconfigured. - - fix: signing multiple times dinna work, discard immutable region. - - remove poptmodule.so for separate packaging. - - permit subset installs for %lang colored hardlink file sets. - - missing key(s) on keyring when verifying a signature is now an error. - - remove dependency whiteout. - - calculate rpm-4.1 ordering/orientation metrics in rpmdepOrder(). - - sync popt and rpmio with rpm-4.1, rpmio has OpenPGP API. - - sync rpmdb and build with rpm-4.1, lots of splint annotations. - - add :armor and :base64 query format qualifiers for binary signatures. - - fix: query format qualifiers needed header.c merge. - - fix: query format qualifiers needed header.c merge. - - ppc64 arch added (#58634,#58636). - - turn on auto-generated perl requirements (#58519, #58536, #58537). - - fix: %exclude functional (again). - - trap SIGILL for ppc64 inline asm voodoo fix from cross-dressed ppc32. - - fix: fancy hash fiddles if not a tty. - - fix: handle /.../ correctly in rpmCleanPath(). - - transaction rollback code in rpmRollback(). - - Red Hat 6.2 portability cruft. - - legacy: configurable whiteout for known Red Hat dependency loops. - - perl.req: don't mis-generate dependencies like perl(::path/to/foo.pl). - - permit args to be hidden within %__find_{requires,provides}. - - a couple more perl.{prov,req} fiddles. - - macro for %files, always include %defattr(), redhat config only. - - fix: drop header region when writing repackaged legacy header. - - bail on %files macro. - - transaction rollbacks are functional. - - generate index for pkgid (aka Sigmd5) tag, query/verify by pkgid. - - generate index for hdrid (aka Sha1header) tag, query/verify by hdrid. - - generate index for fileid (aka Filemd5s) tag, query/verify by fileid. - - query/verify by install transaction id. - - rpm-4.0.4 release candidate. - - add cpanflute2, another perl.req fiddle. - - reapply Berkeley DB patch #4491. - - make --addsign and --resign behave exactly the same. - - *really* dump signature header immutable region. - - speedup large queries by ~50%. - - revert to presentation ordering Yet Again (#62158). - - non-glibc: on upgrade, mergesort is much faster than quicksort. - - fix: queries that evaluated to "" incorrectly returned NULL. - - fix: packages produced by rpm-4.0 dinna merge signature tags. - - fix: rpmdb iterator memory leak in python bindings. - - fix: include for 6.2 python modules. - - remove vestiges of mipseb arch (#62408). - -4.0.2 -> 4.0.3: - - update per-interpreter dependency scripts, add sql/tcl (#20295). - - fix: rpmvercmp("1.a", "1.") returned -1, not +1 (#21392). - - add cpuid asm voodoo to detect athlon processors. - - add %exclude support (i.e. "everything but") to %files. - (Michael (Micksa) Slade" ) - - add --with/--without popt glue for conditional builds(Tomasz Kloczko). - - python: strip header regions during unload. - - add -g to optflags in per-platform config. - - permit confgure/compile with db3-3.2.9. - - permit manifest files as args to query/verify/install modes. - - fix: parameterized macro segfault (Jakub Bogusz ) - - fix: i18n tags in rpm-2.5.x had wrong offset/length (#33478). - - fix: AIX has sizeof(uint_16) != sizeof(mode_t) verify cast needed. - - fix: zero length hard links unpacked incorrectly (#34211). - - fix: --relocate missing trailing slash (#28874,#25876). - - fix: --excludedoc shouldn't create empty doc dir (#14531). - - fix: %_netsharedpath needs to look at basenames (#26561). - - fix: --excludepath was broken (#24434). - - fix: s390 (and ppc?) could return CPIOERR_BAD_HEADER (#28645). - - fix: Fwrite's are optimized out by aggressive compiler(irix) (#34711). - - portability: vsnprintf/snprintf wrappers for those without (#34657). - - more info provided by rpmdepOrder() debugging messages. - - merge (compatible) changes from top-of-stack into rpmlib.h. - - cpio mappings carry dirname/basename, not absolute path. - - fix: check waitpid return code. - - remove support for v1 src rpm's. - - re-position callbacks with ts/fi in cpio payload layer. - - state machines for packages (psm.c) and payloads (fsm.c) - - add --repackage option to put erased bits back into a package. - - fix: (ppc) copy va_list in loop (#36845). - - cpanflute perl dependency needs explicit epoch (#37034). - - regenerate rpm.8 man page from docbook glop (in max-rpm). - - lib/depends.c: diddle debugging messages. - - fix: readlink return value clobbered by header write. - - fix: ineeded count wrong for overlapped, created files. - - globalize _free(3) wrapper in rpmlib.h, consistent usage throughout. - - internalize locale insensitive ctype(3) in rpmio.h. - - boring lclint annotations and fiddles. - - transaction iterator(s) need to run in reverse order on pure erasures. - - erasures not yet strict, warn & chug on unlink(2)/rmdir(2) failure. - - more boring lclint annotations and fiddles. - - yet more boring lclint annotations and fiddles. - - still more boring lclint annotations and fiddles. - - enough lclint annotations and fiddles already. - - fix: specfile queries with BuildArch: (#27589). - - fix: debugging message displays header keys (#38454). - - use internal db-3.2.9 sources to build by default. - - don't build db1 support by default. - - create rpmdb.la so that linkage against rpm's db-3.2.9 is possible. - - rpm database has rpm.rpm g+w permissions to share db3 mutexes. - - expose more db3 macro configuration tokens. - - move fprint.[ch] and hash.[ch] to rpmdb directory. - - detect and fiddle incompatible mixtures of db3 env/open flags. - - add DBI_WRITECURSOR to map to db3 flags with CDB database model. - - add rpmdbSetIteratorRewrite to warn of pending lazy (re-)writes. - - harden rpmdb iterators from damaged header instance segfaults. - - add cron/logrotate scripts to save installed package filenames. - - upgrade to db-3.3.4. - - fix: filter duplicate package removals (#35828). - - add armv3l arch. - - fix: i18n strings need 1 on sucess return code (#41313). - - fix: skip %ghost files when building packages (#38218). - - headerFree() returns NULL, _free is C++ safe. - - remove all header region assertion failures, return NULL instead. - - perform db->verify when closing db files. - - eliminate db-1.85 and db-2.x configuration. - - fix: popt arg sanity checks broken, optarg != optArg. - - fix: popt range checks on floats/doubles broken. - - popt: return POPT_ERROR_ERRNO on config open/read/close failure. - - fix: popt exec doesn't add '--', --target et al no longer need '='. - - fix: popt consume-next-arg "!#:+" w/o side effect (#41956). - - fix: for busted db1, attempt chain reconnection to following record. - - return multiple suggested packages - (Pawel Kolodziej ). - - fix: return suggested packages when using Depends cache. - - merge sparc64/ia64 fiddles back into linux.{req,prov}. - - automagically generate perl module dependencies always. - - fix: lclint fiddles broke uCache initialization (#43139). - - always use db cursors. - - permit duplicates for btree indices. - - document build modes in rpmbuild.8, rpmbuild is born. - - default to dbenv with mpool, --rebuilddb with nofsync is much faster. - - fix: QUERY_FOR_LIST file count clobbered. - - create top level rpmcli API, factor top level modes into popt tables. - - popt: add POPT_BIT_SET/POPT_BIT_CLR to API. - - autogen.sh checks for latest libtool-1.4 and automake-1.4-p2. - - rpm --verify reports failure(s) if corresponding tag is not in header. - - rpm --verify honors %config(missingok), add -v for legacy behavior. - - remove dead code frpm popt table reorg. - - more CLI typedefs/prototypes moved from rpmlib.h to rpmcli.h. - - rpm --verify skips files in non-installed states. - - rpm --verify skips content checks for %ghost files. - - rpm --verify displays config/doc/gnost/license/readme atrrs for files. - - rpm --verify checks immutable header region digest if available. - - rpmbuild adds header region digest (SHA1 as string). - - use rpmTag* typedefs in new hge/hae/hme/hre header vectors. - - remove rpmrc Provides: Yet Again, use virtual packages. - - dump cursor debugging wrappers. - - rpm --verify can disable rpmFileAttr checks. - - add rpmdbSetIteratorRE() for regex matching in database iterators. - - permit rpm -qa to take RE args applied to name tag. - - permit dbiFindMatches() to use version/release patterns. - - eliminate all uses of rpmdbSetIterator{Version,Release}. - - fix: db1 end-of-file not detected in legacy compatible way. - - fix: remove (harmless) chown error message from %post. - - add --target/--host to %configure, add example cross-build/config.site - scripts to /usr/lib/rpm (#44581). - - rpmdb iterator selectors permit default/strcmp/regex/glob matching. - - rpmdb iterator selectors permit negative matches. - - alpha: don't add "()(64bit)" dependency markers. - - ia64/sparc: .{req,prov} identical to linux.{req,prov}. - - add "rpmlib(ScriptletInterpreterArgs)" to track - %post -p "/sbin/ldconfig -n /usr/lib" - incompatibilities. - - popt: add POPT_ARGFLAG_SHOW_DEFAULT to display initial values(#32558). - - popt: add POPT_CONTEXT_ARG_OPTS for all opts to return 1 (#30912). - - fix: fsm reads/writes now return error on partial I/O. - - fix: Ferror returned spurious error for gzdio/bzdio. - - check for API/ABI creep, diddle up some compatibility. - - preliminary abstraction to support per-header methods. - - finalize per-header methods, accessing headerFoo through vector. - - make package ordering loop messages debug, not warning. - - remove {ia64,sparc}-linux.{prov,req}, changes merged into linux.*. - - fix: partial sets of hardlinked files permitted in payload. - - fix: mark rpmdb files with %config to prevent erasure on downgrade. - - work around a (possible) compiler problem on ia64. - - fix: rpm -qlv link count for directories dinna include '..'. - - fix: rpm -qlv size for directories should be zero. - - add --noghost to filter non-payload files from rpm -qlv output. - - add %{_gnu} macro to append "-gnu" to %{_target_platform} to - support --target/--host flavored %configure. Legacy behavior - available by undefining %{_gnu}. - - propagate %{_gnu} to per-platform configuration. - - fix: parameterized macros with massive mumber of options need - "optind = 1" "Dmitry V. Levin" . - - add athlon per-platform configuration. - - remove executable bit to disable autogenerated perl requires until - perl provides can be vetted. - - disable per-platform %%configure use of %%_gnu until libtool package - stabilizes. - - fix: permit partially enumerated hardlink file sets during build. - - fix: resurrect rpm signature modes. - - fix: sanity checks on #tags (<65K) and offset (<16Mb) in header. - - fix: add -r to useradd to prevent /etc/skel glop (#46215). - - fix: disambiguate typedef and struct name(s) for kpackage. - - update intl dirs to gettext-0.10.38. - - fix: sanity check for header size added in headerCopyLoad() (#46469). - - fix: redundant entries in file manifests handled correctly (#46914). - - map uid/gid from metadata into payload headers. - - add removetid to header during --repackage. - - expose rpmShowProgress() and rpmVerifyDigest() in rpmcli.h. - - portability: avoid st_mtime, gendiff uses basename, etc (#47497). - - glibc-2.0.x has not __va_copy(). - - popthelp.c: don't use stpcpy to avoid portability grief (#47500). - - permit alias/exec description/arg text to be set from popt config. - - python: rhnLoad/rhnUnload to check header digest. - - package version now configureable, default v3. - - rename rpm libraries to have version with libtool -release. - - fix: -i CLI context broken Yet Again. - - unlink all __db.nnn files before 1st db open. - - python bindings should not segfault when fed bad data. - - fix: adjust arg count for --POPTdesc/--POPTargs deletion. - - add linux per-platform macro %_smp_mflags . - - document more popt aliases for --help usage. - - remove --tarbuild from man page(s), use -t[abpcils] instead (#48666). - - fix: scope multi-mode options like --nodeps correctly (#48825). - - isolate cdb access configuration (experimental, use at your own risk). - - fix: hard fail on locked dbopen if CDB locking not in use. - - fix: dbconfig with mp_mmapsize=16Mb/mp_size=1Mb for - "everything ENOSPC" failure check. - - fix: don't total hard linked file size multiple times (#46286). - - add %dev(type,major,minor) directive to permit non-root dev build. - - fix: _smp_flags macro broken. - - python: bind rhnUnload differently. - - fix: rescusitate --querytags. - - fix: short aliases broken (#49213). - - python: "seal" immutable region for legacy headers in rhnUnload() . - - python: add poptmodule.so bindings. - - fix: %dev(...) needs to map rdev and mtime from metadata. - - resurrect --specedit for i18n. - - fix: 4 memory leaks eliminated. - - fix: yet another segfault from bad metadata prevented. - - add sha1 test vectors, verify on ix86/alpha/sparc. - - add (but disable for now) rpm-perl subpackage from Perl-RPM. - - python: parameterize with PYVER to handle 1.5 and/or 2.1 builds. - - add build dependency on zlib-devel (#49575). - - enable rpm-perl subpackage. - - add pmac/ppciseries/ppcpseries varieties to ppc arch family. - - include tdigest.c tkey.c and trpmio.c to "make dist". - - re-enable dependency resolution source from package NVR. - - rename pmac to ppcmac. - - ia64: revert -O0 compilation. - - upgrade to db-3.3.11 final. - - fix: don't segfault when presented with rpm-2.4.10 packaging (#49688). - - fix: --noscripts is another multimode option. - - add tmpdir to configure db3 tmpdir into chroot tree. - - permit lazy db opens within chroot. - - fix: diddle dbenv path to accomodate backing store reopen in chroot. - - add support for mips (#49283). - - add __as, _build_arch, and __cxx macros (#36662, #36663, #49280). - - detailed build package error messages. - - fix: i18n tags not terminated correctly with NUL (#50304). - - add explicit casts to work around a s390 compiler problem. - - fix: autoconf glob tests (#50845). - - portability: some compilers squawk at return ((void) foo()) (#50419). - - remove fdFileno() from librpmio, use inline version instead (#50420). - - fix: linux find-requires needs quotes around [:blank:]. - - remove /var/lib/rpm/__db* cache files if %__dbi_cdb is not configured. - - python: add hiesenbug patch. - - add legacy (compile only) wrappers for fdFileno et al. - - add -D_REENTRANT (note rpmlib is still not thread safe). - - fix: segfault on headerFree given malicious data. - - fix: don't verify hash page nelem. - - better error messages for verification failures. - - include directory /usr/lib/rpm in rpm package. - - always use dl size in regionSwab() return. - - ppc: revert ppcmac to ppc. - - ppc: autoconf test for va_copy. - - python: add exception to detect bad data in hdrUnload. - - change dir creation message from warning to debug for now. - - verify perms (but not mode) on %ghost files. - - headers without RPMTAG_NAME are skipped when retrieved. - - within a region, entries sort by address; added drips sort by tag. - - fix: error message on failed package installs resurrected. - - python: memory leaks in headerLoad/headerunload bindings. - - python: retrofit sha1 digest using RPMTAG_SHA1RHN. - - python: change rhnUnload bindings. - - python: teach rhnLoad about RPMTAG_SHA1RHN as well. - - fix: Provides: /path did not work with added packages (#52183). - - fix: progress bar scaling did not include source rpm count. - - fix: hash page nelem failure to verify. - - fix: initialize "verify" transaction stepName with -vv (#53582). - - fix: ftp remote globs broken (#46892). - - popt: clarify X consortium license in popt.3 man page. - - close/discard Depends index after rpmdepCheck() use. - - lclint-3.0.0.15 fiddles. - - fix: harmless typo in db3 chroot hack. - - fix: big-endian's with sizeof(time_t) != sizeof(int_32) mtime broken. - - fix: add Korean message catalogs (#54473). - - add RPHNPLATFORM and PLATFORM tags. - -4.0 -> 4.0.[12] - - fix: avoid calling getpass twice as side effect of xstrdup macro - (katzj@linuxpower.org) (#17672). - - order packages using tsort, clipping Requires:'s in dependency loops. - - handle possible db3 dependency on -lpthread more gracefully. - - bump popt version to 1.6.1. - - fix: more (possible) xstrdup side effects. - - fix: rpm2cpio error check wrong on non-libio platforms. - - fix: runTriggers was not adding countCorrection. - - add rpmGetRpmlibProvides() to retrieve rpmlib(...) provides - "Pawel A. Gajda" . - - syntax to specify source of Requires: (PreReq: now legacy). - - rip out rpm{get,put}text, use getpo.sh and specspo instead. - - fine-grained Requires, remove install PreReq's from Requires db. - - fix: duplicate headerFree() on instalBinaryPackage() error return. - - fix: work around for (mis-compilation?!) segfaults on signature paths. - - fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595). - - hpux w/o -D_OPEN_SOURCE has not h_errno. - - verify MD5 sums of payload files when unpacking archive. - - hide libio lossage in prototype, not API. - - add support for SHA1 as well as MD5 message digests. - - don't verify src rpm MD5 sums (yet). - - md5 sums are little endian (no swap) so big endian needs the swap. - - add doxygen and lclint annotations most everywhere. - - consistent return for all signature verification. - - use enums for almost all rpmlib #define's. - - API: change rpmProblem typedef to pass by reference, not value. - - unify rpmError and rpmMessge interfaces through rpmlog. - - collect and display rpm build error messages at end of build. - - don't trim leading ./ in rpmCleanPath() (#14961). - - detect (still need to test) rdonly linux file systems. - - check available inodes as well as blocks on mounted file systems. - - pass rpmTransactionSet, not elements, to installBinaryPackage et al. - - add cscope/ctags (Rodrigo Barbosa). - - remove getMacroBody() from rpmio API. - - add support for unzip - - add brp-strip-shared script . - - better item/task progress bars . - - load headers as single contiguous region. - - add region marker as RPM_BIN_TYPE in packages and database. - - fix: don't headerCopy() relocatable packages if not relocating. - - merge signatures into header after reading from package. - - RPM_BIN_TYPE malloc'ed when retrieved through headerGetEntry(). - - add headerFreeData() to free any data malloc'ed during retrieval. - - preserve exact image of original header when installing/upgrading. - - add missing headerFree for legacy signature header. - - fix: removed packages leaked DIRINDEXES tag data. - - reload tags added during install when loading header from rpmdb. - - avoid brp-compress hang with both compressed/uncompressed man pages. - - improved find-{requires,provides} for aix4/hpux/irix6/osf. - Tim Mooney - - portability: remove use of GNU make subst in lib/Makefile (Joe Orton). - - python: bind package removal (#21274). - - autoconfigure building python bindings. - - autoconfigure generating rpm API doco. - - fix: don't fdFree in rpmVerifyScript, rpmtransFree does already. - - use package version 3 if --nodirtokens is specified. - - add package names to problem sets early, don't save removed header. - - make sure that replaced tags in region are counted in headerSizeof(). - - support for dmalloc debugging. - - filter region tags in headerNextIterator, exit throut headerReload. - - add rpmtransGetKeys() to retrieve transaction keys in tsort'ed order. - - python bindings for rpmtransGetKeys(). - - fix: include alignment in count when swabbing header region. - - handle added dirtoken tags (mostly) correctly with header regions. - - add FHS doc/man/info dirs, diddle autoconf goo. - - fix: headerUnload handles headers w/o regions correctly on rebuilddb. - - resurrect rpmrc Provides: as well as implicit dependency on packge - info. - - change dependency loop message to RPMMESS_WARNING to use stderr, not - stdout. - - fix: (transaction.c) assume file state normal if tag is missing. - - fix: failed signature read headerFree segfault. - - fix: revert ALPHA_LOSSAGE, breaks 6.2/i386. - - fix: synthesized callbacks for removed packages have not a pkgkey. - - identify install scriptlet failures with the name of the scriptlet. - - handle install chroot's identically throughout the install process. - - add rpmlib(HeaderLoadSortsTags) for tracking header regions - "just in case". - - create _tmppath on the fly if not present. - - remove /etc/rpm/macros.db1 configuration file if db3 rebuilt. - - remove overly verbose dbiOpen() error messages, no longer needed. - - whiteout mozilla loop for 7.1. - - immutable headers, once installed by rpm3, need to lose immutablity. - - fix: removed headers from db need a headerCopy(). - - send query/verify output through rpmlog(). - - resurrect rpmErrorSetCallback() and rpmErrorString(). - - use malloc'ed buffer for large queries. - - fix: avoid FAT and other brain-dead file systems that have not inodes. - - fix: hack around alpha mis-compilation signature problems. - - rpmmodule.c(handleDbResult): return empty list when nothing matches. - - (non-linux): move stubs.c to rpmio (#21132). - - (python): bind initdb (#20988). - - (popt): fix float/double handling (#19701). - - (popt): non-linux needs (#22732). - - (popt): add POPT_ARGFLAG_OPTIONAL for long options with optional arg. - - (popt): diddle auto-help to include type of arg expected. - - use popt autohelp for rpm helper binaries. - - fix: avoid locale issues with strcasecmp/strncasecmp (#23199). - - remove almost all explicit uses of stderr in rpmlib using rpmError(). - - fix: pass scriptlet args, as in %post -p "/sbin/ldconfig -n /lib". - (Rodrigo Barbosa). - - fix: 3 packages from Red Hat 5.2 had bogus %verifyscript tag. - - tsorted packages processed in successor count order. - - fix: resurrect --excludepath (#19666). - - fix: digests on input FD_t dinna work. - - fix: remove rebuilddb debugging leakage. - - successors from tsort are processed in presentation order. - - fix: find-requires.perl needed update (#23450). - - fix: don't hang on build error. - - fix: remove "error: " prefix from signature verification message. - - hack: permit installer to determine package ordering using 1000003 tag. - - fix: extra newline in many error messages (#23947). - - fix: rpm -Va with db1 needs per-iterator, not per-index, offset. - - add install/remove transaction id tags. - - tsort prefers presentation order. - - 1st crack at Mandrake specific per-platform macros. - - fix: insure that %lang scopes over hard links correctly. - - fix: rpmCleanPath was nibbling at .. in macrofiles incorrectly. - - fix: check waitpid return code. - - fix: make a copy of retrieved header before loading. - - fix: diddle exit code for attempted installs of non-packages (#26850). - - python binding diddles to reduce installer memory footprint by - delayed loading of file info. - - fix: remove fixed size buffer on output path (#26987,#26332). - - resurrect rpmErrorCode in the API for Perl-RPM. - - fix: permit packages to differ by 0 or 32 bytes (#26373). - - fix: permit HEADER_IMMUTABLE tag queries. - - split db configuration into separate file. - - portability changes from Joe Orton et al. - - (alpha): rip out ALPHA_LOSSAGE now that gcc-2.96-76 has fix (#28509). - - (popt): use sprintf rather than snprintf for portability. - - (sparc) disable MD5 sum checks during install. - - (db1) plug largish memory leak in simulated interface for falloc.c. - - remove mozilla dependency white out, no longer needed. - - fix: adjust for libio breakage in Red Hat 5.x with glibc-2.0.7-29.4. - - map i686-like (i.e. w/o CMOV) platforms to better alternatives. - -3.0.6 -> 4.0 - - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db. - - API: change dbi to pass by reference, not value. - - cram all of db1, db_185, and db2 interfaces into rpmlib. - - convert db1 -> db2 on-disk format using --rebuilddb. - - add db3 to the pile, isolate all with incremental link and vectors. - - prefer db3 as default. - - permit db3 configuration using macros. - - create dbi from template rather than passed args. - - use hashed access for package headers. - - db3: save join keys in endian neutral binary format. - - treat legacy falloc.c as "special" db[01] index for package headers. - - API: pass *SearchIndex() length of key (0 will use strlen(key)). - - API: remove rpmdb{First,Next}RecNum routines. - - add explcit "Provides: name = [epoch:]version-release" to headers. - - fix: cpio.c: pre-, not post-, decrement the link count. - (from Fabrice Bellet ) - - make db indices as lightweight as possible, with per-dbi config. - - db1.c will never be needed, eliminate. - - API: merge rebuilddb.c into rpmdb.c. - - API: replace rpmdbUpdateRecord with rpmdbSetIteratorModified. - - API: replace rpmdbFindByLabel with RPMDBI_LABEL iteration. - - API: replace rpmdbGetRecord with iterators. - - API: replace findMatches with iterators. - - Filter DB_INCOMPLETE on db->sync, it's usually harmless. - - Add per-transaction cache of resolved dependencies (aka Depends). - - Do lazy dbi{Open,Close} throughout. - - Attempt fine grained dbi cursors throughout. - - fix: free iterator *after* loop, not during. - - fix: Depends needed keylen in dbiPut, rpmdbFreeIterator after use. - - Rename db0.c to db1.c, resurrect db2.c (from db3.c). - - simplify --last popt alias, date like -qi (bjerrick@easystreet.com). - - fix: alloca'd memory used outside of scope (alpha segfault). - - fix: define/eval options assumed sizeof(int) == sizeof(void *). - - fix: sparc64 per-platform directory shouldn't be sparc64linux. - - fix: (segfault) verify needs rpmdb while query does not. - - add calculated nlink field to -qlv output (like ls -al). - - detects and builds properly against the new fopencookie API in - glibc 2.2. - - change popt exec alias in oreder to exec rpm children. - - split rpm into 5 pieces along major mode fault lines with popt glue. - - turn on new, more complete version of %%configure. - - add %%makeinstall analogue of new %%configure for autoconf packages. - - mark packaging with version 4 to reflect filename/provide changes. - - change next version from 3.1 to 4.0 to reflect package format change. - - change %configure, add %makeinstall macros to handle FHS changes. - - add optflags for i486 and i586. - - fix: segfault with legacy packages missing RPMTAG_FILEINODES. - - require db3 in default configuration. - - create rpmio directory for librpmio. - - make librpmio standalone. - - fix: avoid clobbering db cursor in removeBinaryPackage. - - expose cursors in dbi interfaces, remove internal cursors. - - remove incremental link. - - portability: sparc-sun-solaris2.5.1. - - fix: don't count removed files if removed packages is empty set. - - fix: permit '\0' as special case key (e.g. "/" in Basenames). - - require --rebuilddb to convert db1 -> db3, better messages. - - fix: open all db indices before performing chroot. - - fix: typo in brp-compress caused i18n man pages not to compress. - - API: uncouple fadio from rest of rpmio. - - API: externalize legacy fdOpen interface for rpmfind et al. - - put version on rpmpopt filename to avoid legacy filename collision. - - change optflags for i386. - - multilib patch, take 1. - - add pre-transaction syscall's to handle /etc/init.d change. - - don't bother saving '/' as fingerprint subdir. - - prefix payload paths with "./", otherwise "/" can't be represented. - - fix: compressFilelist broke when fed '/'. - - fix: typo in --last popt alias (#12690). - - fix: clean file paths before performing -qf (#12493). - - remove build mode help from rpm.c, use rpmb instead. - - fix: set multilibno on sparc per-platform config. - - fix: legacy requires './' payload prefix to be omitted for rpm itself. - - fix: remove verbose database +++/--- messages to conform to doco. - - add S_ISLNK pre-transaction syscall test. - - fix: initialize pretransaction argv (segfault). - - fix: check rpmlib features w/o database (and check earlier as well). - - rip out pre-transaction syscalls, more design is needed. - - remove (dead) dependency checks on implicitly provided package names. - - remove (dead) rpmdb API code in python bindings. - - fix: make set of replaced file headers unique. - - fix: don't attempt dbiOpen with anything but requested dbN. - - create rpmbuild/rpmquery/rpmverify/rpmsign symlinks. - - fix: look for any/all dbapi when rebuilding. - - link rpm2cpio dynamically since cpio is linked dynamically. - - fix: uniqify dependency problems when printing (#14034). - - fix: segfault on erase if filestates is missing in header (#14679). - - fix: popt POST callbacks typo. - - fix: -Va broken, make db cursors per-iterator, not per-dbi. - - fix: segfault when globbing on "" (#15593). - - fix: rebuild db1 -> db3 ate 1st header (#16263). - - translate rpm.8 man page (Peter Ivanyi ). - -3.0.6 -> 3.0.7 - -3.0.5 -> 3.0.6 - - python bindings to query and verify signatures. - - add callbacks on package erasure. - - fix: preserve cpio errno when using Fclose with libio. - - fix: initialize sigs everywhere in python header object. - - popt: support for float/double args. - - fix: honor --test when doing --freshen. - - add alpha* architectures. - -3.0.4 -> 3.0.5 - - configure.in fiddles for BSD systems (Patrick Schoo). - - solaris2.6: avoid bsearch with empty dir list (Ric Klaren - klaren@cs.utwente.nl) - - include RPM-GPG-KEY in file manifest. - - Add ia64 and sparc64 changes. - - rpm.spec: add per-platform sub-directories. - - FreeBSD fixes (bero@redhat.com). - - handle version 4 packaging as input. - - builds against bzip2 1.0 - - fix: resurrect symlink unique'ifying property of finger prints. - - fix: broken glob test with empty build directory (Geoff Keating). - - fix: create per-platform directories correctly. - - update brp-* scripts from rpm-4.0, enable in per-platform config. - - alpha: add -mieee to default optflags. - - add RPMTAG_OPTFLAGS, configured optflags when package was built. - - add RPMTAG_DISTURL for rpmfind-like tools (content unknown yet). - - teach brp-compress about /usr/info and /usr/share/info as well. - - update macros.in from rpm-4.0 (w/o dbi configuration). - - fix: don't expand macros in false branch of %if (kasal@suse.cz). - - fix: macro expansion problem and clean up (#11484) (kasal@suse.cz). - - uname on i370 has s390 as arch (#11456). - - python: initdb binding (Dan Burcaw ). - - internalize --freshen (Gordon Messmer ). - - support for separate source/binary compression policy. - - support for bzip payloads. - - fix: payload compression tag not nul terminated. - - identify package when install scriptlet fails (#12448). - - remove (unused) RPMTAG_CAPABILITY. - - remove (legacy) use of RPMTAG_{OBSOLETES,PROVIDES} internally. - - remove (legacy) support for version 1 packaging. - - remove (legacy) support for converting gdbm databases. - - eliminate unused headerGz{Read,Write}. - - support for rpmlib(...) internal feature dependencies. - - display rpmlib provides when invoked with --showrc. - - fix: compare versions if doing --freshen. - - disable rpmlib(VersionedDependencies) by defining _noVersionedDependencies. - -3.0.3 -> 3.0.4 - - use compressed filenames on install side. - - start unifying FD types, CFD_t now gone. - - check for memory leaks (almost all leaks are plugged). - - fix: resurrect multiple target platform builds. - - freshen.sh: detect when all packages are up to date (Ian Macdonald). - - fix: typo in error message (#6858). - - add/update dependency scripts (Ken Estes). - - use directory tokens internally to reduce memory usage. - - permit --whatprovides to lookup file dependencies. - - fail to package if absolute symlink points within build root. - - initial version of check-prereqs. - - expose enough of legacy fdio interface to compile rpmfind/rpm2html. - - fix: Fopen should use 0666 as default (umask will be applied later). - - fix: default for rd_timeoutsecs is 1 sec (avoid ufdio assertion). - - fix: new FILENAMES tags require package index, not pointer in lookups. - - rename new FILENAMES tags to BASENAMES/DIRNAMES/DIRINDEXES. - - fix: don't look at password when searching urlCache. - - add contentLength sanity check on rpmdb headerWrite. - - fix: fprint abort on stat("/", ...) in empty chroots. - - perform glob on remote ftp query args. - - fix: ftpAbort must close the data channel to read abort status. - - perform glob on remote ftp install args. - - fix: reload macros from cmd line when re-reading config files. - - fix: compressFileList was over-generating dirNames. - - fix: alAddPackage sorted dirNames too soon, destroying dirMapping. - - expose enough of legacy fdio interface to compile gnorpm. - - fix: missing strdup when overriding buildroot from command line - argument (#1026,#5006). - - diddle some names to keep my C++ brethern happy (i.e. kpackage port). - - fix: add ufdSeek. - - build popt (with libpopt.so*) as a sub-package of rpm. - - split python bindings into a separate sub-package of rpm. - - add ja translation and man pages (Kanda Mitsuru kanda@nn.iij4u.or.jp). - - fix: fp.subDir was incorrectly set to NULL in sparse chroot's. - - fix: manageFile needs to and with O_WRONLY(=1), not O_RDONLY(=0). - - fix: resurrect failed glob error message during build. - - add several BuildRoot FTW policies. - - add manpage for gendiff (pbrown@redhat.com). - - updated sv.po (goeran@uddeborg.pp.se) (#8349). - - configurable PATH for install %pre/%post et al scriptlets. - - use only %_install_langs, not LINGUAS/LANG when deciding to install. - - configurable compression type/level for package payloads. - - default value for %_install_langs is all. - - fix: resurrect relative path's in fprint lookup queries. - - extract spec files from bzip'ped tarballs too on tar builds. - - add %_rebuilddbpath macro to permit rebuilding db in new location. - - updated perl scripts (Ken Estes). - - fix: on --rebuilddb, make sure new/old paths are not the same (#8752). - - fix: on --erase, segfault caused by "" prefix. - - explicitly expand file lists in writeRPM for rpmputtext. - - {Free,Open}BSD find-{provides,requires} (suzukis@file.phys.tohoku.ac.jp). - - new rpm-build package to isolate rpm dependencies on perl/bash2. - - always remove duplicate identical package entries on --rebuilddb. - - add scripts for autogenerating CPAN dependencies. - - add sl.po from Primoz Peterlin . - - updated sv.po from . - - macro expansion (and absolute path) in %files -f arg (#9508,#9091). - - permit cli setting of build root policies. - - fix: filter excluded paths before adding install prefixes (#8709). - - add i18n lookaside to PO catalogue(s) for i18n strings. - - try for /etc/rpm/macros.specspo so that specspo autoconfigures rpm. - - per-platform configuration factored into /usr/lib/rpm subdir. - - sparc-sun-solaris2.6 portability check. - - simpler hpux.prov script (Tim Mooney). - - portability: skip bzip2 if not available. - - portability: skip gzseek if not available (zlib-1.0.4). - - portability: skip personality if not available (linux). - - portability: always include arpa/inet.h (HP-UX). - - portability: don't use id -u (Brandon Allbery). - - portability: don't chown/chgrp -h w/o lchown. - - portability: splats in rpm.spec to find /usr/{share,lib}/locale/* . - - fix: better filter in linux.req to avoid ARM specific objdump output. - - fix: use glibc 2.1 glob/fnmatch everywhere. - - fix: noLibio = 0 on Red Hat 4.x and 5.x. - - fix: typo in autodeps/linux.req. - - configure noarch compatibility in rpmrc for ia64. - -3.0.2 -> 3.0.3 - - add --eval to find result of macro expansion. - - add configure scaffolding to support rpm-4.0 packages. - - include shared libs in rpm-devel (no versioning yet). - - add epoch (as [0-9]*:version-release) to install dependency parse. - - move install/erase major modes into rpmlib. - - move checksig/resign major modes into rpmlib. - - add python bindings to rpm-devel (linux only). - - make query (rpm -qvl) behave like (POSIX?) ls for older files (#4050). - - fix: %if parsing skipped 3 chars too many. - - permit multiline macro expansions with comments and %if. - - add pl translation and man pages (PLD team - from Tomasz Kloczko). - - fix: incomplete cleanup if --rebuilddb fails (#4115). - - add versions to provides. - - fix: sanity test on specfile fails when encountering i18n chars. - - print all dependencies for each package at end of build. - - the death of RPMSENSE_SERIAL, use [epoch:]version[-release] instead. - - add _mandir/_infodir macro expansions to docdirs (Tomasz Kloczko). - - add post install configurable dependency checking. - - fix: segfault on --rebuild (#4185). - - macro fixes (Benedict Lofstedt, #4220): - expand %# just like %{#} (and with same value as shell analogues). - macro defaults for *, 0, and # if no args specified. - getopt on non-linux requires optind to be saved/restored. - - fix: don't remove file until last occurence in transaction (#4291). - - resuscitate net shared paths (#4330). - - fix: macro table cannot contain NULL pointers (#4263). - - fix: last char in rpmrc w/o terminating newline lost (#4361). - - prepare for handling \r in macro exapnsions. - - fix: n>1 occurrences of %config(noreplace) should not FA_CREATE (#4355). - - fix: use pgp5 rather than pgp-2.6.3 if both are in %_pgpbin (#4564). - - match "de" when locale is specified as "de_DE.ISO-8859-1@Munich". - - add versions to obsoletes. - - add %_install_langs to configure languages to be installed. - - add LC_ALL/LC_MESSAGES to query locale search. - - fix: segfault with "--sign" w/o supplying files (#4651). - - add headerWrite return code and check for errors. - - update python bindings from anaconda. - - add versions to prereq. - - add syntax sensitive implict prereq on rpm-3.0.3. - - fix: don't successfully match with strncasecmp("sparc", "sparc64", 5) - - add sparcv9 architecture. - - add --freshen to usage message (#4823). - - suggested changes to docs from Ken Estes (#4451). - - link libbz2.a statically to avoid rpm->bzip2 dependence for now. - - Tru64: avoid find-requires variable size limit (Tim Mooney). - - Solaris: use getpassphrase rather than getpass if available. - - pgp and pgp5 have compatible RSA signature (#4780). - - fix: avoid db problems with self-obsoleting packages on install. - - glibc2: always enable dynamic mtrace if available. - - fix: versioned provides devolved to existence test with conflicts. - - fix: with unspecified epochs, skip dependency epoch compare. - - python: shared module linked correctly. - - do versioned provides/conflicts resolution correctly. - - rpmpopt: display versioned provides/obsoletes. - - revert to shared libbz2.so now that bzip2 is in base install. - - fix: command line install had header memory leak. - - check for NULL on all memory allocations. - - free rpmrc mallocs on exit. - - glibc2: permit run time leak detection. - - fix: removed files fingerprint memory leak. - - fix: resurrect allfiles flag from rpm-2.5.x. - - fix: version compares compatible with epoch-less requires/conflicts. - - fix: rpm-2.5.1 had file list w/o leading / fix. - - portatbility fiddles (solaris). - - create binary rpm directory (e.g. .../%{_target_cpu}) on the fly. - - updated pl/rpm.8 (PLD team). - - new find req/prov scripts for non-linux platforms (Tim Mooney). - - fix: non-GNU globs burp on repeated '/' in patterns. - - dumb cpp's want white space around lclint annotations (Tim Mooney). - - aix: aix.req broken by cut-and-paste (Tim Mooney). - -3.0.1 -> 3.0.2 - - eliminate armv4 entries from rpmrc (Andrew E. Mileski). - - permit multiple "Provides: " lines in rpmrc (#2999). - - add BuildConflicts: and BuildRequires: in spec file and src rpm. - - fix: bigendian's with longlong file sizes (e.g. IRIX) dinna work. - - move printDep* routines into rpmlib for gnorpm et al. - - updated ru translation (Sergey Kubushin). - - add vpkg-provides.sh (Tim Mooney). - - don't clobber LDFLAGS in top-level Makefile (Tim Mooney). - - fix: build root from cmd line did not set macro %buildroot (#1026). - - fix: resurrect "rpm -Va --nofiles" (verify dependencies only) (#3111). - - rpm-devel should require popt (#3125). - - don't spin while waiting for delayed requires/provides input (#3289). - - common parse for all dependency token syntax. - - eliminate find-requirements on libNoVersion (Red Hat linux only). - - add new-fangled requires on "libc.so.6(GLIBC_2.1)" (sparc-linux only). - - MiNT port (Guido Flohr ). - - fix: --rebuilddb with --root dinna remove directory (Michael Andres). - - fix: false fingerprint stat cache hit -- "the tetex problem" (#2727). - - fix: bsearch needs macro table sorted after undefine. (#3713). - - fix: --checksig segfault with odd pgp output (e.g. w/o ~/.pgp) (#3720) - - avoid numeric overflow in version comparison (Thayne Harbaugh). - - move url.c and ftp.c to rpmlib right next to query. - - 12 more dead strtoks. - - changelog stamp broken w/ big endian 64 bit time_t (Stephane Erania). - - tru64: use /bin/sh not /usr/bin/ksh in find-requires. - - 32Mb (~16x largest known) sanity check on header size. - -3.0 -> 3.0.1 - - fix: %verifyscript resurrected (Shing-Gene Yung). - - fix: % before non-alphabetic non-macro special now passed unscathed. - - fix: noarch header gets initialized differently. - - fix: $2 to triggerpostun scripts was wrong - - fix: --querybypkg in man page should be --filesbypkg - - fix: optflags not implicitly set to canonical arch value. - - fix: prefer pgp2.6.3 over pgp5 if both are installed. - - make sure that rpm-the-package auto-requires glibc. - - add rpmputtext/rpmgettext to rpm package. - - fix: non-apache servers need "GET ... HTTP/1.0" by the book. - - fix: %doc wrongly inherits lang from last entry in %files. - - resurrect toplevel tar target. - - spec file removal separate from source removal (Shing-Gene Yung). - - add rpm prefix to MD5 routines to avoid name conflict on solaris. - - fix: resurrect -Vp, -Vf and -Vg functionality. - - colesce query and verify modes. - - better cpio error message if package contains missing hard links. - - fix: shared file not skipped when removed. - - fix: conversion script left off leading underscores. - - another strtok bites the dust. - - fix: prevent return code wrap during packagage checking/resigning. - - permit multiple %lang(xx) markers on elements in %files. - - permit %lang(xx,yy,zz) constructs -- 2 more dead strtoks. - - fix: --prefix should work properly during package installs. - - add librpmbuild.a to the file list. - -2.94 -> 2.95 - - fix: last update transaction set segfault bug in installer. - - improved checks for statfs (Tim Mooney). - - remove inconsistent use of __P((...)) throughout. - - non-static inline functions caused IRIX cc pain. - - CPIOERR_CHECK_ERRNO masking caused AIX cc warnings. - - solaris 2.6+ needs statvfs. - - check build prerequisites before building from specfile. - - convert per-system configuration in /etc/rpmrc to macros. - -2.93 -> 2.94 - - fix: segfault while parsing target string. - - fix: os was not initialized with "--target i586". - - fix: --prefix resurrected. - - non-linux, non-gcc portability fixes (Tim Mooney). - - default to static libs only (remove implied support for shared libs). - -2.92 -> 2.93 - - eliminate old rpmrc configuration syntax. - - pgp5 support (Carlo Wood ) - - fix: segfault from double close on ftpGetFileDesc->ftpAbort path. - - fix: don't add header if signature generation failed (Carlo Wood). - - more DU 4.0D fiddles (Shing-Gene Yung). - - fix: segfault from unknown uid/gid -- use builder's uid/gid instead. - - autoReq/autoProv now per-package. - - fix: avoid segfault using --prefix until ewt fixes. - - add --define "%foo %bar" option. - - dump macros to same fd as --showrc uses. - - add %GNUconfigure for full-blown package regeneration. - - fix: RPM_ARCH/RPM_OS had wrong values. - - fix: create ppc directories correctly. - - (re-)enable fixowner/fixgroup macros. - - fix: specfile BuildRoot was masking rpmrc macro. - - expand twiddles in macrofiles list. - - add explicit macrofiles path to rpmrc. - - add per-target macrofiles to search path. - - take globalMacroContext out of macro api. - - fix: flush all macros between builds. - - add name/version/release macros during src.rpm install. - - attempt mkdir sourcedir/specdir during src.rpm install. - -2.91 -> 2.92 - - update with libtool-2.4f. - - DU 4.0D fiddles (Shing-Gene Yung) - - change support@redhat.com to rpm-list@redhat.com. - - fix: with --target=i686, pass macro %_arch=i386. - - fix: rpm --target=arch ... resurrected. - - fix: rpm -q --specfile --specedit now works even with BuildArch:. - - fix: nested strtok's is a no-no. - - added disk space checking - -2.90 -> 2.91 - - fix: memory leaks in rpmRunTransactions plugged. - - fix: build of packages w/o BuildRoot segfault. - - permit substitution of I18N strings from PO meta-catalogues. - - add callbacks for installer updates while doing URL xfers. - - resurrect http queries/verifies. - - create rpmbzio.c to avoid implicit dependence on libbz2 for installer. - - spec files can provide /filename now - - added rpmdbOpenForTraversal() - - proxy http (Alex deVries). - - add BuildPrereq: in spec file and src rpm. - - added rpmtransSetScriptFd() - - fixed config file problems during chroot upgrades - - fixed %attr brokenness for directories - - augment linux provides/requires for glibc 2.1 backward compatibility. - - fixed --noscript, --notriggers, --excludedocs, and a bunch - of other install/remove flags - - fixed noreplace handling - - complain about old packages being installed - -2.5.x -> 2.90 - - added --excludepath - - identify missing keys by type (Toshio Kuratomi). - - package install/removal much smarter about symlinks - - redid install/remove API to allow transaction semantics - - support for GPG (Toshio Kuratomi ) - - file lookup finally sane wrt symbolic links :-) - - fileindex format changed -- rebuilddb is necessary for rpm 2.90!! - - --rebuilddb doesn't open old index files - - permit http:// and file:// url's as well as ftp://. - - change --rcfile to permit colon separated file list. - - compile in defaults from rpmrc/macros. - - finish hiding rpmdb index record data ("matches"). - - implement abstract fd type almost everywhere. - - update and rename Czech (Pavel Makovec ) - - augment --showrc with -v, only display set variables without -v. - - add macrofiles variable, permit second entry to initMacros(). - - add config.h defines for paths to find-requires et. al. - - add readRPM to libbuild, headerGetLangs to librpm. - - permit rpm to be built in a sub-directory (--srcdir=DIR). - - configure using automake. - - arch/os (and platform) should be case insensitive everywhere forever. - - attempt to deal rationally with os as "Linux" or "linux". - - add generalized expression handler (Tom Dyas) - - use /usr/lib/rpm/mkinstalldirs if mkdir -p fails. - - more portable dirent handling (Hermann Lauer). - - add Slovak translation (Stanislav Meduna ) - - gettextify rpmMessage/rpmError/fprintf messages. - - update po files; add cz to catalogs. - - cpio_gzip: dup the fd before doing gzdopen (Thanks Erik!) - - add --noLang to skip non-default languages. - - writeRPM can now copy cpio archive from fd. - - preliminary macro environment as side effect of rpmrc parse. - - macro handling in rpmlib -- rework include: tag with macro expansion. - - first attempt at librpmbuild API. - - fixed lib/rpmrc.c to accept include: tags (AdV) - - fixed the CHANGES file to reflect that this is 2.9, not 3.0 (AdV) - - aggregate system includes into system.h. - - rearrange functions to minimize exported routines in librpmbuild API. - - generalize cpio I/O to eliminate pipe to exec'd gzip on install. - - add {init,add,expand}Macro args everywhere (new macro.c compatibility) - - add new fully recursive macro.c - - there must be a { between two % in a query format (unless %% is used) - -2.5.6 -> 2.5.7: - - permit 0x1b in specfile sanity check. - - increase timeout in tread from 5 to 30 secs for slow links. - - rename file before unlinking to avoid EBUSY failures. - - headerGetEntry now returns count=0 if tag not found (Chris Blizzard). - - resurrect osf1 as canonical os name (Time Mooney). - - sub-packages should inheirit Prefixes tag (Ian Mortimer). - - make '-' character illegal (again) in version/release. - - use portable #!/bin/sh (Tim Mooney). - - don't erase failing build script (Tim Mooney). - - use portable mkinstalldirs (Tim Mooney). - - irix6 autodeps were dup'd (Shing-Gene Yung ). - - getservbyname needed ntohs(). - - propagate "const char *" into rpmlib prototypes. - - use "original db-1.85" if available (Raw Hide glibc 2.1). - - make sure files to sign exist before asking for the pass phrase - -2.5.5 -> 2.5.6: - - ultrapenguin 1.1.9 sparc64 changes. - - attempt ftp ABOR on query/verify url's. - - cache open ftp control descriptor with password. - - verify needed same realpath semantics as query. - - plug fd leak in urlGetFile(). - - translate cpio errors using cpioStrerror. - - display "..?....." rather than "..5....." for unreadable files. - - run time (rather than compile time) host endian check. - - caldera patches (ray@Caldera.DE) - - added ARM patches. - - fix incorrect directory permissions using %attr/%defattr. - - permit "rpm -q --specfile ... file.spec" queries. - - strncasecmp on spec file separators (KDE has %Description). - - remove redundant md5 computation on uninstall. - - permit --rmsource --force even if sources/patches are missing. - - don't compute md5sum on non-file %config objects. (from Jos Vos) - - check arch only on RPMBUILD_{PREP,BUILD,INSTALL,PACKAGEBINARY}. - - configure.in: set default value for RPM. (Tim Mooney) - - add new Epoch: keyword just like Serial:. - - update Russian translation w man pages. - - solaris: don't attempt static link. (Tim Mooney) - - fix: timeCheck in rpm.c should be unsigned long. (Tim Mooney) - - osf: prov searches only shared libraries. (Tim Mooney) - - solaris: set PATH in prov/req scripts. (Tim Mooney) - - fix: ignore modes on symlinks. (Tim Mooney) - - sub-packages inherit RPMTAG_EPOCH (just like RPMTAG_VERSION/RELEASE). - - fix off-by-1 alloca that prevented relocating /. - - there must be a { between two % in a query format (unless %% is - used). - -2.5.4 -> 2.5.5: - - permit rpm to be built in a sub-directory (--srcdir=DIR). - - return CPIO_BAD_HEADER instead of exiting. (Scott M. Stone) - - untranslate "(none)" for auto relocating script wrappers. - - non-linux arch/os identification (Eugene Kanter). - - portable mode_t/pid_t typedefs. - - fix check for trailing / in Prefix: - - remove 2 character language name assumption. - - add /usr/lib/rpm/find-lang.sh (W. L. Estes ) - - miscellaneous portability cruft (Eugene Kanter). - - Makefile: don't use ln -sf. - - getOutputFrom(): fix race between last read on pipe and child death - (exacerbated in 2.5.4). - - rpm.spec: create /usr/src/redhat/* in %install. - -2.5.3 -> 2.5.4: - - expand args using popt on pre-rpmReadConfigFiles arg pass. - - skip arch checks if only packaging source rpm. - - add license field to rpmpopt -qi alias. - - provides/obsoletes requires tokens that begin with alnum or _. - - non-zero exit status for verify failures. - - hpux does setreuid differently (Hermann Lauer). - - check for setreuid portably (Eugene Kanter). - - add Serbian translation (Zoltan Csala ). - - arch/os tables were not being initialized for noarch builds. - - quote users/groups/filenames in --setugids. - - add Russian translation w man pages (Serguei Koubouchine ) - - fix virtual file attribute bug that skipped all files in binary rpm. - - eliminate infinite loop with missing tmpdir (Trent Jarvi). - - os_canon for CYGWIN32_NT/95. - - rationalize autoconf detection of gzip/bzip2. - - restore backward compatible rpmrc/rpmpopt symlinks. - - update pt_BR translations (Arnaldo Carvalho de Melo). - - permit --{buildroot,timecheck,test,sign} with -tX (Toshio Kuratomi). - - fix database rebuilds with triggers (Steve Sanberg). - - diagnostic message if unreadable/short source or patch file. - - eliminate redundant close in provide/require processing. - - solaris portability patch resurrection (Steve Sanberg). - - permit autogen.sh to work on non "prefix=/usr" hosts. - - add %license/%readme virtual file attributes. - - align "Build Host:" with other fields. - -2.5.2 -> 2.5.3: - - copy changelog tags to sub-packages just before packaging. - - added EPOCH handling to supplement serial numbers - - add RPMTAG_EPOCH and RPMTAG_CAPABILITY init to 0. - - fix infinite recursion on non-ERANGE return from getcwd() during - install (Matt Wilson). - - rm .depend for multiple builds in same tree (Will Partain) - - addFile: fix special case of "/" in %files. - - better query semantics with symlinks (Tim Mooney) - - build.c: fix incorrect check for successful open - - allow %define with leading whitespace - - use /usr/lib/rpm for rpmpopt, rpmrc, find-requires, find-provides - - added popt 'exec' functionality - - made --rebuilddb a bit more robust by checking data types - - added --freshen via popt exec stuff - - fixed spelling of expected - - updated de.po (Karl Eichwalder) - - do a better job of checking for a spec file in tarballs - (Pavel Roskin) - - fixed --triggers alias (Michael Andres) - - added :hex query format - - fixed --querytags to display virtual tags -????? - added --triggers and --triggered by to man page, help, and usage -????? - added support for epochs - -2.5.1 -> 2.5.2: - - added -bs to build just a source package - - included irix.req and irix.prov (Tim Mooney) - - copy CHANGELOG* and URL tags to all subpackages - - follow symlinks when packaging sources - - handle %files -f with no %setup (no build directory) - - fixed ugly i18n header bug - - deal with lang paths sanely when entries are missing languages - - fix bug packing /usr/doc when last file was %dir - - added --last alias - - fix :depflags query format - - Group: i18n (like Summary:) - - make --justdb install files in normal state - - %{fssizes} segv'd for packages with empty file lists - - updated HP-UX, OSF1, Irix 6.x dependency scripts (Tim Mooney) - - added arm and MachTen arch/os info - - added --filesbypkg query format - - updated README to have proper URLs - - updated rpm.spec for proper paths and cleanliness - - dependency resolution could hang when Provides: line is used in - rpmrc (Tim Mooney) - - updated mips rpmrc entries (Alex deVries) - - version/release conditional triggers weren't ignoring the trigger - package name at the front of the TRIGGERVERSION - - added --notriggers for -i and -e - - made --triggers a synonym for --triggerscripts - - ftp installs were trying to use /var/tmp/tmp - - allow whitespace in source/patch lines - -2.5 -> 2.5.1: - - fail if sources are not regular files - - wasn't catching readLine() errors - - fixed (hopefully) temp file creation problems - - make %doc obey --test - - unlink before writing .rpms - - librpm.c: added headerGzRead()/headerGzWrite() - - set bzip2path via lib-rpmrc/configure (Toshio Kuratomi) - - added finish translation (Raimo Koski) - - prefer db_185.h to db.h (Christopher Seawood) - - included updated hpux.req (Ralph Goers) - - added aix.req (Ralph Goers) - - updated hpux.prov, osf.req, osf.prov (Tim Mooney) - - set file states for --justdb packages to "not installed" - - handle missing file states properly in -e code - - install time wasn missing for --justdb packages - - missing parameter in an rpmError() caused segfault - -2.4.109 -> 2.5: - - fixed return code bug in build code - - do macro expansion before %if processing - - dep ordering returns w/ an error as soon as a prereq loop is found - - autoreqprov flag was being ignored during builds - - add autoreq: and autoprov: - - missed a few unlink() when scripts failed - - freePrefixes wasn't initialized in runScript() - - fix typo in %triggerpostun generation - - include icons in source packages - - headerGetEntry() should return count of 1 when returning - strings plucked from i18n strings - - do not remove comments in scripts - - save/restore existing arch when done with buildarch - - copy the I18N table to the source header so i18n stuff works - - fixed multiple memory leaks in install code - - fixed bug in part recognition - - shared files weren't being handled properly in net shared paths - -2.4.108 -> 2.4.109: - - remove icons with --rmsource - - do dependecy generation on -bl - - check files on all packages on -bl - - integrate Jeff Johnson's memleak patches - - added OSF1 autodep scripts - -2.4.107 -> 2.4.108: - - make --clean work with no %setup - - fixed FSSIZES problem introduced in 2.4.107 - - fixed search for find-requires.sh - - improved solaris autodeps scripts - - automated (somewhat) the -static flag - -2.4.106 -> 2.4.107: - - --nomd5 wasn't handled properly - - updated configure.in find-req and find-prov checks (Tim Mooney) - - make --rmsource actually work - - run postun triggers - -2.4.105 -> 2.4.106: - - build: only check for non-printables in first 128 chars - - added %triggerpostun - - linux.req generates deps for shared libs - - added a CC=@CC@ to popt/Makefile.in - - handle signed return types from poptGetNextOpt() properly - -2.4.104 -> 2.4.105: - - added langpatt: to rpmrc, and mark files with matches - - added some C++ cruft to rpmlib.h - - added find-requires and find-provides for hpux (Tim Mooney) - - respect LINGUAS when install package files - - added trigger support to build code - - got rid of annoying mwftw() type warning - - fixed many command line options which got broke by changes - for non-gcc compilers - - added trigger support in install code - - added doc/triggers - - strntoul() in lib/cpio.c was returning a pointer to freed - memory - - headerAppend() was doing a bad memcpy() - -2.4.103 -> 2.4.104: - - fixed popt/Makefile.in to use CPP from configure - - use tmppath from rpmrc to for ftp'd files (rather then /var/tmp) - - autoconf files and .depend files weren't created properly during - make archive - -2.4.102 -> 2.4.103: - - need to create popt/configure during make archive - - added comments about modifictation to base popt and rpmrc files - - allow spaces in group names - - fix bug in memory allocation of special doc stuff - - Jeff Johnson's mode/dev fixes - - clean up buildroot - - be more paranoid about making temp files - - added patches from Tim Mooney which let RPM build with non-gcc - compilers and non-GNU versions of make - -2.4.101 -> 2.4.102: - - fixed spelling of "instchangelog" in lib-rpmrc.in - - fixed memory leak in headerSprintf() extension cache - - fixed memory allocation for header formatting extension cache - - added support for INSTPREFIX virtual tag for backwards compatibility - - cpio error codes were poorly defined, causing bad error messages - - generates INSTPREFIXES tag properly, and sets RPM_INSTALL_PREFIX - and RPM_INSTALL_PREFIXn environment variables - - fixed memory leak in install code which occured when net shared paths - were used - - don't pass net shared path to rpmInstallPackage() -- it looks - directly in the rpmrc entries - - don't remove files in netsharedpath, even for files whose states - are not net shared - - changed --setugids to use separate chown and chgrp programs, for - better portability - - popt moved to autoconf - - Makefiles changed to allow building in a different directory then - the source code resides in - - finally fixed the Build Host spacing in rpmpopt - -2.4.100 -> 2.4.101: - - handle files with spaces (put double quotes around them) - - new rpmrc setting, buildshell, can be used to set shell - used for build scripts (default is /bin/sh) - - fix bug where macros were being improperly set for - Patch: and Source: lines - - may use "instchangelog" in rpmrc to limit the maxmium number of - changelog entries that are stored in the database for each package - (-1 means store all of them) - - default instchangelog is set to 5 - - headerRemoveEntry() didn't free the item's data -- this led to - a slight memory leak when installing packages - - implemented generic file relocations at install time - (use --relocate =, i.e. --relocate /usr=/foo) - - added --badreloc flag to force RPM to relocate files which packages - haven't advertised as relocatable - - fix return code on failed uncompresses in %prep - - preliminary handling of bzip2 compressed files - - differentiates between big and little endian mips - - added support for "prefixes:" tag - -2.4.99 -> 2.4.100: - - fixed handling of --rebuild and --recompile - - fixed rpmlibbuild.a typo in Makefile - - fixed handling of '\' in spec files (a specific case of a more - general bug) - - change use of "export" to work with non-bash shells - - compress the archives. oops. - - fixed bug when there is no %setup - - added -L$(topdir)/popt to Makefile.inc - -2.4.12 -> 2.4.99: - - added many more i18n strings - - merged in large rewrite of build code, which includes the following - changes: - - new option --rmsource - - all scripts can now take -p - - more strict about %package placement and use of main package - preamble - - %attr(mode, user, group [, dirmode]) - - %defattr() - - %defverify() - - Root: is depricated. Use BuildRoot: instead - - "nosrc" sources arn't deleted when sources are removed - - New tag DocDir: to set alternate doc dir (default is - /usr/doc) - - %doc should work as expected with buildroot, prefix, DocDir: - - all file processing is done before any packaging - - should work with modern patch programs (later than 2.1) - - %patch -z same as %patch -b - - %define only defines a macro if it starts a line - - script prog entries are now arrays (ie with arguments) - - standard macros: tag names, buildarch, buildos, buildarch_lc, - buildos_lc, PATCHn, SOURCEn, PATCHURLn, SOURCEURLn, sourcedir, - builddir, optflags - - deprecate require_distribution, require_icon, require_vendor - - add RPMTAG_FILEDEVICES and RPMTAG_FILEINODES to header - - export variables in scripts - - fixed tag:field bug - - %lang() in %files - - %description -l - - Summary(): - - fixed read_line() termination usage - - Makefile changes to shorten compiler lines - -2.4.11 -> 2.4.12: - - intialize reserved portion of lead when writing packages - - fixed error messages displayed when opening the database - fails during package installation and removal - - query format of the form '[A%{}]' would drop the static string - - fixed fix in 2.4.9 for empty packages which broke -qip on ftp URL's - - fixed arch/os numbers in lead - - added Turkish message catalog - - -e was running scripts even w/ --test was specified - -2.4.10 -> 2.4.11: - - HAVE_SYS_SOCKET_H was mistakingly MACHINE_SYS_SOCKET_H in - config.h.in - - \%description was trying to do %d expansion in query formats - - made %% work in query formats - - fixed bug in handling characters before array - - let mips build noarch packages - - --setperms would set wrong permissions in some cases (it was - following symlinks) - -2.4.9 -> 2.4.10: - - obsolete entries could cause segv's during upgrades - - sources now installed with uid/gid of process rather then - the ids used when the src rpm was created - - don't give an error if missingok files don't exist during remove - - touched ftp code to make it coexist w/ Red Hat install better - - use rand/srand rather then random/srandom - - don't build misc directory unless it's necessary - - empty package files should be treated the same as files - with bad magic, not as read errors - - fix bug where Prefix directory is included in file list - - sinix readdir() work-around - -2.4.8 -> 2.4.9: - - fix for verification on systems where a single group id - maps to mulitiple group names (Benedict Lofstedt) - - added 'make tar' rule for building a distribution tarball - (Horacio Rodriguez Montero) - - fixed serial number handling in dependencies and install - code - - make mips compatible with noarch - - fixed bug w/ printing string arrays in conditionals - - handle modern patch programs (> 2.1) - - handle packages w/ duplicate dependency names - - --noscripts didn't get handled properly for removed packages - - fixed handling of packages where %prereq creates users/groups - -2.4.7 -> 2.4.8: - - added noarch build compatibilities for ppc, m68k - - fixed some minor typos (Florian La Roche) - - added Obsoletes: tag, an upgrade removes packages which - have been obsoleted - - updated rpmdepUpgradePackage() to deal with obsoletes tag - - convertdb needed to read rpmrc - - fixed ugly bug in package ordering - - archivesize tag was incorrect for packages with hard links - - moved popt into a separate library - - directory created with %doc is now name-version (dropped - the release) - - added buildarch/buildos macros - - added %ghost file option - - updated linux.req to only find requirements for exectuable files - -2.4.6 -> 2.4.7: - - had some wrong month lengths in changelog date parsing - - updated fine-requires (Linux version) to add lines for shell - scripts (Donnie Barnes) - - didn't package / properly - - pre/post script processing had some erroneous free() calls - - fixed typos for HP archs in lib/rpmrc.c - - uname() results should go through *_canon tables before anything - else happens - - set -x in debug shells, not -xs - -2.4.5 -> 2.4.6: - - added os_canon entries for BSD/OS and NextStep - - replaced include of with includes of - - fixed md5sum of source packages w/ a buildroot is used - - fixed bugs installing version 1 packages - - remove hyphens from uname() result (specifically for HP-UX) - - hacks to recognize architecture under parisc - - RPM_INSTALL_PREFIX wasn't being set properly (this should be - fixed now) - - replaced temporary file creation to be race-condition safe - - prerequisites may not specify versions - -2.4.4 -> 2.4.5: - - call getpwnam()/endpwent() once before a chroot(), forcing name - service shared libs to be loaded from outside of the root path - - added vesrion stamp to lib/misc.o (and librpm.a by extension) - - fixed config.sub, config.guess to recognize i686 - - ARCHIVESIZE tag didn't get filled in properly, breaking progress - meters - -2.4.3 -> 2.4.4: - - restore working directory after installing a package w/ a chroot - - dump the package stack when a dependency loop is encountered - - when a user/group lookup fails, end*ent() and retry - - fixed broken --scripts argument (it was --s2) - - only display the packager and url in -qi output if they have defined - values - - print "(not installed)" as the install time for -p queries rather - then "not a number" - - almost completely rewrote rcfile parsing; I'm sure this will - break things eventually but it's much more flexible now - - added buildarch/buildos compatibility tables, listed values - in --showrc - - added cpio archive building code; GNU cpio is no longer used! - packages created w/ rpm 2.4.4 and later cannot be installed with - rpm 2.4 - rpm 2.4.3 however (version of RPM before 2.4 will - work fine, however). An "error -2 reading header" happens when - this is attempted - - removed cpiobin from rpmrc - - added rpmrc "provides" tag to allow easy fulfillment of - automatically generated dependencies - - look for random() in libm if it can't be found be default - - fixed problems in Solaris's autodeps stuff (Eric Mumpower) - - --setperms should work properly on directories now - - --justdb on install, upgrade, and erasure causes a database - update w/o the filesystem being touched - - fixed version comparison of a package w/ a serial tag against - a package w/o one - - added BuildArchitectures: tag to spec file to enable builds - for alternate/multiple architectures - - look for random() in -lucb - - changed the licensing terms for librpm to allow redistribution - under the LGPL - - applied man page changes from Alex deVries - - configure.in builds up LIBS by appending (Benedict Lofstedt) - - rpm2cpio reported wrong zlib error string - - removed \n from (none) generated by query format code - - queries of fssizes w/o fsnames didn't work (Till Bubeck) - - added --noorder option to skip package reordering (Elliot Lee) - -2.4.2 -> 2.4.3: - - implemented install time prerequisites - - repaired %{#TAG} query format - - implemented ternary operator as query expression - - fixed --scripts to only print information on scripts which - are present - - check symlink() return for < 0, not != 0 (Bob Tanner) - - uses chroot() for installs --root option - - archive expansion doesn't create new devices or symlinks when - the proper files already exist - - added -p to %post (etc) to specify the program which a script - is run through - - if -p is used w/ an empty script, the specified program is - executed directly - - the -p argument (or /bin/sh) is automaticall added as a prereq - -2.4.1 -> 2.4.2: - - completely rewrote queryformat code - - added fsnames, fssizes virtual query tags - - added rpmdbFindByHeader() and rpmdbFindByTag() public functions - - added rpmfilename tag to rpmrc to define the filename format to - use for binary packages (note the rpmdir is prepended to it) - - used pclose() instead of fclose() in -t code - - updated man pages - - changed "struct rpmdb" to "struct rpmdb_s" for C++ - - netsharedpath entries shouldn't match partial directory names - anymore (a nersharedpath of /usr/lib shouldn't affect /usr/libexec) - - don't backup config files on netsharedpaths (take 2) - - added "day" query format which is like date, but doesn't print - any time - - added --changelog alias to query a packages changelog entry - - added mntctl() support for AIX (I think, I can't test this) - - fflags query type displays 's' for specfiles, 'm' for missingok - files, and 'n' for noreplace files - - implemented %config(missingok) flag in install - - added --allfiles flag for -i and -U, which forces all files (even - missingok files) to be installed - - implemented %config(noreplace) for the install, but it hasn't - been tested in any way - - added i18n support to headers - - added ppc/rs6000 differntiation for AIX - - all IP* from uname() is changed to just IP - - IP is considered the same as mips (not sgi) - - added IRIX64 OS, it's compatible w/ IRIX - -2.4 -> 2.4.1: - - take advantage of lchown() if it's available - - fixed configure script to assume chown() doesn't follow symlinks - if lchown() isn't available and configure is not being run as root - - more header file changes for AIX - - added :shescape query format type for strings, which prints strings - which will survive a single level of shell expansion - - fixed --setperms and --setugids to handle empty packages and - packages with odd filenames - - include before - - include "miscfn.h" first in every file which needs it - - created noarch architecture which everything is compatible with - - fixed group verification (Benedict Lofstedt) - - don't backup config files on netsharedpaths - - added info on --build{arch|os} to --help and usage messages - -2.3.11 -> 2.4: - - changed RPMNLSDIR directories to and @datadir@ to better - conform with autoconf - - set RPM_INSTALL_PREFIX environment variable when running - verify scripts - - beginnings of SCO support (though I suspect it will take one - or two more iterations to get it right) - - switched to CVS and updated some Makefile rules - - look for gethostbyname() instead of gethostname() in -nsl - (this could break some things) - - added check for strcasecmp() in -lucb on systems which don't - have strcasecmp() in libc - - don't build -static on hpux10 - - don't try and NLS empty strings - - changed index() call to strchr() in macro code - - include in build/spec.c for various platforms - - added update-po rule to po/Makefile.in - - updated de.po (thanks to Karl Eichwalder) - - rpmFindByFile() removes trailing and duplicate /'s - - made many string in rpm program (though not yet in the various - libraries) translatable - - eight character user names could break -qlv - - requirements which begin with a leading / require files (in - the database!) instead of packages - - clean up conflictsindex during --rebuilddb - - get path to gzip from /usr/lib/rpmrc rather then just hoping it's - in the path - - use dbpath for error messages with include database path in - their text - - don't set owner/group if binaries installed by "make install" - - include on SCO - - don't use cpio when installing packages - - fixed bug which affected dependencies on the Alpha - - made '=' work for long arguments (the switch to popt broke this) - - handle solaris systems better - - complain if critical rpmrc variables (cpiobin, gzipbin, etc) aren't - set anywhere - - allow --dbpath for --rebuilddb - - added check for systems whose chown() follows symlinks. If configure - is run as root, this should get it right, otherwise it assumes - chown() does not follow symlinks. You can use --enable-broken-chown - to force configure to think chown does indeed follow symlinks. - - if chown() follows symlinks, we don't chown() symlinks during cpio - unpacking and we don't verify the owner or group of symlinks - - added packager and url to default -qi output - - look for and use it if it's there (for AIX) - -2.3.10 -> 2.3.11: - - fixed newlines in --scripts output - - fix handling of source files with bad owners/groups - -2.3.9 -> 2.3.10: - - --allmatches handling in -e broke some cases - - new predefined macros: %SOURCEn %PATCHn %SOURCEURLn %PATCHURLn - - fix anomoly with %files -f and %doc - - ignore config bit when it's set on directories (which allows - users to replace directories with symlinks) - - don't set config bit on directories - - strip trailing slashes from files (during build) - - %tags are now case sensitive (macros too) - -2.3.8 -> 2.3.9: - - reworked %setup to allow multiple -a and -b options, which - should noticeably ease the task of unapcking multiple tar files - - md5 sum's were calculated incorrectly on big endian machines - from 2.3.2 through 2.3.8 -- this was fixed and some hacks were - done to keep verification working - - updated README - - added --allmatches to allow erasing multiple versions/releases - of a package - - changed ftp URL's to use \r\n, not just \n (this should let RPM - work w/ some picky (but rfc compliant) ftp servers - - fix problem where parts at end of spec file were dropped - - added %config(noreplace missingok) (build-side) - - simple spec file macros - - should now process entire file list before failing - -2.3.7 -> 2.3.8: - - added -t? options to build packages from tarballs which contain - .spec files instead of from the .spec files directly - - fixed error in man page where ftp URLs are discussed - - don't strlen(NULL) in headerAddEntry() - - minor portability changes - - stopped building oldrpmdb.c as part of rpmlib - - added Makefile rule for building rpmconvert (which is almost - never needed) -- this isolated gdbm dependence to this target - - fixed checking of popt stack overflow - - --requires shouldn't imply -q - - fixed error message issued when a groupname does not exist - - fixed but in changelog processing which made it hang on '*' in a - changelog entry - - generate S_ISSOCK and S_ISLNK macros on systems w/o them - - "rpm --erase" wasn't returning proper error codes w/ package - removal failed - -2.3.6 -> 2.3.7: - - fixed nasty memory link in -Va - - configure checks for -lnsl explicitly rather then linking it - to -lsocket (for NCR SysVR4) - - configure checks for dirent.h - - modified glob.c to include config.h and use HAVE_DIRENT_H - - cleanup of LIBS/LIBPATH mess a bit more - -2.3.5 -> 2.3.6: - - -Vf uses realpath() now - - -Vp lets you use --ftpproxy, --ftpport - - changed popt format, breaking all popt alises :-( - - added ability to alias character arguments to popt - - moved --requires, --info to /usr/lib/rpmpopt - - RPM is more forgiving of blank user names (dumb) - - popt searches for aliases in the correct order now - - cleanup query code to handle missing uid lists better - - cleanup up configure.in a tad - -2.3.4 -> 2.3.5: - - %{#TAG} in query format prints the array length - - cleanup up protoypes in rpmlib.h - - let -Vp work on URLs - - don't set umask(0) anymore -- that confused programs which - link against rpmlib quite badly - - moved print out in "rpm -v -i" to occur after any warnings - to pretty up the output a bit - - added default optflags for powerpc - - run shell for post/pre scripts in debug mode with -sx for - some silly shells - - installing source packages with --root checked for the - sources/specs directory to exist outside of the root -- fixed - - modified toplevel Makefile to run dependency generation only - against referenced sources - - array size mismatches in --qf should send error to stderr - - tried to make the locale stuff a bit more portable (again) - - reworked the owner/group setting on installs to be more generic - (in preperation for getting rid of cpio) - - made verify verify owner and groups by name rather then by id -- if - the symbolic names aren't available use the uids - - cleaned up relocateFilelist() and related code thanks to - new header introduced in 2.3.3 -- this could break relocatable - packages but they seem okay - - fixed a bug which could cause relocatable packages to not get - relocated -- I think this bit some people during hard drive - installs of all things (Jason Salopek pestered me consistently - enough to keep this on the front burner for me) - - removed FILEUIDS and FILEGIDS from the header in the database -- - we never used it and it jsut wasted room - - convert uid/gid lists in v1 headers to symbolic names - -2.3.3 -> 2.3.4: - - %changelog processing - - fixed broken requires/conflicts parsing for spec file - - vastly improved --rebuilddb's robustness - - fixed misplaced free() (only affected inconsistent databases) - - added conflicts documentation to docs/dependencies - - using multiple query formats has them all concatenated - - removed stdin based query and verify selectors - - installs rpmpopt in libdir - - moved --provides and --scripts to rpmpopt - - added --setperms, --setugids - - incorporated newer de.po from Karsten Weiss - - --resign/--addsign was broken in 2.3.3 from popt conversion - -2.3.2 -> 2.3.3: - - Ripped out header internals and redid them. Any compatibility - problems this causes are *bugs* as it should be completley - transparent. If this works the devil better buy some Prestone (TM). - - Use "cp -pr" instead of "cp -ar" for %doc expansion - - use instead of (non standard) in some places - - look for non-POSIX (broken) chmod - - include local copies of glob/fnmatch - - removed getopt() check from configure.in - - fixed bug in ftp code which prevented proper logins to some sites - - switched to popt from getopt, which allows command line aliasing - - read initial aliases from /usr/lib/rpmpopt then /etc/popt and - $HOME/.popt - - cleanup up rdev verification (only verifies device files, checks - device related mode bits as well) - - fixed allocation of temporary paths (Eugene Kanter noticed this) - - made tools/dumpdb read the rpmrc so it can find the database - - added --nomd5 for -V and -K - - don't assume mkdir -p will succeed if the dir exists - - use RPMNLS* defines to avoid header file conflicts - - bunch of minor cleanups to avoid warnings on other OS's - -2.3.1 -> 2.3.2: - - fixed bug in new rpmVersionCompare() which made it worse then - useless (thanks to Norbert Kiesel) - - fixed silly message - -2.3 -> 2.3.1: - - changed --help routing to have intelligent line wrapping - to make i18n efforts easier - - NLSDIR should be used for nls catalogs, not a hardcoded path - - NLSDIR should be in share, not lib - - renamed sweedish catalog from se to sv - - added german catalog - - treat RPM_CHAR_TYPE as RPM_INT8_TYPE for queries - - made rpmEnsureOlder() internal to lib/install.c - - added rpmVersionCompare() to compare version/release/serial numbers - for packages -- returns like strcmp() - - stdout/stderr were getting closed after running a verify script - - relocting packages didn't work w/ the packages contained the - directory which was it's prefix - -2.2.11 -> 2.3: - - replaced putenv/setenv which calls which malloc() buffer -- these - are memory leaks, but the functions are only used between a fork() - and exec() so it doesn't matter - - created directroies are stamped with mtime from the file list - -2.2.10 -> 2.2.11: - - fixed some include file problems for FreeBSD - - fixed find-provides script for Linux (silly typo) - - -qvl didn't print out sticky bit - - linux.prov won't print provides info for symlinks which point - to libraries w/ proper sonames - -2.2.9 -> 2.2.10: - - changed how installArchive() handles running out of gzread() - bytes while the child is still alive - - changed tag for Alpha's to "alpha" from "axp" - - made ./configure look for --quiet support in cpio - - netsharedPath's were having mkdir()'s done on them and had - bad interactions with rooted directories - - made -qp accept '-' to query the package on stdin - - dependency checking was broken when no database was being used - - don't *ever* let cpio make directories -- we do a better job - (esp because we don't kill symlinks!) - - plugged memory leaks in upgrade (again thanks to mpr) -- install, - erase, upgrade, query, and verify all seem to be leakproof - - use select() rather than busy waiting in cpio_gzip() - - use half as much temp space during package assembly - - fail if spec file check fails - - changed canonical name for 68k to m68k (sorry) - - integrated FreeBSD changes from Jared Mauch - - integrated Irix changes from Hermann Lauer - - i18n support can be disabled w/ configure by --disable-nls - (thanks to Remy Card) - - integrated more AmigaOS patches, played with configure some - more to allow cross compiling (Kristof Depraetere) - - cleanups to rpm2cpio (closing the gz stream) (Elliot Lee) - - made find-provides return filename for libs w/ no soname - -2.2.8 -> 2.2.9: - - fixed typo in default rpmrc - - made getBooleanVar() a bit better - - added triggers to package builds - - tagged spec file in source package file list - - added %verifyscript (controlled by --noscript, -v flags) - - changed pkgReadHeader() mechanism to be more generic - - added find-provides for Solaris, made find-provides setup - more generic (w/ configure.in picking the right one) - - fix -Q - - The Great Renaming - - use external OS specific script to generate requires lines - (should work with ld.so 1.8.x) (find-requries) - -2.2.7 -> 2.2.8: - - added --ftpproxy, --ftpport (and wrote about them in rpm.8) - - added --nodeps to man page - - added --showrc to man page - - added conflict checking (use conflicts tag, which looks - just like the requires tag) - - fixed RPM's return code when package removal fails - - cleaned up lib/install.c a bit for readability - - plugged a bunch of memory leaks thanks to mpr -- install, - uninstall, verify, and query all seem clean now - - added support for trees shared over a network via netsharedpath - in rpmrc - - don't exit when there is an unknown option in an rpmrc, just - give an error and continue - - tried once again to get things working properly with 2.1's - write behavior - - added -E option for %patch - - added UltraSPARC support to lib-rpmrc - - moved default topdir and optflags settings to lib-rpmrc from - /etc/rpmrc - - removed /etc/rpmrc from standard distribution - - use separate chgrp/chown commands in %setup macro - - kill(2) arguments were backwards in lib/install.c - - fileFile logging needed stdio to handle NULL args to %s - - default docdir (for %doc macro) set in lib-rpmrc rather then - hardcoded - - removed some of the \n from args to error() [though many are - still left] - - uninstall should fail if the preuninstall script fails - - --root works with --initdb now - -2.2.6 -> 2.2.7: - - applied lots of portability patches - - builds on Solaris machines now! - - will build w/o i18n support if GNU gettext isn't installed - - added inet_aton, setenv functions for libmisc - - added Sun4c, Sun4m architectures - - use vfork() if fork() doesn't exist (for AmigaOS) - - look for GNU cpio, complain if it doesn't exist at build time - - put path for GNU cpio in /usr/lib/librpmrc - - install rpm.shared if rpm wasn't built (for Solaris) - - readHeader() in librpm.a should work on sockets (which may - return partial reads) - - package file query (-q -p) accepts ftp:// style URL's - - if gzread returns 0 bytes (at EOF), don't call write w/ 0 byte - argument as it's behviour isn't portable - - fixed -Vp behavior (doesn't seg fault w/ packages have dependencies) - -2.2.5 -> 2.2.6: - - added --rebuilddb to rebuild database, updated man page - - fix fd leak in md5sum - - fixed group cache bug - -2.2.4 -> 2.2.5: - - if rename() for moving .spec file from SOURCES to SPECS fails, - try copying it instead - - -h and -v work for source package >= V2 - - -h output is much smoother now - - new AutoReqProv: tag in spec file can disable automatic - require/provide generation - - fixed md5sum problem on big endian machines in a way that's - mostly backwards compatible; this hack will be removed someday - - added :fflags tag - - fixed a couple of minor memory leaks in lib/install.c - - --test for building - -2.2.3 -> 2.2.4: - - only remove docdir if %doc occurs - - allow -R to %patch - - moved to use GNU autoconf, though it probably isn't perfect yet - (thanks Kristof Depraetere) - - spec file sanity: no - chars in version or release, - must be a regular file :-) - - version specifications for requirements can use "-" - - default lib path, tmp path, topdir, and /usr/lib/rpmrc get set - by configure script relative to --prefix - -2.2.2 -> 2.2.3: - - fixed script file md5 checking when files are in a root - - implemented proper strdup/free logic for dependency conflict - lists - - strip leading directories from ldd output - - fix non-null-terminated readlink() result - - fixed sscanf() in ftp code to use proper types - -2.2.1 -> 2.2.2: - - added functionality to rpmlib to suggest resolutions for - dependency problems - - fix stupid allocation problem in exclude/exclusive stuff - - fix nasty bug where pointers in to the header were getting - stale after some realloc()s in addEntry() - - ignore OS tag for v2 packages -- it was wrong anyway - - match shared libs on ".so" rather than ".so." - - skip blanks from objdump for auto-provide - - if objdump gets us _end, provide the file name - - do not ldd non-regular files - - do not pass leading "/" to ldd - - fix ExcludeOs: and ExclusiveOs: - - -V verifies dependencies, can be controlled with --nodeps - and --nofiles - - added information on --nodeps to usage messages - - implement --timecheck and rpmrc timecheck: - - implement -bl - - catch duplicate files in file lists - - some random sanity checking on the file list - -2.2 -> 2.2.1: - - made rpmRemovePackage() print message in verbose mode - - added support for ftp://user:pass@machine.org/ URL's - during installation - the password will be prompted for - if only the user is given, and anonymous ftp will be used - it both user and password are omitted (as before) - - Remove Exclusive: Exclude: - Replace with: ExclusiveArch: ExclusiveOs: - ExcludeArch: ExcludeOs: - - fixed dependency cheking for packages that are installed - at the same time - - fixed version number dependency checking - - fixed problem installing v1 source packages (thanks to - Nikita Borisov) - - fixed minor spelling/spacing problems (Nikita Borisov) - - assume all v1 packages were made for Linux so OS check works - - began to implement proxyftp, though it doesn't work yet - - fixed spacing when reporting dependency conflicts - - fixed bug where a long name (uname()) was mapping to itself - -2.1.2 -> 2.2: - - don't fail, and do report, if -K can't find a PGP key - - handle file names with quotes and spaces when passed to ldd - (still can't have spaces in %files) - - do not allow Buildprefix: in sub packages - - removed require_group from rpmrc -- groups are always required - - removed arch_sensitive from rpmrc -- always on - - removed docdir from rpmrc -- always /usr/doc - - fixed nasty bug in installing packages with large filelists - - made -R work - - --provides and --requries don't print anything if no information - is present (rather then (none) ) - - -qi prints Summary now - - changed Buildprefix: -> Buildroot: (spec file, rpmrc) - --buildprefix -> --buildroot (command line) - RPM_BUILD_PREFIX -> RPM_BUILD_ROOT - (%prep, %build, %install, %clean) - sorry :-) - - allow Prefix: for sub-packages - - allow packager: in rpmrc - - --arch and --os are now --buildarch and --buildos - - magic arch/os handling through arch_canon and os_canon - see /usr/lib/rpmrc (in short: uname short_name num) - - removed build_arch: from rpmrc - Replacing it is buildarchtranslate: and buildostranslate: - to allow building with arch/os other than what uname() returns. - Can still be overriden with --buildarch and --buildos - - rpmrc keywords are now case-insensitive - - check os at install time - - check return code from gzread() during installs - - implemented os_compat - - added arch_compat and os_compat information to --showrc (the - changes needed to do this removed any lingering questions about - the efficiency of the compat lookups for large tables or tables - with loops -- it should all work fine) - - made -u (--uninstall) exit with an error and not do anything - - added --ignoreos - - fixed error message given when a file is missing - - fixed hashing when multiple packages are being modified - - changed man page for readability (thanks to Joseph L. Hartmann, Jr) - -2.1.1 -> 2.1.2: - - fixed error message for unrelocatable packages - - automatic shared lib provides now work with buildprefix - - fixed dependency checking during upgrades to work if the - package wasn't previously installed - - clean up temp file after signature check - - dependencies weren't looking through packages that were - being installed at the same time quite right - -2.1 -> 2.1.1: - - fixed -qi query format - -2.0.11 -> 2.1: - - added --requires, --whatrequires, --provides and - --whatprovides queries - - using a string array tag in a queryformat results in every - item in the string being printed out with spaces in between - (though this behaviour will probably go away shortly) - - all packages are ftp'd before any are installed (required to - do proper dependency checking) - - if only source packages are being installed, the database is - never opened - - automatic shared library require/provides tags generated - - added --nodeps flag for install and uninstall - - added dependency checking for installs and uninstalls - - misc fixes to compile with glibc - - use PGPPATH if set (and no pgp_path: in rpmrc) - - remove pgp_pubring, pgp_secring stuff - - new extensible signature - - signature section supports multiple signatures - - --addsign to add a signature to a package - - PGP key no longer limited to 1024 bits - - always do at least an MD5 "signature" - as a result, -K will always tell you something - - signatures now include a simple "header+archive size" check - just calling readSignature() checks this - - --nopgp (with -K) to skip PGP check, just do MD5 - - allow '#' comments in preamble and %files section - - fixed -qsv to print both the states and the file information - - added --dump option to query to print all file attributes - - installs with --root use the /etc/passwd and /etc/group from - the target directory - - added --initdb to aid in database initialization - - --queryformat can print items of type INT8 - - "sourceless" packages with nosource: and nopatch: - - [] now allows interation through query formats - - '-' flag for query tags removed - - :date and :perms supported as query format specifiers - - new rpmrc entries "arch" and "os" to override - - --arch and --os on the command line to override - - arch and os are now strings in the package header - - added arch_compat handling in /etc/rpmrc - - added build_arch to /etc/rpmrc - - support arch as string - - added --ignorearch option - - Prefix: in spec file to specify default installation prefix - - rpmrc and command line may be used to override the path - used for the rpm database - - relocatable packages get installed properly - - added support for --prefix and RPM_INSTALL_PREFIX environemtn - variable - - added dependency checking for version numbers - - added correct dependency checking for upgrades - - added :depflags query format flag - - changes --provides, --requires, and --scripts queries to use - queryFormats - -2.0.10 -> 2.0.11: - - fixed chmod(symlink) bug (since 2.0.9) - -2.0.9 -> 2.0.10: - - fixed the fix to rpm -q bug - to query by number you now need --querybynumber - - made arch_sensitive on by default - - handle # comments in preamble - - don't barf if we can't canonicalize the hostname during builds - - fixed --verify with --root - -2.0.8 -> 2.0.9: - - %files -f - - prelim Require/Provide handling - - prelim strict checking of spec file - - removed some bash-isms - - fixed globbing/root bug - - fixed rpm -q bug - - fixed ftw() related bug where symlinks were being - followed in %files rather than just being noted!! - - pass "upgrade" arg to pre/post scripts when upgrading - - use PATH to find cpio when installing - - fixed rpm.magic, added sun4, mips, 68k, sgi, sunos, solaris - - added %attr(mode owner group) feature to file list - - fixed dumb %verify() parse bug - -2.0.7 -> 2.0.8: - - explicitly turn off ASCII armor when running PGP - - fixed --noscripts logic, which was on by default and - off if you specified it! - - uses a temp file to pass filenames to cpio in case when - their are more then 500 filenames in a package - - added --rcfile - - fixed problem with $HOME/.rcfile not being read - - undocumented --search, --where, --keep-temps which - will probably won't be implemented in RPM 2.x anyway - -2.0.6 -> 2.0.7: - - builds now set umask 022 for all scripts - - queries relative paths correctly (thanks to Johnie Stafford) - - fixed error codes for failed installs - - don't add NULL entry to group index for packages that don't - have group information, add it to the "Unknown" group instead - - added --scripts query option - - added --noscripts for installing and uninstall without using - the pre/post scripts - - "rpm -qd" and "rpm -qc" work properly now (they didn't imply - -l before) - -2.0.5 -> 2.0.6: - - internal changes to error messages - -2.0.4 -> 2.0.5: - - added support for generic querying - - added --querytags option - - updated man page for above two - - short-circuit got added before 2.0.5, but I don't know when - - query and installs should now return 0 on success and nonzero - otherwise (rpm -i should return the number of packages that - failed actually) - - made rpm -qa fail if extra arguments are passed to it - -2.0.3 -> 2.0.4: - - added support for PowerPC, and OSF mklinux ports - - added --resign - - added --recompile - - added verbose error messages from Tyson Sawyer - - rpmconvert won't overwrite an existing database - - won't core dump querying old format source packages - - freed minor memory leak - - more descriptive error messages during build - - added support for not installing documentation - -2.0.2 -> 2.0.3: - - added support for 686, 786, 886, 986 - -2.0.1 -> 2.0.2: - - fixed ftp.c to return an error code when select timeouts - - added basic NLS support, along with a Sweedish message catalog - (thanks to Michael Nyquist) - -2.0 -> 2.0.1: - - hashing and percentages no longer SIGFPE on 0 byte packages - - when an ftp fails, install.c no longer tries to install the package - - uses /var/tmp rather then /usr/tmp during for ftp space - - added debugging messages to ftp.c - - fixed some mistakes in the PGP section of the man page - - added mdfile prototype to rpmlib.h - the Python module wants this - - fixed struct oldrpmlead to align properly on the alpha - -2.0 - everything done :-) - -2.0b -> 2.0c: - - an incredible number of changes - I won't bother trying to - list them - -2.0a -> 2.0b: - - moved build stuff to main rpm command, though --rebuild is still - not supported - - install should work, although replaced files are not marked as - replaced - - %doc macro fixed - - --percent, --hash work for installs - - converted databases and packages get the file list in the correct - order now - - none of this is well tested - - rpms are output to proper dirs (which are always arch sensitive) - - basic rpmrc functions are implemented, full parsing is present - - changed error messages for missing files to include full path - - fixed detection of Alpha's - -1.4.6 -> 2.0a: - - completely rewritten in C - - verification missing - - build functionality not in main rpm, in rpmbuild instead - (this will be corrected) - - an awful lot is still missing - this is an ALPHA release - -1.4.5 -> 1.4.6: - - fixed rpmq problem with packages w/o groups (old RPM's would do this) - - fixed uninstalling with --root - -1.4.4 -> 1.4.5: - - added support for mips processors - - added support for osf1 and irix os's - -1.4.3 -> 1.4.4: - - fixed bug in arch detection code which caused i386 failure - -1.4.2 -> 1.4.3: - - added tokens for SPARC, MIPS, PowerPC, and 680x0 architectures - - fixed sparc arch, added arch sanity check - -1.4.1 -> 1.4.2: - - added --root to man page, usage, and help messages - - added a " " to the "Creating directory" debug message in install.pl - - make --rebuild fail on binary packages - - don't output prep/build/install sections if there aren't any - -1.4 -> 1.4.1: - - fixed man page - - updated corruption messages to not mention --rebuild - - added RPM_PACKAGE_VERSION and RPM_PACKAGE_RELEASE variables - at build time - - no longer allows installing binary packages across architectures - - fixed handling of symlinks marked as config files - -1.3.2 -> 1.4: - - make -v the default when using -b and --rebuild - - added %postbuild as an alias for %clean - - added gendiff - - added groups file installed in /usr/lib/rhs/rpm - - made usage message different and more concise then the --help message - - added --version option - - updated man page - - changed C build tree for concurrent building on multiple architectures - -1.3.1 -> 1.3.2: - - add -b option to %patch - - fixed install/chroot temp file deleting - -1.3 -> 1.3.1: - - fixed bug when doing md5 of erased config file during rpm -u - - fixed spec file searching - -1.2 -> 1.3: - - added --search and --where options - - multiarchitecture support - - added --rebuild option - - started C rewrite - rpmq (query options only) - -1.1 -> 1.2: - - preuninstalls weren't getting handled properly - - Alpha architecture is now recognized and builds are allowed - - the database open is checked for success before continuing - - rpm -b? checks the SPEC files for package names given as args diff --git a/COPYING b/COPYING index 3ffa0ab..57b3f12 100644 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -RPM and it's source code are covered under two separate licenses. +RPM is covered under two separate licenses. The entire code base may be distributed under the terms of the GNU General Public License (GPL), which appears immediately below. Alternatively, @@ -8,7 +8,7 @@ distributed under the GNU Library General Public License (LGPL), at the choice of the distributor. The complete text of the LGPL appears at the bottom of this file. -This alternatively is allowed to enable applications to be linked against +This alternative is provided to enable applications to be linked against the RPM library (commonly called librpm) without forcing such applications to be distributed under the GPL. diff --git a/CREDITS b/CREDITS index 97779b3..ea30c10 100644 --- a/CREDITS +++ b/CREDITS @@ -1,39 +1,162 @@ -Work on RPM was done primarily by: +Initial work on RPM was done primarily by: - Erik Troan Marc Ewing + Erik Troan -Significant code, ideas, or porting help have been contributed by: +Over the years, code, documentation, ideas, porting help, tests etc +have been contributed by: + Tero Aho Stuart Anderson Ed Bailey Donnie Barnes + Stefan Berger + Eric W. Biederman + Anders F Bjorklund + Frederic Bonnard Nikita Borisov + Pádraig Brady + Tony Breeds Till Bubeck + Héctor Daniel Cabrera + Davide Cavalca + Yuri Chornoivan + Michal Čihař + Archie Cobbs + Ralf Corsépius Kit Cosper + Rafal Cygnarowski + Jean Delvare Kristof Depraetere Alex deVries + Johannes Dewender + Michal Domonkos + Piotr Drąg + Boris Egorov Karl Eichwalder + Peter Eisentraut + W. L. Estes + Giulio Eulisse + Christophe Fergeau + Florian Festi + Jakub Filak + Brian Elliott Finley Fred Fish + Nikola Forró + Gleb Fotengauer-Malinovskiy David Fox - Joseph L. Hartmann, Jr + Artur Frysiak + Stephen Gallagher + Rafael Garcia-Suarez + Alexey Gladkov + Igor Gnatenko + Neal Gompa + Guido Grazioli + David Greaves + Aron Griffis + Fionnuala Gunter + Anssi Hannula + Richard Hughes + Tom Hughes + Thomas Jarosch + Zbigniew Jędrzejewski-Szmek + Jakub Jelinek Jeff Johnson Michael K. Johnson + Tadashi Jokagi + Peter Jones + Richard W.M. Jones + Guillem Jover + Joseph L. Hartmann, Jr + Juha Kallioinen + Alexandr D. Kanevskiy Eugene Kanter + Lubos Kardos + Per Øyvind Karlsen + Jiri Kastner + Peter Kjellerstedt + Phil Knirsch + Michal Kochanowicz + Ales Kozumplik + Jan Kratochvil Toshio Kuratomi + Tim Landscheidt Hermann Lauer + Steve Lawrence + Alec Leamas + Dimitri John Ledkov Elliot Lee + Robin Lee + Simon Lees + Dominique Leuenberger Benedict Lofstedt + Till Maas + David Malcolm + Michal Marek + Panu Matilainen Jared Mauch + Roland McGrath + Kyle McMartin + Joshua Megerman Nigel Metheringham + Arkadiusz Miśkiewicz + Tomas Mlcoch Horacio Rodriguez Montero Tim Mooney + David Martínez Moreno Eric Mumpower + Paul Nasrat + Gustavo Niemeyer + Jindrich Novy Michael Nyquisk + Stanislav Ochotnicky + Denis Ollier + Vít Ondruch + Tomas Orsava + Rakesh Pandit + Thomas Petazzoni + Jan Pokorný + Trần Ngọc Quân + Jerome Quelin + Pavel Raiskup + Elena Reshetova + Sebastian Riedel + Lubomir Rintel + Pavol Rusnak + Kamil Rytarowski + Mark Salter Steve Sanbeg Tyson Sawyer + Andreas Scherer + Michal Schmidt + Michael Schroeder + Andreas Schwab Christopher Seawood + Misha Shnurapet + Kirill A. Shutemov + Jan Silhan + Taylon Silmer + Mukund Sivaraman + Ville Skyttä + Jeff Smith Johnie Stafford - Gary Thomas + Hajime Taira Bob Tanner + Pascal Terjan + Gary Thomas + Jeff Tickle + Michal Toman + Alexey Tourbin + Tom Tromey + Chip Turner + Vincent Untz + Pavlina Varekova + Nicolas Vigier + Thierry Vignaud + Jonathan Wakely + Colin Walters + Florian Weimer Karsten Weiss + Bernhard M. Wiedemann + Mark Wielaard + Mimi Zohar diff --git a/INSTALL b/INSTALL index 85cc8d6..0536727 100644 --- a/INSTALL +++ b/INSTALL @@ -9,17 +9,34 @@ The libmagic (aka file) library for file type detection (used by rpmbuild). The source for the file utility + library is available from ftp://ftp.astron.com/pub/file/ -The NSS >= 3.12 library for encryption, and NSPR library which NSS uses. -Both NSPR and NSS libraries and headers need to be installed during RPM -compilation. As NSPR and NSS typically install their headers outside -the regular include search path, you need to tell configure about this, -eg something like: +You will need a cryptographic library to support digests and signatures. +This library may be Mozilla NSS, OpenSSL or beecrypt. Which library to use +must be specified with the --with-crypto=[beecrypt|nss|openssl] argument +to configure. + +If using the Mozilla NSS library for encyption (and NSPR library which +NSS uses) it must be version 3.12 or later. Both NSPR and NSS libraries and +headers need to be installed during RPM compilation. As NSPR and NSS +typically install their headers outside the regular include search path, +you need to tell configure about this, eg something like: ./configure <......> CPPFLAGS="-I/usr/include/nspr -I/usr/include/nss" The NSPR and NSS libraries are available from http://www.mozilla.org/projects/security/pki/nss/ http://www.mozilla.org/projects/nspr/ +If using the OpenSSL library for encryption, it must be version 1.0.2 or +later. Note: when compiling against OpenSSL, there is a possible license +incompatibility. For more details on this, see +https://people.gnome.org/~markmc/openssl-and-the-gpl.html +Some Linux distributions have different legal interpretations of this +possible incompatibility. It is recommended to consult with a lawyer before +building RPM against OpenSSL. +Fedora: https://fedoraproject.org/wiki/Licensing:FAQ#What.27s_the_deal_with_the_OpenSSL_license.3F +Debian: https://lists.debian.org/debian-legal/2002/10/msg00113.html + +The OpenSSL crypto library is available from https://www.openssl.org/ + The Berkeley DB >= 4.3.x (4.5.x or newer recommended) is required for the default database backend. BDB can be downloaded from http://www.oracle.com/technology/software/products/berkeley-db/index.html @@ -77,7 +94,7 @@ is available from It may be desired to install bzip2, gzip, and xz/lzma so that RPM can use these formats. Gzip is necessary to build packages that contain compressed tar balls, these are quite common on the Internet. -These are availible from +These are available from http://www.gzip.org http://www.bzip.org http://tukaani.org/xz/ @@ -162,9 +179,9 @@ and then install with: make install Rpm comes with an automated self-test suite. The test-suite relies heavily -on fakechroot (https://github.com/fakechroot/) and cannot be executed +on fakechroot (https://github.com/dex4er/fakechroot/) and cannot be executed without it. Provided that fakechroot was found during configure, -it can be executed after a succesful build with: +it can be executed after a successful build with: make check @@ -186,7 +203,7 @@ with two rpms which can be found in RPMS and SRPMS. If you are going to install rpm on machines with OS package managers other then rpm, you may choose to install the base rpm package via a cpio instead of a tar file. Instead of running "make tar" during the -build process, as discribed above, use the base rpm packages to create +build process, as described above, use the base rpm packages to create a cpio. After the rpms have been created run rpm2cpio on the base rpm package, this will give you a cpio package which can then use to install rpm on a new system. @@ -208,13 +225,13 @@ an issue. RPM will need to be informed of all the dependencies which were satisfied before RPM was installed. Typically this only refers to libraries that are installed by the OS, but may include other -libraries and packages which are availible at the time RPM is +libraries and packages which are available at the time RPM is installed and will not under RPM control. Another common example of libraries which may need dependency provisions are precompiled libraries which are installed by the OS package manager during system build time. The list of dependencies you will wish to load into RPM will depend on exactly how you bootstrap RPM onto your system and what -parts of the sytem you put into packages as well as on the specific OS +parts of the system you put into packages as well as on the specific OS you are using. The script vpkg-provides.sh can be used to generate a package which @@ -231,7 +248,7 @@ can use the option: By default the generated rpm will include a %verifyscript to verify checksum of all files traversed has not changed. This additional -check can be surpressed with: +check can be suppressed with: --no_verify diff --git a/Makefile.am b/Makefile.am index 3cb3365..77fe7ee 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,14 +2,14 @@ ACLOCAL_AMFLAGS = -I m4 -DISTCHECK_CONFIGURE_FLAGS = --with-external-db +DISTCHECK_CONFIGURE_FLAGS = --with-external-db --enable-python --enable-zstd include $(top_srcdir)/rpm.am +AM_CFLAGS = @RPMCFLAGS@ CLEANFILES = -EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \ - autodeps autogen.sh \ - db3/configure installplatform platform.in +EXTRA_DIST = ChangeLog CREDITS INSTALL \ + autogen.sh db3/configure installplatform platform.in BUILT_SOURCES = SUBDIRS = po misc @@ -41,7 +41,9 @@ AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/ AM_CPPFLAGS += -I$(top_srcdir)/build AM_CPPFLAGS += -I$(top_srcdir)/lib AM_CPPFLAGS += -I$(top_srcdir)/rpmio +AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@ AM_CPPFLAGS += @WITH_NSS_INCLUDE@ +AM_CPPFLAGS += @WITH_OPENSSL_INCLUDE@ AM_CPPFLAGS += @WITH_POPT_INCLUDE@ AM_CPPFLAGS += -I$(top_srcdir)/misc AM_CPPFLAGS += -DLOCALEDIR="\"$(localedir)\"" @@ -72,6 +74,7 @@ pkginclude_HEADERS += lib/rpmcli.h pkginclude_HEADERS += lib/rpmlib.h pkginclude_HEADERS += lib/rpmds.h pkginclude_HEADERS += lib/rpmfi.h +pkginclude_HEADERS += lib/rpmfiles.h pkginclude_HEADERS += lib/rpmlegacy.h pkginclude_HEADERS += lib/rpmpol.h pkginclude_HEADERS += lib/rpmps.h @@ -82,6 +85,7 @@ pkginclude_HEADERS += lib/rpmte.h pkginclude_HEADERS += lib/rpmts.h pkginclude_HEADERS += lib/rpmtypes.h pkginclude_HEADERS += lib/rpmvf.h +pkginclude_HEADERS += lib/rpmarchive.h pkginclude_HEADERS += sign/rpmsign.h @@ -95,12 +99,13 @@ rpmbin_PROGRAMS = rpm bin_PROGRAMS = rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec +if WITH_ARCHIVE +bin_PROGRAMS += rpm2archive +endif + rpmlibexec_PROGRAMS = -rpmconfig_SCRIPTS = autodeps/find-provides autodeps/find-requires \ - mkinstalldirs \ +rpmconfig_SCRIPTS = mkinstalldirs \ config.guess config.sub -DISTCLEANFILES = autodeps/find-provides -DISTCLEANFILES += autodeps/find-requires noinst_LTLIBRARIES = libcliutils.la libcliutils_la_SOURCES = cliutils.h cliutils.c @@ -112,23 +117,28 @@ rpm_SOURCES = rpmqv.c debug.h system.h rpm_CPPFLAGS = $(AM_CPPFLAGS) -DIAM_RPMEIU -DIAM_RPMQ -DIAM_RPMV rpm_LDADD = libcliutils.la rpm_LDADD += lib/librpm.la rpmio/librpmio.la -rpm_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ + +rpm_LDADD += @WITH_POPT_LIB@ rpm_CFLAGS = $(CFLAGS) -fPIE rpm_LDFLAGS = $(LDFLAGS) -pie + rpmdb_SOURCES = rpmdb.c debug.h system.h rpmdb_CPPFLAGS = $(AM_CPPFLAGS) rpmdb_LDADD = libcliutils.la rpmdb_LDADD += lib/librpm.la rpmio/librpmio.la -rpmdb_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ + +rpmdb_LDADD += @WITH_POPT_LIB@ rpmdb_CFLAGS = $(CFLAGS) -fPIE rpmdb_LDFLAGS = $(LDFLAGS) -pie + rpmkeys_SOURCES = rpmkeys.c debug.h system.h rpmkeys_CPPFLAGS = $(AM_CPPFLAGS) rpmkeys_LDADD = libcliutils.la rpmkeys_LDADD += lib/librpm.la rpmio/librpmio.la -rpmkeys_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ + +rpmkeys_LDADD += @WITH_POPT_LIB@ rpmkeys_CFLAGS = $(CFLAGS) -fPIE rpmkeys_LDFLAGS = $(LDFLAGS) -pie @@ -136,39 +146,56 @@ rpmsign_SOURCES = rpmsign.c debug.h system.h rpmsign_CPPFLAGS = $(AM_CPPFLAGS) rpmsign_LDADD = libcliutils.la rpmsign_LDADD += sign/librpmsign.la lib/librpm.la rpmio/librpmio.la -rpmsign_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ +rpmsign_LDADD += @WITH_POPT_LIB@ rpmbuild_SOURCES = rpmbuild.c debug.h system.h rpmbuild_CPPFLAGS = $(AM_CPPFLAGS) rpmbuild_LDADD = libcliutils.la rpmbuild_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la -rpmbuild_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ +rpmbuild_LDADD += @WITH_POPT_LIB@ rpmspec_SOURCES = rpmspec.c debug.h system.h rpmspec_CPPFLAGS = $(AM_CPPFLAGS) rpmspec_LDADD = libcliutils.la rpmspec_LDADD += build/librpmbuild.la lib/librpm.la rpmio/librpmio.la -rpmspec_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ +rpmspec_LDADD += @WITH_POPT_LIB@ rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la -rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ +rpm2cpio_LDADD += @WITH_POPT_LIB@ rpm2cpio_CFLAGS = $(CFLAGS) -fPIE rpm2cpio_LDFLAGS = $(LDFLAGS) -pie +rpm2archive_SOURCES = rpm2archive.c debug.h system.h +rpm2archive_LDADD = lib/librpm.la rpmio/librpmio.la +rpm2archive_LDADD += @WITH_POPT_LIB@ @WITH_ARCHIVE_LIB@ + + if LIBELF +if LIBDW + rpmconfig_SCRIPTS += scripts/find-debuginfo.sh rpmlibexec_PROGRAMS += debugedit debugedit_SOURCES = tools/debugedit.c tools/hashtab.c tools/hashtab.h debugedit_LDADD = rpmio/librpmio.la debugedit_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@ - +if HAVE_LIBDW_STRTAB +debugedit_LDADD += @WITH_LIBDW_LIB@ +else +debugedit_LDADD += @WITH_LIBDW_LIB@ -lebl +endif # HAVE_LIBDW_STRTAB +endif # LIBDW rpmlibexec_PROGRAMS += elfdeps elfdeps_SOURCES = tools/elfdeps.c elfdeps_LDADD = rpmio/librpmio.la elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@ -endif + +rpmlibexec_PROGRAMS += sepdebugcrcfix +sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c +sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@ + +endif #LIBELF rpmlibexec_PROGRAMS += rpmdeps rpmdeps_SOURCES = tools/rpmdeps.c @@ -195,13 +222,16 @@ rpmrc: $(top_srcdir)/rpmrc.in CLEANFILES += rpmrc.tmp rpmrc EXTRA_DIST += rpmrc.in -rpmconfig_DATA += macros +noinst_DATA = macros macros: $(top_srcdir)/macros.in ( cd $(top_builddir) && ./config.status --file=${subdir}/macros:${subdir}/macros.in ) CLEANFILES += macros EXTRA_DIST += macros.in -noinst_DATA = platform +# Used for the testsuite to test creating debuginfo packages +EXTRA_DIST += macros.debug + +noinst_DATA += platform platform: $(top_srcdir)/platform.in @$(SED) \ -e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \ @@ -236,29 +266,32 @@ rpmvar_DATA = install-exec-hook: @rm -f $(DESTDIR)$(bindir)/rpmquery - @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmquery + @LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmquery @rm -f $(DESTDIR)$(bindir)/rpmverify - @LN_S@ ../../bin/rpm $(DESTDIR)$(bindir)/rpmverify + @LN_S@ $(rpm_symlink_prefix)rpm $(DESTDIR)$(bindir)/rpmverify install-data-local: DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \ $(SHELL) $(top_srcdir)/installplatform \ - rpmrc platform \ + rpmrc platform macros \ $(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU) @$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp + @$(MKDIR_P) $(DESTDIR)$(rpmconfigdir)/macros.d # XXX to appease distcheck we need to remove "stuff" here... uninstall-local: @rm -f $(DESTDIR)$(bindir)/rpmquery @rm -f $(DESTDIR)$(bindir)/rpmverify @rm -rf $(DESTDIR)$(rpmconfigdir)/platform/ + @rm -f $(DESTDIR)$(rpmconfigdir)/macros + @rm -rf $(DESTDIR)$(rpmconfigdir)/macros.d MAINTAINERCLEANFILES = ChangeLog # Build hacking docs only on request if HACKINGDOCS if DOXYGEN -doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am +doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader.h Makefile.am $(SED) \ -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \ -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \ @@ -271,12 +304,12 @@ doc/hacking/html/index.html: doc/hacking.doxy rpmpopt-@VERSION@ noinst_DATA += doc/hacking/html/index.html endif endif -EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader +EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader.h # Always build librpm docs if DOXYGEN -doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS) - files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \ +doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader.h Makefile.am configure.ac $(pkginclude_HEADERS) + files=`echo " $(pkginclude_HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \ $(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \ -e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \ -e "s,[@]HAVE_DOT[@],$(HAVE_DOT)," \ @@ -288,7 +321,7 @@ doc/librpm/html/index.html: doc/librpm.doxy @DOXYGEN@ doc/librpm.doxy noinst_DATA += doc/librpm/html/index.html endif -EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader +EXTRA_DIST += doc/librpm.doxy.in doc/librpm/Doxyheader.h EXTRA_DIST += doc/librpm/html if WITH_INTERNAL_DB @@ -296,19 +329,23 @@ db.h: $(top_builddir)/db3/db.h $(LN_S) $(top_builddir)/db3/db.h $@ BUILT_SOURCES += db.h endif -DISTCLEANFILES += db.h +DISTCLEANFILES = db.h + +ChangeLog: + touch ChangeLog + +dist-hook: + if [ -d .git ] && [ -x $(command -v git) ]; then git log --no-merges > $(distdir)/ChangeLog; fi clean-local: rm -rf doc/hacking/html rm -rf include distclean-local: + rm -rf doc/librpm.doxy doc/librpm/html rm -rf Doxytags rm -f stamp-h.in db3/*.orig db3/db3lobjs -maintainer-clean-local: - rm -rf doc/librpm/html - $(top_srcdir)/preinstall.am: Makefile.am rm -f $(top_srcdir)/preinstall.am @for f in $(HEADERS); do \ diff --git a/Makefile.maint b/Makefile.maint deleted file mode 100644 index 6eddaa1..0000000 --- a/Makefile.maint +++ /dev/null @@ -1,7 +0,0 @@ -include Makefile - -snapshot: ChangeLog - @$(MAKE) dist VERSION=$(VERSION).git`git log --pretty=oneline|wc -l` - -ChangeLog: .git - @git log --no-merges > ChangeLog diff --git a/README b/README index 9b4f643..7bf76bc 100644 --- a/README +++ b/README @@ -7,7 +7,7 @@ The latest releases are always available at: Additional RPM documentation (papers, slides, HOWTOs) can also be found at the same site: http://rpm.org. -http://rpm.org/wiki/Communicate lists all rpm releated mailing lists. +http://rpm.org/community all rpm releated mailing lists. RPM was originally written by: diff --git a/autodeps/.gitignore b/autodeps/.gitignore deleted file mode 100644 index 1151756..0000000 --- a/autodeps/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/find-provides -/find-requires diff --git a/autodeps/aix.prov b/autodeps/aix.prov deleted file mode 100644 index 6f7c8bd..0000000 --- a/autodeps/aix.prov +++ /dev/null @@ -1,78 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Ralph Goers(rgoer@Candle.Com) -# Borrowed heavily from Tim Mooney's HP version. -# This file is distributed under the terms of the GNU General Public License -# -# find-requires is part of RPM, the RedHat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to run correctly. -# - -find_prov_ia64() -{ - # On AIX for IA64, use the file command to find shared modules - # - # Example file output: - # - #$file /usr/lib/ia64l32/libc.so - #/usr/lib/ia64l32/libc.so: ELF 32-bit LSB version 1 AIX shared obj IA-64 - # - # - # - - # Search for shared objects - the file command on AIX for IA64 reports - # shared objects - sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*shared obj" | cut -d: -f1 | sed "s/\/$//g" | xargs -i basename {} | sort -u -} - -find_prov_power() -{ - # - # Example dump output: - # - #$dump -H /usr/bin/dump - # - #/usr/bin/dump: - # - # ***Loader Section*** - # Loader Header Information - #VERSION# #SYMtableENT #RELOCent LENidSTR - #0x00000001 0x00000021 0x0000006c 0x0000002f - # - ##IMPfilID OFFidSTR LENstrTBL OFFstrTBL - #0x00000002 0x00000848 0x00000049 0x00000877 - # - # - # ***Import File Strings*** - #INDEX PATH BASE MEMBER - #0 /usr/lib:/lib:/usr/lpp/xlC/lib - #1 libc.a shr.o - - # - # - - # Search executables, archives, and symlinks to those types for shared - # objects - sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*executable" -e ":.*archive" | cut -d: -f1 | sed "s/\/$//g" | - - # Use the verbose version of dump to find the sharable objects - while read f - do - LANG=C /usr/bin/dump -ov $f/ 2>/dev/null | grep -E "^Flags.*SHROBJ|:$" | - awk 'match($1,":$") { member=$1 } - !match($1,":$") {print member} ' - done | sed -e 's/:$//' -e 's/\/\[/\(/g' -e 's/\]/)/g' | xargs -i basename {} | - sort -u -} - -PATH=/usr/bin - -machinetype=`uname -m` -if [[ $machinetype = "ia64" ]] -then - find_prov_ia64 -else - find_prov_power -fi - diff --git a/autodeps/aix.req b/autodeps/aix.req deleted file mode 100755 index e8503b3..0000000 --- a/autodeps/aix.req +++ /dev/null @@ -1,171 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Ralph Goers(rgoer@Candle.Com) -# Borrowed heavily from Tim Mooney's HP version. -# This file is distributed under the terms of the GNU General Public License -# -# find-requires is part of RPM, the RedHat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to run correctly. -# - -find_req_power () -{ - # On AIX Power, use `dump -H' to find the library dependencies - # for an executable - # - # Example dump output: - # - #$dump -H /usr/bin/dump - # - #/usr/bin/dump: - # - # ***Loader Section*** - # Loader Header Information - #VERSION# #SYMtableENT #RELOCent LENidSTR - #0x00000001 0x00000021 0x0000006c 0x0000002f - # - ##IMPfilID OFFidSTR LENstrTBL OFFstrTBL - #0x00000002 0x00000848 0x00000049 0x00000877 - # - # - # ***Import File Strings*** - #INDEX PATH BASE MEMBER - #0 /usr/lib:/lib:/usr/lpp/xlC/lib - #1 libc.a shr.o - - # - # - - while read f - do - # Find the required symbols in executables and the required shells in - # scripts - LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script" - - if [ $? -ne 0 ] # Use dump to examine executables - then - LANG=C /usr/bin/dump -H $f 2>/dev/null | awk ' - - # - # Since this entire awk script is enclosed in single quotes, - # you need to be careful to not use single quotes, even in awk - # comments, if you modify this script. - # - - BEGIN { - in_shlib_list = 0; - in_file_strings = 0; - FS = " "; - RS = "\n"; - } - - in_shlib_list == 1 && /^$/ { - in_shlib_list = 0; - in_file_strings = 0; - } - - in_shlib_list == 1 { - pos = index($2, "/") - numfields = split($0, fields, " ") - - if (pos == 0) { - namevar = 2 - } - else { - namevar = 3 - } - if (namevar < numfields) { - printf("%s(%s)\n", fields[namevar], fields[namevar+1]) - } - else { - if ((fields[namevar] != ".") && (fields[namevar] != "..")) { - print fields[namevar] - } - } - } - - in_file_strings == 1 && $1 == "0" { - in_shlib_list = 1 - } - - /\*Import File Strings\*/ { - in_file_strings = 1 - } - ' # end of awk - else # shell scripts - if [ -x $f ]; then - /usr/bin/head -1 $f | /usr/bin/sed -e 's/^\#\![ ]*//' | /usr/bin/cut -d" " -f1 - fi - fi - done | sort -u -} - -find_req_ia64 () -{ - # On AIX IA64, use `dump -Lv' to find the library dependencies - # for an executable - # - # Example dump output: - # - #$dump -Lv /usr/bin/dump - # - # - #/usr/bin/dump: - # - # **** DYNAMIC SECTION INFORMATION **** - #[INDEX] Tag Value - # - #.dynamic: - #[1] NEEDED libC.so.1 - #[2] NEEDED libelf.so - #[3] NEEDED /usr/lib/ia64l32/libc.so.1 - #[4] INIT 0x1001d6c0 - #[5] FINI 0x1001d700 - #[6] HASH 0x1000011c - #[7] STRTAB 0x10000914 - #[8] SYMTAB 0x10000364 - #[9] STRSZ 0x3dd - #[10] SYMENT 0x10 - #[11] PLTGOT 0x20018994 - #[12] PLT_RESERVE 0x20018a00 - #[13] PLTSZ 0x1c0 - #[14] PLTREL REL - #[15] JMPREL 0x100024bc - #[16] REL 0x10000cf4 - #[17] RELSZ 0x17c8 - #[18] RELENT 0x8 - # - # - - while read f - do - # Find the required symbols in executables and the required shells in - # scripts - LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script" - - if [ $? -ne 0 ] # Use dump to examine executables - then - LANG=C /usr/bin/dump -Lv $f 2>/dev/null | \ - awk '$2=="NEEDED" {print $3}' | xargs -i basename {} - - else # Extract the exec module from shell scripts - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 - fi - fi - done | sort -u -} - -machinetype=`uname -m` -if [[ $machinetype = "ia64" ]] -then - /usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \ - /usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 | - find_req_ia64 -else - /usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \ - /usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 | - find_req_power -fi - diff --git a/autodeps/aix4.prov b/autodeps/aix4.prov deleted file mode 100644 index 59637a7..0000000 --- a/autodeps/aix4.prov +++ /dev/null @@ -1,189 +0,0 @@ -#! /usr/bin/ksh - -# Current Maintainer: Tim Mooney -# -# Original Author: Ralph Goers(rgoer@Candle.Com) -# Borrowed heavily from H10 version created by Tim Mooney. -# This file is distributed under the terms of the GNU Public License -# -# find-provides is part of RPM, the RedHat Package Manager. find-provides -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries provided by (contained in) the package. -# -# On AIX, use `dump -o' to find what the library provides, if anything. -# -# -# Ralph's comments: -# -# Executables are skipped because, by convention, shared libraries -# which are not dynamically loaded are packaged as archives. Also, -# it is impossible to tell the difference between an executable -# program and a dynamically loaded shared library. -# -# Because archives can contain any number of things, including -# apparently, multiple shared libraries, dependencies in archives -# will be specified as file[member]. Any member in an archive which -# has a loader section will be listed as provided. -# -# Tim's (subsequent) comments: -# -# Based on discussions on the rpm-list in mid-March of 2000, I've modified -# the copy of find-provides that Ralph provided me to use `dump -o' instead -# of `dump -H', and I've followed Brandon S. Allbery's suggestions and modified -# the awk script to look for a modtype of `RE', which is what constitutes a -# shared member of a library. Just like everything else on AIX, libraries are -# weird. :-| -# -# I've followed Ralph's convention of generating provides in the form of -# `filebasename(member-object)' *if* there is a member object, or just -# `filebasename' if there isn't (such as in the case of certain perl modules, -# locally built shared libraries, etc.). -# -# Example dump output: -# -#$dump -o /usr/lpp/X11/lib/R6/libX11.a -# -#/usr/lpp/X11/lib/R6/libX11.a[shr4.o]: -# -# ***Object Module Header*** -## Sections Symbol Ptr # Symbols Opt Hdr Len Flags -# 4 0x00126c28 14557 72 0x3002 -#Timestamp = 920377624 -#Magic = 0x1df -# -# ***Optional Header*** -#Tsize Dsize Bsize Tstart Dstart -#0x000bcc20 0x00024bd4 0x00000e0c 0x00000000 0x00000000 -# -#SNloader SNentry SNtext SNtoc SNdata -#0x0004 0x0000 0x0001 0x0002 0x0002 -# -#TXTalign DATAalign TOC vstamp entry -#0x0005 0x0003 0x00023d74 0x0001 0xffffffff -# -#maxSTACK maxDATA SNbss magic modtype -#0x00000000 0x00000000 0x0003 0x010b RE -# -#/usr/lpp/X11/lib/R6/libX11.a[shr4net.o]: -# -# ***Object Module Header*** -## Sections Symbol Ptr # Symbols Opt Hdr Len Flags -# 7 0x000006fb 22 72 0x3002 -#Timestamp = 774732998 -#Magic = 0x1df -# -# ***Optional Header*** -#Tsize Dsize Bsize Tstart Dstart -#0x00000084 0x00000088 0x00000000 0x00000200 0x00000000 -# -#SNloader SNentry SNtext SNtoc SNdata -#0x0007 0x0000 0x0002 0x0004 0x0004 -# -#TXTalign DATAalign TOC vstamp entry -#0x0002 0x0003 0x00000080 0x0001 0xffffffff -# -#maxSTACK maxDATA SNbss magic modtype -#0x00000000 0x00000000 0x0005 0x010b RE - -PATH=/usr/bin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# TVM: Because AIX libraries don't have the equivalent of a SONAME, if you do -# -# ln -s /usr/lib/libc.a /tmp/libmy_libc_link.a -# -# and then link your program with `-L/tmp -lmy_libc_link', that's the name -# that will be recorded as the BASE in the Import File Strings area. -# This means we need to include "symbolic link" in the list of files to check -# out. -# -filelist=`sed "s/['\"]/\\\&/g" | xargs file \ - | grep -E 'archive|executable|symbolic link' | cut -d: -f1` - -for f in $filelist -do - # - # Uncomment the next line for some additional debugging info: - #echo "Checking $f" - dump -o $f 2>/dev/null | awk ' - - # TVM: be careful to not use any single quotes, even in comments, - # since this entire awk script is enclosed in single quotes. - - BEGIN { - FS = " "; - RS = "\n"; - # our flag to indicate we found a filename[membername] or - # filename. - found_file_or_member = 0 - # our flag to indicate we found the modtype tag. If so, - # we want to look for RE on the next line. - found_modtype = 0 - # - # number of times gsub substituted, used twice below - nsub = 0 - } - - # Uncomment the next line for some debugging info. - # { print NR , ":", $0 } - - found_modtype == 1 && found_file_or_member == 1 { - - if ( $0 ~ / RE/ ) { - # we have seen a filename, we have seen a modtype line, and now - # we know that the modtype is RE. Print out the member name. - # - # Note that member names generally look like foo[bar.o], and - # since the RPM standard has become to use parens, we will - # translate the [ and ] into ( and ) in the output stream. - # awk on AIX 4 has sub() and gsub(), so we can use them to do - # it. If this script is adapted for use on some other platform - # make sure that awk on that platform has sub/gsub. If not, - # you will need to postprocess the output stream (probably before - # the sort -u) with tr or sed. - nsub = gsub(/\[/, "(", member) - if ( nsub > 1 ) { - print "substituted too many times for [:", member | "cat 1>&2" - } - nsub = gsub(/\]/, ")", member) - if ( nsub > 1 ) { - print "substituted too many times for ]:", member | "cat 1>&2" - } - print member - } - # In any case, reset our flags to zero, to indicate we are done - # with this member, so we are ready to handle additional members - # if needed. - found_file_or_member = 0 - found_modtype = 0 - } - - found_file_or_member == 1 && /magic *modtype/ { - # we have seen a filename, and now we have seen the modtype - # line. Set the found_modtype flag. The next line of input - # will be caught by the rule above, and we will print out - # the member if the modtype is RE. - found_modtype = 1 - } - - /:$/ { - numfields = split($0,fields, "/") - # chop off the trailing colon - fieldlen = length(fields[numfields])-1 - member= substr(fields[numfields], 1, fieldlen) - # Set the flat to indicate we found a file or a file(member). - found_file_or_member = 1 - } - ' # end of awk -done | sort -u -#comment out the previous line and uncomment the next line when debugging -#done diff --git a/autodeps/aix4.req b/autodeps/aix4.req deleted file mode 100644 index 79e988b..0000000 --- a/autodeps/aix4.req +++ /dev/null @@ -1,99 +0,0 @@ -#! /usr/bin/ksh -# -# Current Maintainer: Tim Mooney -# Original Author: Ralph Goers(rgoer@Candle.Com) -# -# This file is distributed under the terms of the GNU Public License -# -# find-requires is part of RPM, the RedHat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to run correctly. -# -# On AIX, use `dump -H' to find the library dependencies for an executable -# -# Example dump output: -# -#$dump -H /usr/bin/dump -# -#/usr/bin/dump: -# -# ***Loader Section*** -# Loader Header Information -#VERSION# #SYMtableENT #RELOCent LENidSTR -#0x00000001 0x00000021 0x0000006c 0x0000002f -# -##IMPfilID OFFidSTR LENstrTBL OFFstrTBL -#0x00000002 0x00000848 0x00000049 0x00000877 -# -# -# ***Import File Strings*** -#INDEX PATH BASE MEMBER -#0 /usr/lib:/lib:/usr/lpp/xlC/lib -#1 libc.a shr.o -# -# - -PATH=/usr/bin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -filelist=`sed "s/['\"]/\\\&/g" | xargs file \ - | grep -E '^.*:.*(executable |archive )' | cut -d: -f1` - -for f in $filelist -do - dump -H $f 2>/dev/null | awk ' - - # - # Since this entire awk script is enclosed in single quotes, - # you need to be careful to not use single quotes, even in awk - # comments, if you modify this script. - # - - BEGIN { - in_shlib_list = 0; - in_file_strings = 0; - FS = " "; - RS = "\n"; - } - - in_shlib_list == 1 && /^$/ { - in_shlib_list = 0; - in_file_strings = 0; - } - - in_shlib_list == 1 { - pos = index($2, "/") - numfields = split($0, fields, " ") - - if (pos == 0) { - namevar = 2 - } - else { - namevar = 3 - } - if (namevar < numfields) { - printf("%s(%s)\n", fields[namevar], fields[namevar+1]) - } - else { - print fields[namevar] - } - } - - in_file_strings == 1 && $1 == "0" { - in_shlib_list = 1 - } - - /\*Import File Strings\*/ { - in_file_strings = 1 - } - - ' # end of awk -done | sort -u diff --git a/autodeps/amigaos.prov b/autodeps/amigaos.prov deleted file mode 100644 index 87ad08f..0000000 --- a/autodeps/amigaos.prov +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -cat > /dev/null diff --git a/autodeps/amigaos.req b/autodeps/amigaos.req deleted file mode 100644 index 87ad08f..0000000 --- a/autodeps/amigaos.req +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -cat > /dev/null diff --git a/autodeps/darwin.prov b/autodeps/darwin.prov deleted file mode 100644 index b068912..0000000 --- a/autodeps/darwin.prov +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -# ---------------------------------------------------------- -# find-provides for Darwin/MacOSX -# ---------------------------------------------------------- -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. - -filelist=$(sed -n -e '/\.dylib/p' -e '/\.so/p' -e '/\.bundle/p' | sort | uniq | xargs file -L 2>/dev/null | grep "Mach-O.*\(ppc\|i386\)" | cut -d: -f1) - -for f in $filelist; do - libname=$(basename $f | sed -e 's;\..*;;') - soname=$(otool -l $f | grep $libname | awk '/ name/ {print $2}') - - if [ "$soname" != "" ]; then - if [ ! -L $f ]; then - basename $soname - fi - else - echo ${f##*/} - fi -done | sort -u diff --git a/autodeps/darwin.req b/autodeps/darwin.req deleted file mode 100644 index e571710..0000000 --- a/autodeps/darwin.req +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------- -# find-requires for Darwin/MacOSX -# ---------------------------------------------------------------- -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -exelist=`echo $filelist | xargs file | grep -F Mach-O | cut -d: -f1 ` -scriptlist=`echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1 ` - -for f in $exelist; do - if [ -x $f ]; then - otool -L $f \ - | awk '/^\t/ { print }' \ - | sed -n -e '/ (compatibility version .* current version .*)/p' \ - | sed -e 's/ (compatibility version .* current version .*)//' - fi -done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u - -for f in $scriptlist; do - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' \ - | sed -n -e '/^\/bin/!p' | sed -n -e '/^\/usr\/bin/!p' | uniq \ - | cut -d" " -f1 - fi -done diff --git a/autodeps/freebsd.prov b/autodeps/freebsd.prov deleted file mode 100644 index cf00d4f..0000000 --- a/autodeps/freebsd.prov +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------- -# find-provides for FreeBSD-2.2.x -# ---------------------------------------------------------- -filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "FreeBSD.*shared" | cut -d: -f1) - -for f in $filelist; do - echo ${f##*/} -done | sort -u diff --git a/autodeps/freebsd.req b/autodeps/freebsd.req deleted file mode 100644 index 9a1e0f4..0000000 --- a/autodeps/freebsd.req +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------- -# find-requires for FreeBSD-2.2.x -# how do we know what is required by a.out shared libraries? -# ---------------------------------------------------------------- -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -exelist=`echo $filelist | xargs file | grep -F executable | cut -d: -f1 ` -scriptlist=`echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1 ` - -for f in $exelist; do - if [ -x $f ]; then - ldd $f | /usr/bin/awk '/=>/&&!/not found/ { print $3 }' - fi -done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u - -for f in $scriptlist; do - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 - fi -done | sort -u diff --git a/autodeps/freebsdelf.prov b/autodeps/freebsdelf.prov deleted file mode 100644 index df7d829..0000000 --- a/autodeps/freebsdelf.prov +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------- -# find-provides for FreeBSD >= 3.3 -# ---------------------------------------------------------- -filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "ELF.*shared" | cut -d: -f1) - -for f in $filelist; do - echo ${f##*/} -done | sort -u diff --git a/autodeps/freebsdelf.req b/autodeps/freebsdelf.req deleted file mode 100644 index dde04c5..0000000 --- a/autodeps/freebsdelf.req +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -# note this works for both a.out and ELF executables -# it also auto-generates requirment lines for shell scripts - -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -exelist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*executable" | cut -d: -f1; fi` -scriptlist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1; fi` -liblist=`if test "x$filelist" != x; then echo $filelist | xargs file | grep ":.*shared object" | cut -d : -f1; fi` - -LDDLIST=`for f in $exelist; do - if [ -x $f ]; then - ldd $f | awk '/=>/ { print $1 }' - fi -done | sort -u | sed "s/['\"]/\\\&/g"` -if test "x$LDDLIST" != x; then - echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u -fi - -LDDLIST=`for f in $liblist; do - ldd $f | awk '/=>/ { print $1 }' -done | sort -u | sed "s/['\"]/\\\&/g"` -if test "x$LDDLIST" != x; then - echo $LDDLIST | xargs -n 1 basename | grep -v 'libNoVersion.so' | sort -u -fi - -for f in $scriptlist; do - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 - fi -done | sort -u - -for f in $liblist $exelist ; do - objdump -p $f | awk ' - BEGIN { START=0; LIBNAME=""; } - /Version References:/ { START=1; } - /required from/ && (START==1) { - sub(/:/, "", $3); - LIBNAME=$3; - } - (START==1) && (LIBNAME!="") && ($4~/^GLIBC_*/) { print LIBNAME "(" $4 ")"; } - /^$/ { START=0; } - ' -done | sort -u diff --git a/autodeps/hpux.prov b/autodeps/hpux.prov deleted file mode 100644 index 9fd4ce6..0000000 --- a/autodeps/hpux.prov +++ /dev/null @@ -1,175 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: hpux.prov,v 1.8 2001/09/15 13:49:11 jbj Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-provides is part of RPM, the Red Hat Package Manager. find-provides -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries provided by (contained in) the package. -# -# -# On HP-UX, use `chatr' to find what libraries a package provides -# -# Example chatr output: -# -#$chatr /usr/lib/libc.sl -# -#/usr/lib/libc.sl: -# shared library -# shared library dynamic path search: -# SHLIB_PATH disabled second -# embedded path disabled first Not Defined -# internal name: -# libc.1 -# shared library list: -# dynamic /usr/lib/libdld.1 -# static branch prediction disabled -# kernel assisted branch predictionenabled -# lazy swap allocationdisabled -# text segment lockingdisabled -# data segment lockingdisabled -# data page size: 4K -# instruction page size: 4K -# - -# -# Implementation notes: some of the system libraries are built without an -# `internal name' (HP-UX's equivalent to a SONAME), so I need to track what -# chatr outputs as its first line. We'll use the basename of that line in -# the event of no internal name. -# - -PATH=/usr/bin:/usr/sbin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# TVM: use `while read ...' instead of `for f in ...', because there may -# be too many files to stuff into one shell variable. -# -IFS="" -while read f -do - # It's possible that I should be testing to make sure that the file - # we're trying isn't a symlink, and skipping it if it is, because of - # the possible odd situation where we could have a link to a library - # with no internal name. This would need more investigation, though. - chatr $f 2>/dev/null \ - | awk ' - - BEGIN { - FS = " "; - RS = "\n"; - - # This flag signfies that we have seen the internal name: - # marker. Once we see that, we set the flag to 1. The next - # line we read should contain the library internal name, the - # SOM equivalent of an soname. At that point we set the flag - # found_internal_name to 1 and exit - # the main body of the awk script, going through the END - in_internal_name = 0; - - # - # We have seen the internal name: section (yet)? - # - found_internal_name = 0; - - # - # assume it is a shared library, until record 2 proves us wrong. - # - isa_shared_library = 1; - } - - # Uncomment the next line for some debugging info. - #{ print NR , ":", $0 } - - # - # save the first line in case there is no internal name built - # into this object. - # - NR == 1 { - my_name = $0 - opened_something = 1; - } - - # - # Check the second line (record). Clear the flag if it is not a - # shared library. - # - NR == 2 && $0 !~ /^[ ]+shared library[ ]*$/ { - # It is not a shared library. Bow out early - isa_shared_library = 0; - exit - } - - in_internal_name == 1 { - - # We found the library internal name. If it does not contain - # a path, print it. At least a couple of the system libraries - # have a full path as the internal name (this is probably a bug). - - if ( $0 ~ /\// ) { - numfields = split($0, internal_name, "/") - print internal_name[numfields] - } else { - print $1 - } - - # - # Set a flag for the EXIT section, to indicate that we found - # an internal name - # - found_internal_name = 1; - in_internal_name = 0 - exit - } - - # - # we have hit the internal name section. Set the flag. The next - # line should be what we are looking for. - # - /^ +internal name: *$/ { - in_internal_name = 1 - } - - END { - # Uncomment the next line for debugging info - #{ print "END: NR: ", NR } - if ( (isa_shared_library == 0) || (NR < 2) ) { - # both of these indicate error conditions, for which we - # should not generate any output. - exit; - } else { - if (found_internal_name == 1) { - exit; - } else { - # - # chop the : off the end of the line - # - colon = index(my_name, ":") - colon = colon - 1 - temp = substr(my_name, 1, colon) - # - # get the basename - # - numfields = split(temp, basename, "/") - # Uncomment the next line for debugging info - #print "In END:", numfields, ":", temp - print basename[numfields] - exit - } - } - } - ' # end of awk -done | sort -u -#comment out the previous line and uncomment the next line when debugging -#done diff --git a/autodeps/hpux.req b/autodeps/hpux.req deleted file mode 100644 index ab72900..0000000 --- a/autodeps/hpux.req +++ /dev/null @@ -1,126 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: hpux.req,v 1.7 2001/09/15 13:49:11 jbj Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-requires is part of RPM, the Red Hat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to run correctly. -# -# On HP-UX, use `chatr' to find the library dependencies for an executable -# -# Example chatr output: -# -#$chatr /usr/bin/chatr -#/usr/bin/chatr: -# shared executable -# shared library dynamic path search: -# SHLIB_PATH disabled second -# embedded path disabled first Not Defined -# internal name: -# chatr -# shared library list: -# dynamic /usr/lib/libc.1 -# shared library binding: -# deferred -# static branch prediction disabled -# kernel assisted branch predictionenabled -# lazy swap allocationdisabled -# text segment lockingdisabled -# data segment lockingdisabled -# data page size: 4K -# instruction page size: 4K - -PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -IFS="" -while read f -do - # uncomment the next line if debugging - # echo "### processing $f" - - # - # Only run the file command once per file: - # - file_output=`file $f` - - # - # First, check to see if it's a script, and try figure out what - # intpreter it requires. This is more work on HP-UX, since `file' - # doesn't tell us what interpreter the script uses, or even if it - # really is a script. - # - is_shell_script=`od -N 2 -t c $f 2>/dev/null | grep '0000000 # !'` - if test X"$is_shell_script" != X ; then - # - # it's a shell script. Now figure out what interpreter it needs - # Look at me! I'm good with sed. ;-) - interp=`head -1 $f | sed -e 's/^#! \{0,1\}\([^ ]*\).*$/\1/'` - if test X"$interp" != X ; then - echo "$interp" - # - # We've found what we need for this file. Skip back to the - # top of the loop. This saves me an `else' and another indent - # level! ;-) - continue - fi - fi - - # - # The `else' is implied here by the `continue' above - # - - # - # Is it a shared library? - # - maybe_shared_lib=`echo "$file_output" | grep -E '(executable|library)'` - if test X"$maybe_shared_lib" != X ; then - chatr $f 2>/dev/null \ - | awk ' - - # - # For you non-awk-ers, no single quotes in comments -- the shell - # sees them and things get hosed. - # - - BEGIN { - in_shlib_list = 0; - FS = " "; - RS = "\n"; - } - - # uncomment the next line for debugging information - #{ print NR, ": ", $0 } - - - in_shlib_list == 1 && /dynamic[ ]+[\/\.]/ { - - # split the line on "/" and print out the last element - numfields = split($0,fields,"/") - print fields[numfields] - - } - - /^ +shared library list: *$/ { - in_shlib_list = 1 - } - - /^ +shared library binding: *$/ { - exit - } - ' # end of awk - fi # end of shared library if. -done | sort -u -#comment out the previous line and uncomment the next one if debugging. -#done diff --git a/autodeps/irix6.prov b/autodeps/irix6.prov deleted file mode 100644 index 87ee4e1..0000000 --- a/autodeps/irix6.prov +++ /dev/null @@ -1,201 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: irix6.prov,v 1.7 2001/09/15 13:49:11 jbj Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-provides is part of RPM, the Red Hat Package Manager. find-provides -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries provided by (contained in) the package. -# -# NOTE: IRIX libraries (even system libraries) have "version information" -# in both the soname and the internal version field, so it's important to -# be able to separate the soname and internal version fields. As has -# become the case on other platforms, the soname/iversion delimiters have -# become the `(' and `)' characters. -# -# On IRIX, use `elfdump -L' to find what libraries a package provides -# -# Example `elfdump -L' output: -# -#$elfdump -L /usr/lib/libc.so -# -# -#/usr/lib/libc.so: -# -# **** DYNAMIC SECTION INFORMATION **** -#.dynamic : -#[INDEX] Tag Value -#[0] HASH 0xfa099d0 -#[1] STRTAB 0xfa0027c -#[2] SYMTAB 0xfa10e3c -#[3] STRSZ 0x9751 -#[4] SYMENT 0x10 -#[5] INIT 0 -#[6] FINI 0 -#[7] RLDVERS 0x1 -#[8] FLAGS 0x1411 -#[9] BASEADDR 0xfa00000 -#[10] LOCGOTNO 0x3c -#[11] PROTECT 0x3c -#[12] HIDDEN 0x12 -#[13] CNFLCTNO 0 -#[14] LBLISTNO 0 -#[15] SYMTABNO 0xd19 -#[16] UNREFEXT 0x8 -#[17] GOTSYM 0x8b3 -#[18] LOCAL 0x12 -#[19] LOCALPG 0x1 -#[20] LOCALPG 0x10 -#[21] PLTGOT 0xfb483b0 -#[22] RLDTXT_ADR0xfb6b580 -#[23] OPTIONS 0xfa000f4 -#[24] SONAME libc.so.1 -#[25] TIMSTAMP Jun 16 18:23:15 1997 -#[26] CHECKSUM 0x92321a0c -#[27] IVERSION sgi1.0 -#[28] REL 0xfa1dfcc -#[29] RELSZ 0x1988 -#[30] RELENT 0x8 -#[31] MSYM 0xfa1f954 -#[32] COMPCTSIZE0xc60c -#No Library List Section in /usr/lib/libc.so -# - -PATH=/usr/bin:/usr/sbin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# Use `while read ...' instead of `for f in ...', because there may be too -# many files to stuff into one shell variable. -# -IFS="" -while read f -do - # - # If it's a shared library, run elfdump on it. - # - maybe_shared_lib=`file $f | grep -E 'ELF.*dynamic lib'` - if test X"$maybe_shared_lib" != X ; then - elfdump -L $f 2>/dev/null | awk ' - - # - # Since this entire awk script is enclosed in single quotes, - # you need to be careful to not use single quotes, even in awk - # comments, if you modify this script. - # - - BEGIN { - FS = " "; - RS = "\n"; - OFS = ""; - - found_soname = 0; - found_iversion = 0; - } - - # Uncomment the next line for some debugging info. - #{ print NR , ":", $0 } - - /[ ]+SONAME .*[ ]*$/ { - found_soname = 1; - numfields = split($0, internal_name) - if (numfields == 3) { - soname = $3 - } else { - # - # Should never be here. - # - print "Really odd looking soname:", $0 | "cat 1>&2" - exit - } - } - - /[ ]+IVERSION .*[ ]*$/ { - if (found_soname == 1) { - numfields = split($0, iversion) - if (numfields == 3) { - version = $3 - # - # handle libraries with multiple versions, like - # 1.1:1.2. Since they really provide both versions, - # we need to generate output for each version. - # - numfields = split(version, versions, ":") - if (numfields > 1) { - for (i = 1; i < numfields; i++) { - print soname, "(", versions[i], ")" - } - # - # let our END routine print out the *last* version - # provided - # - version = versions[numfields] - } - # - # stick a fork in us. - # - found_iversion = 1; - exit - } else { - # - # handle libraries with comments and other junk in - # the version field. IRIX has a number of system libraries - # with whitespace and other junk in the version field! - # - # we discard the whitespace and keep the identifier after - # the # sign. - # - version = iversion[numfields] - numfields = split(version, version_junk, "#") - if (numfields > 1) { - version = version_junk[numfields] - found_iversion = 1; - } - } - } else { - # - # found an iversion without an soname. Is that possible? - # - print "Found version but no soname:", $0 | "cat 1>&2" - exit - } - } - - # - # we could probably watch for some other token (like RELSZ) - # that *generally* occurs later in the input than the stuff we watch - # for, and exit if we see it, but it is just as easy to read all - # the output, even after we have seen what we are looking for. - # - - END { - # Uncomment the next line for debugging info - #{ print "END: NR: ", NR } - if ( (found_soname == 1) && (found_iversion == 1) ) { - print soname, "(", version, ")" - exit - } else if ( (found_soname == 1) && (found_iversion == 0) ) { - # - # no library version information *BUT* any programs linked - # against this library will pick up a dependency on version 0 - # of this library, so we output that. - # - print soname, "(", 0, ")" - } - # else do nothing - } - ' # end of awk - fi # end of the 'if test X"$maybe_shared_lib != X ; then' clause -done | sort -u -#comment out the previous line and uncomment the next line when debugging -#done diff --git a/autodeps/irix6.req b/autodeps/irix6.req deleted file mode 100644 index 72442ac..0000000 --- a/autodeps/irix6.req +++ /dev/null @@ -1,164 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: irix6.req,v 1.7 2001/09/15 13:49:11 jbj Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-requires is part of RPM, the Red Hat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to execute. -# -# NOTE: IRIX libraries (even system libraries) have "version information" -# in both the soname and the internal version field, so it's important to -# be able to separate the soname and internal version fields. As has -# become the case on other platforms, the soname/iversion delimiters have -# become the `(' and `)' characters. -# -# On IRIX, use `elfdump -Dl' to find what libraries are required by -# an executable. `elfdump -L' does what we need too, but it gives us more -# than we really need. -# -# Example `elfdump -Dl' output: -# -#$elfdump -Dl /usr/bin/X11/xterm -# -# -# -#/usr/bin/X11/xterm: -# -# **** MIPS LIBLIST INFORMATION **** -#.liblist : -#[INDEX] Timestamp Checksum Flags Name Version -#[1] Nov 23 15:39:02 1997 0x4da65893 ----- libXaw.so.2 sgi2.0 -#[2] Nov 23 15:39:02 1997 0x414eece6 ----- libXmu.so sgi1.0 -#[3] Nov 23 15:39:02 1997 0x6f314e69 ----- libXt.so sgi1.0 -#[4] Nov 23 15:39:02 1997 0xcbe81fff ----- libXext.so sgi1.0 -#[5] Nov 23 15:39:02 1997 0x89ae8e98 ----- libX11.so.1 sgi1.0 -#[6] Oct 27 01:00:29 1997 0x99b27890 ----- libcurses.so sgi1.0 -#[7] Jun 16 18:23:15 1997 0x92321a0c ----- libc.so.1 sgi1.0 -# - -# -# TVM: it might be better to re-write this so that `file' isn't used, since -# it can all be done with `elfdump', but this works. -# - -PATH=/usr/bin:/usr/sbin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# TVM: switch to using `while read ...' instead of `for f in ...', because -# packages with a large number of files could be too big for one shell -# variable to hold. -# -IFS="" -while read f -do - - # - # Uncomment the next line for additional debugging: - #echo "read ->$f<-" - - # - # Only run file once per file: - # - file_output=`file $f` - - # - # Handle scripts first - # - is_shell_script=`echo "$file_output" | grep 'script text' | \ - cut -d: -f 2 | awk '{ print $1 }'` - - # - # If it's a script... - # - if test X"$is_shell_script" != X ; then - echo "$is_shell_script" - # - # use `continue' to skip back up to the top of the loop. We've - # already done as much as we need to, and this saves me from having - # to have an else, and another indent level... ;-) - # - continue - fi - - # - # the `else' is implied here, since we used `continue' in the test above - # - - # - # It might be a shared library. - # - maybe_shared_lib=`echo "$file_output" | grep -E 'executable|lib'` - if test X"$maybe_shared_lib" != X ; then - - elfdump -Dl $f 2>/dev/null \ - | awk ' - - # - # Since this entire awk script is enclosed in single quotes, - # you need to be careful to not use single quotes, even in awk - # comments, if you modify this script. - # - - BEGIN { - found_column_headers = 0; - FS = " "; - RS = "\n"; - OFS=""; - } - - # uncomment the next line for debugging information - #{ print "Saw input:", $0 } - - found_column_headers == 1 && $0 !~ /^$/ { - - # get the library name (field 15) and the library version (field 16) - # if present. - numfields = split($0,fields) - if (numfields == 8) { - print fields[8] - } else if (numfields == 9) { - # - print fields[8], "(", fields[9], ")" - } else if (numfields > 9) { - # - # SGI has this annoying habit of putting comments, complete - # with whitespace, in their library IVERSION field. Yuck. - # - # Handle libraries like this gracefully. - # - verfields = split(fields[NF], junk, "#") - if (verfields == 2) { - print fields[8], "(", junk[2], ")" - } else if (verfields > 2) { - print fields[8], "(", junk[verfields], ")" - } else { - print "Cannot find version:", fields[numfields] | "cat 2>&1" - } - } - } - - /^\[INDEX\].Timestamp.*Checksum.*Flags.*Name.*Version$/ { - # we better start paying attention now. - found_column_headers = 1 - # - # uncomment the next line for debugging information - #print "found the column headers: ", $0 - } - - ' # end of awk - fi -done | sort -u -# comment out the previous line and uncomment the next when debugging -#done diff --git a/autodeps/linux.prov b/autodeps/linux.prov deleted file mode 100644 index 99e58c4..0000000 --- a/autodeps/linux.prov +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/bash - -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. -IFS=$'\n' -filelist=($(cat)) - -debuginfolist=($(printf "%s\n" "${filelist[@]}" | grep "/usr/lib/debug/")) -filelist=($(printf "%s\n" "${filelist[@]}" | grep -v "/usr/lib/debug/")) - -solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \ - tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \ - cut -d: -f1)) -pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/bin/python.\..$')) -tcllist= -monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$")) -firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/")) -pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$')) -fontlist=($(printf "%s\n" "${filelist[@]}" | egrep -i "/usr/share/fonts/.*\.(ttf|otf|pfa)$")) - -# -# --- Alpha does not mark 64bit dependencies -case `uname -m` in - alpha*) mark64=false ;; - *) mark64=true ;; -esac - -# -# --- Library sonames and weak symbol versions (from glibc). -for f in "${solist[@]}"; do - soname=$(objdump -p "$f" | awk '/SONAME/ {print $2}') - [ -n "$soname" -a -L "$f" ] && continue - [ -z "$soname" ] && soname="${f##*/}" - - if $mark64 && file -L "$f" 2>/dev/null | grep "ELF 64-bit" >/dev/null; then - lib64="()(64bit)" slib64="(64bit)" - else - lib64= slib64= - fi - echo "$soname$lib64" - objdump -p "$f" | awk ' - BEGIN { START=0 ; } - /Version definitions:/ { START=1; } - /^[0-9]/ && (START==1) { print $4; } - /^$/ { START=0; } - ' | \ - while read symbol ; do - echo "$soname($symbol)$slib64" - done -done | sort -u - -# -# --- Perl modules. -[ -x /usr/lib/rpm/perl.prov ] && - printf "%s\n" "${filelist[@]}" | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u - -# -# --- Python modules. -[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] && - printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -P | sort -u - -# -# --- Tcl modules. -[ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] && - printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u - -# -# --- firmware files -[ -x /usr/lib/rpm/firmware.prov -a -n "$firmwarelist" ] && - printf "%s\n" "${firmwarelist[@]}" | /usr/lib/rpm/firmware.prov | sort -u - -# -# --- debuginfo files -[ -x /usr/lib/rpm/debuginfo.prov -a -n "$debuginfolist" ] && - printf "%s\n" "${debuginfolist[@]}" | /usr/lib/rpm/debuginfo.prov | sort -u - -# -# --- Mono exes/dlls -: ${MONO_PREFIX=/usr} -if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then - printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-provides || echo "WARNING: MONO RPM PROVIDES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2 -fi - -# -# --- pkgconfig provides -[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] && - printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -P | sort -u - -# -# --- font provides -[ -x /usr/lib/rpm/fontconfig.prov -a -n "$fontlist" ] && - printf "%s\n" "${fontlist[@]}" | /usr/lib/rpm/fontconfig.prov | sort -u - -# -# --- Kernel module exported symbols -[ -x /usr/lib/rpm/find-provides.ksyms ] && - printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@" - -# -# --- GStreamer provides, codecs -[ -x /usr/lib/rpm/gstreamer-provides ] && - printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u - -exit 0 diff --git a/autodeps/linux.req b/autodeps/linux.req deleted file mode 100644 index cc19f5f..0000000 --- a/autodeps/linux.req +++ /dev/null @@ -1,155 +0,0 @@ -#!/bin/bash - -# -# Auto-generate requirements for executables (both ELF and a.out) and library -# sonames, script interpreters, and perl modules. -# - -ulimit -c 0 - -# -# --- Set needed to 0 for traditional find-requires behavior. -needed=1 -if [ X"$1" = Xldd ]; then - needed=0 -elif [ X"$1" = Xobjdump ]; then - needed=1 -fi - -# -# --- Grab the file manifest and classify files. -#filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"` -filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/')) -exelist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \ - grep -Ev ":.* (commands|script)[, ]" | \ - grep ":.*executable" | cut -d: -f1)) -scriptlist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \ - grep -E ":.* (commands|script)[, ]" | cut -d: -f1)) -liblist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \ - grep ":.*shared object" | cut -d : -f1)) - -interplist=() -perllist=() -pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..')) -tcllist=() -monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$")) -pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$')) - -# -# --- Alpha does not mark 64bit dependencies -case `uname -m` in - alpha*) mark64="" ;; - *) mark64="()(64bit)" ;; -esac - -if [ "$needed" -eq 0 ]; then -# -# --- Executable dependency sonames. - for f in "${exelist[@]}"; do - [ -r "$f" -a -x "$f" ] || continue - lib64=`if file -L "$f" 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` - ldd "$f" | awk '/=>/ { - if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) { - gsub(/'\''"/,"\\&",$1); - printf "%s'$lib64'\n", $1 - } - }' - done | xargs -r -n 1 basename | sort -u - -# -# --- Library dependency sonames. - for f in "${liblist[@]}"; do - [ -r "$f" ] || continue - lib64=`if file -L "$f" 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` - ldd "$f" | awk '/=>/ { - if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) { - gsub(/'\''"/,"\\&",$1); - printf "%s'$lib64'\n", $1 - } - }' - done | xargs -r -n 1 basename | sort -u -fi - -# -# --- Script interpreters. -for f in "${scriptlist[@]}"; do - [ -r "$f" -a -x "$f" ] || continue - interp=`head -n 1 "$f" | sed -ne 's/^\#\![ ]*//p' | cut -d" " -f1` - interplist=("${interplist[@]}" "$interp") - case $interp in - */perl) perllist=("${perllist[@]}" "$f") ;; - esac -done -[ -n "$interplist" ] && { printf "%s\n" "${interplist[@]}" | sort -u ; } - -# -# --- Add perl module files to perllist. -for f in "${filelist[@]}"; do - [ -r "$f" -a "${f%.pm}" != "${f}" ] && perllist=("${perllist[@]}" "$f") -done - -# -# --- Weak symbol versions (from glibc). -[ -n "$mark64" ] && mark64="(64bit)" -for f in "${liblist[@]}" "${exelist[@]}" ; do - [ -r "$f" ] || continue - lib64=`if file -L "$f" 2>/dev/null | \ - grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi` - objdump -p "$f" | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; } - /^$/ { START=0; } - /^Dynamic Section:$/ { START=1; } - (START==1) && /NEEDED/ { - if (needed) { - if ("'$lib64'" != "") { - sub(/$/, "()'$lib64'", $2) ; - } - print $2 ; - } - } - (START==2) && /^[A-Za-z]/ { START=3; } - /^Version References:$/ { START=2; } - (START==2) && /required from/ { - sub(/:/, "", $3); - LIBNAME=$3; - } - (START==2) && (LIBNAME!="") && ($4!="") { - print LIBNAME "(" $4 ")'$lib64'"; - } - ' -done | sort -u - -# -# --- Perl modules. -#[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \ -# printf "%s\n" "${perllist[@]}" | /usr/lib/rpm/perl.req | sort -u - -# -# --- Python modules. -[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] && \ - printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -R | sort -u - -# -# --- Tcl modules. -[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \ - printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.req | sort -u - -# -# --- Mono exes/dlls -: ${MONO_PREFIX=/usr} -if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then - printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-requires || echo "WARNING: MONO RPM REQUIRES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2 -fi - -# -# --- pkgconfig requires -[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] && - printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -R | sort -u - -# -# --- Kernel module imported symbols -[ -x ${0%/*}/find-requires.ksyms ] && - printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@" - -exit 0 diff --git a/autodeps/mint.prov b/autodeps/mint.prov deleted file mode 100644 index a752f8f..0000000 --- a/autodeps/mint.prov +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# -# No shared libs on MiNT yet, sigh. - -echo > /dev/null diff --git a/autodeps/mint.req b/autodeps/mint.req deleted file mode 100644 index a752f8f..0000000 --- a/autodeps/mint.req +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -# -# No shared libs on MiNT yet, sigh. - -echo > /dev/null diff --git a/autodeps/none b/autodeps/none deleted file mode 100644 index 87ad08f..0000000 --- a/autodeps/none +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -cat > /dev/null diff --git a/autodeps/openbsd.prov b/autodeps/openbsd.prov deleted file mode 100644 index 1e7b06e..0000000 --- a/autodeps/openbsd.prov +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------- -# find-provides for OpenBSD-2.5 -# ---------------------------------------------------------- -filelist=$(grep "\\.so" | grep -v "^/lib/ld.so" | xargs file -L 2>/dev/null | grep "OpenBSD.*shared" | cut -d: -f1) - -for f in $filelist; do - echo ${f##*/} -done | sort -u diff --git a/autodeps/openbsd.req b/autodeps/openbsd.req deleted file mode 100644 index ec3bac7..0000000 --- a/autodeps/openbsd.req +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# ---------------------------------------------------------------- -# find-requires for OpenBSD-2.2.x -# how do we know what is required by a.out shared libraries? -# ---------------------------------------------------------------- -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -exelist=`echo $filelist | xargs file | grep -F executable | cut -d: -f1 ` -scriptlist=`echo $filelist | xargs file | grep -E ":.* (commands|script) " | cut -d: -f1 ` - -for f in $exelist; do - if [ -x $f ]; then - ldd $f | /usr/bin/awk '/\=\>/&&!/not found/ { print $3 }' - fi -done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u - -for f in $scriptlist; do - if [ -x $f ]; then - head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1 - fi -done | sort -u diff --git a/autodeps/osf.prov b/autodeps/osf.prov deleted file mode 100644 index 6b54133..0000000 --- a/autodeps/osf.prov +++ /dev/null @@ -1,188 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: osf.prov,v 1.7 2000/10/31 20:47:23 mooney Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-provides is part of RPM, the Red Hat Package Manager. find-provides -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries provided by (contained in) the package. -# -# -# On Digital/Tru64 Unix (OSF1), use `odump -D' to find what libraries a -# package provides. Note that Tru64 Unix 5.x and later come with `ldd', -# but sticking with `odump' works with versions of the OS back to at least -# 3.x, so it's the preferred method. -# -# Example `odump -D' output: -# -#$odump -D /usr/shlib/libc.so -# -# -# -# -# ***DYNAMIC SECTION*** -# Tag Value -# -#/usr/shlib/libc.so: -# UNREFEXTNO: 14. -# LOCAL_GOTNO: 521. -# GOTSYM: 2205. -# LOCAL_GOTNO: 1606. -# GOTSYM: 3289. -# SONAME: libc.so -# TIME_STAMP: (0x34a82daa) Mon Dec 29 17:09:30 1997 -# -# ICHECKSUM: 0x5e955f9b -# IVERSION: osf.1 -# CONFLICTNO: 0. -# RLD_VERSION: 2. -# HASH: 0x000003ff800a82e0 -# STRTAB: 0x000003ff8008aad0 -# SYMTAB: 0x000003ff80094ab0 -# MSYM: 0x000003ff800842c0 -# STRSZ: 40922. -# SYMENT: 24. -# PLTGOT: 0x000003ffc008f240 -# SYMTABNO: 3330. -# BASE_ADDRESS: 0x000003ff80080000 -# HIPAGENO: 0. -# RELSZ: 15296. -# RELENT: 16. -# REL: 0x000003ff80080700 -# LIBLISTNO: 0. -# INIT: 0x000003ff8019c520 -# FINI: 0x000003ff8019c570 -# FLAGS: 0x00000001 -# - -PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# Use `while read ...' instead of a `for f in ...', because there may -# be too many files to stuff into one shell variable. -# -IFS="" -while read f -do - - # - # if it's a shared library, run odump on it. - # - maybe_shared_lib=`file $f | grep -E 'COFF.*shared library'` - if test X"$maybe_shared_lib" != X ; then - odump -D $f 2>/dev/null | awk ' - - BEGIN { - FS = " "; - RS = "\n"; - OFS = ""; - - found_soname = 0; - found_iversion = 0; - - } - - # Uncomment the next line for some debugging info. - #{ print NR , ":", $0 } - - /^[ ]+SONAME: .*[ ]*$/ { - found_soname = 1; - numfields = split($0, internal_name) - if (numfields == 2) { - soname = $2 - # - # we should probably check to see if the soname ends with - # a number (indicating that it contains versioning info, - # possibly in addition to the versioning info in the - # versions field) and generate a warning here. Shared - # libraries should not be built with version info in - # the soname on Digital/Tru64 Unix. - # - } else { - # - # Should never be here. - # - print "Really odd looking soname:", $0 | "cat 1>&2" - exit - } - } - - /^[ ]+IVERSION: .*[ ]*$/ { - if (found_soname == 1) { - numfields = split($0, iversion) - if (numfields == 2) { - version = $2 - # - # handle libraries with multiple versions, like - # 1.1:1.2. Since they really provide both versions, - # we need to generate output for each version. - # - numfields = split(version, versions, ":") - if (numfields > 1) { - for (i = 1; i < numfields; i++) { - print soname, "(", versions[i], ")" - } - # - # let our END routine print out the *last* version - # provided - # - version = versions[numfields] - } - # - # stick a fork in us. - # - found_iversion = 1; - exit - } else { - # - # Should never be here. - # - print "Odd looking library version:", $0 | "cat 1>&2" - exit - } - } else { - # - # found an iversion without an soname. Is that possible? - # - print "Found version but no soname:", $0 | "cat 1>&2" - exit - } - } - - # - # we could probably watch for some other token (like RLD_VERSION) - # that *generally* occurs later in the input than the stuff we watch - # for, and exit if we see it, but it is just as easy to read all - # the output, even after we have seen what we are looking for. - # - - END { - # Uncomment the next line for debugging info - #{ print "END: NR: ", NR } - if ( (found_soname == 1) && (found_iversion == 1) ) { - print soname, "(", version, ")" - exit - } else if (found_soname == 1) { - # - # no library version information - # - print soname - } - # else do nothing - } - ' # end of awk - fi -done | sort -u -#comment out the previous line and uncomment the next line when debugging -#done diff --git a/autodeps/osf.req b/autodeps/osf.req deleted file mode 100644 index 39d00c3..0000000 --- a/autodeps/osf.req +++ /dev/null @@ -1,142 +0,0 @@ -#! /usr/bin/ksh - -# Original Author: Tim Mooney -# $Id: osf.req,v 1.9 2001/09/15 13:49:11 jbj Exp $ -# -# This file is distributed under the terms of the GNU Public License -# -# find-requires is part of RPM, the Red Hat Package Manager. find-requires -# reads a list of full pathnames (in a package) on stdin, and outputs all -# shared libraries the package requires to execute. -# -# On Digital/Tru64 Unix (OSF1), use `odump -Dl' to find the library -# dependencies for an executable. `odump -D' does most of what we need, -# but it doesn't give us library version information, so you must use -# `odump -Dl'. Note that Tru64 5.x and on have `ldd', but this works just -# as well, and works on older versions of the OS. -# -# Example `odump -Dl' output: -# -#$odump -Dl /usr/bin/X11/xterm -# -# -# -# -# ***LIBRARY LIST SECTION*** -# Name Time-Stamp CheckSum Flags Version -#/usr/bin/X11/xterm: -# libXaw.so Dec 9 00:15:35 1997 0x285006d0 0 6.0 -# libXmu.so Dec 9 00:13:36 1997 0x3bf3a33d 0 -# libXt.so Dec 9 00:12:18 1997 0x10dd9a17 0 -# libSM.so Dec 9 00:08:11 1997 0xb64c7082 0 -# libICE.so Dec 9 00:07:52 1997 0x1199be32 0 -# libXext.so Dec 9 00:08:51 1997 0xafcb84d5 0 -# libX11.so Dec 9 00:06:05 1997 0xaa1bf091 0 -# libc.so Dec 8 18:41:11 1997 0x5e955f9b 0 osf.1 - -PATH=/usr/bin:/usr/sbin:/sbin:/usr/ccs/bin -export PATH - -# -# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things -# like `file', et. al. and expect the output to be what we see in the -# C/POSIX locale. Make sure it is so. -# -LANG=C -export LANG - -# -# TVM: switch to using `while read ...' instead of `for f in ...', because -# packages with a large number of files could be too big for one shell variable -# to hold. -# -IFS="" -while read f -do - - # - # Uncomment the next line for addtional debugging: - # echo "read ->$f<-" - - # - # Only run file once per file: - # - file_output=`file $f` - - # - # handle shell scripts first - # - is_shell_script=`echo "$file_output" | grep 'shell script' | \ - cut -d: -f 2 | awk '{ print $1 }'` - - # - # If it's a script... - # - if test X"$is_shell_script" != X ; then - echo "$is_shell_script" - # - # use `continue' to skip back up to the top of the loop. - # We have already done as much as we need to for this - # file, and this saves me from having to have an else, - # and another indent level... ;-) - # - continue - fi - - # - # The `else' here is implied by the `continue' above... - # - - # - # it might be a shared library. - # - - maybe_shared_lib=`echo "$file_output" | grep 'executable'` - if test X"$maybe_shared_lib" != X ; then - - odump -Dl $f 2>/dev/null \ - | awk ' - - # - # Since this entire awk script is enclosed in single quotes, - # you need to be careful to not use single quotes, even in awk - # comments, if you modify this script. - # - - BEGIN { - found_program_name = 0; - FS = " "; - RS = "\n"; - OFS=""; - } - - # uncomment the next line for debugging information - #{ print "Saw input:", $0 } - - found_program_name == 1 && $0 !~ /^$/ { - - # uncomment for debugging information - #print "found shared library: $0" - - # get the library name (field 1) and the library version - # (field 8) if present. - numfields = split($0,fields) - if (numfields == 7) { - print fields[1] - } else if (numfields == 8) { - print fields[1], "(", fields[8], ")" - } - } - - /^.*: *$/ { - found_program_name = 1 - # - # uncomment the next line for debugging information - #print "found the program name: ", $1 - } - - ' # end of awk - fi -done | sort -u -# comment out the previous line and uncomment the next when debugging -# done diff --git a/autodeps/solaris.prov b/autodeps/solaris.prov deleted file mode 100644 index 6e0fe9f..0000000 --- a/autodeps/solaris.prov +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# This script reads filenames from STDIN and outputs any relevant provides -# information that needs to be included in the package. - -PATH=/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin -export PATH - -filelist=`grep "lib.*\\.so" | xargs /usr/ucb/file -L 2>/dev/null |\ - grep "ELF.*dynamic lib" | cut -d: -f1 | sort -u` -for I in $filelist; do - basename $I -done - diff --git a/autodeps/solaris.req b/autodeps/solaris.req deleted file mode 100644 index 05e4024..0000000 --- a/autodeps/solaris.req +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -# note this works for both a.out and ELF executables - -PATH=/usr/bin:/usr/ccs/bin:/usr/sbin:/sbin -export PATH - -ulimit -c 0 - -filelist=`sed "s/['\"]/\\\&/g"` -[ -z "$filelist" ] && exit #emulate -r option for xargs - -for f in `echo $filelist | xargs file | grep -F executable | cut -d: -f1`; do - ldd $f 2>/dev/null | awk '/\=\>/ { print $1 }' -done | sort -u | sed "s/['\"]/\\\&/g" | xargs -n 1 basename | sort -u - diff --git a/build/Makefile.am b/build/Makefile.am index 1a540bc..2fa3c3d 100644 --- a/build/Makefile.am +++ b/build/Makefile.am @@ -1,6 +1,10 @@ # Makefile for rpmbuild library. +include $(top_srcdir)/rpm.am +AM_CFLAGS = @RPMCFLAGS@ + AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/ +AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@ AM_CPPFLAGS += @WITH_NSS_INCLUDE@ AM_CPPFLAGS += @WITH_MAGIC_INCLUDE@ AM_CPPFLAGS += @WITH_POPT_INCLUDE@ @@ -16,10 +20,15 @@ librpmbuild_la_SOURCES = \ parsePolicies.c policies.c \ rpmbuild_internal.h rpmbuild_misc.h -librpmbuild_la_LDFLAGS = -version-info 4:0:1 +librpmbuild_la_LDFLAGS = -version-info $(rpm_version_info) librpmbuild_la_LIBADD = \ $(top_builddir)/lib/librpm.la \ $(top_builddir)/rpmio/librpmio.la \ $(top_builddir)/misc/libmisc.la \ + @LTLIBICONV@ \ @WITH_POPT_LIB@ \ @WITH_MAGIC_LIB@ + +if LIBDW +librpmbuild_la_LIBADD += @WITH_LIBELF_LIB@ @WITH_LIBDW_LIB@ +endif diff --git a/build/build.c b/build/build.c index 04b039c..81152e5 100644 --- a/build/build.c +++ b/build/build.c @@ -69,7 +69,7 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, pid_t pid; pid_t child; int status; - rpmRC rc; + rpmRC rc = RPMRC_FAIL; /* assume failure */ switch (what) { case RPMBUILD_PREP: @@ -118,13 +118,11 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, fd = rpmMkTempFile(spec->rootDir, &scriptName); if (Ferror(fd)) { rpmlog(RPMLOG_ERR, _("Unable to open temp file: %s\n"), Fstrerror(fd)); - rc = RPMRC_FAIL; goto exit; } if ((fp = fdopen(Fileno(fd), "w")) == NULL) { rpmlog(RPMLOG_ERR, _("Unable to open stream: %s\n"), strerror(errno)); - rc = RPMRC_FAIL; goto exit; } @@ -151,7 +149,6 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, } if (buildDir && buildDir[0] != '/') { - rc = RPMRC_FAIL; goto exit; } @@ -160,8 +157,6 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd); if (!(child = fork())) { - /* NSPR messes with SIGPIPE, reset to default for the kids */ - signal(SIGPIPE, SIG_DFL); errno = 0; (void) execvp(argv[0], (char *const *)argv); @@ -176,21 +171,19 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, if (pid == -1) { rpmlog(RPMLOG_ERR, _("Error executing scriptlet %s (%s)\n"), scriptName, name); - rc = RPMRC_FAIL; goto exit; } if (!WIFEXITED(status) || WEXITSTATUS(status)) { rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"), scriptName, name); - rc = RPMRC_FAIL; } else rc = RPMRC_OK; exit: Fclose(fd); if (scriptName) { - if (rc == RPMRC_OK) + if (rc == RPMRC_OK && !rpmIsDebug()) (void) unlink(scriptName); free(scriptName); } @@ -209,6 +202,21 @@ static rpmRC buildSpec(BTA_t buildArgs, rpmSpec spec, int what) int test = (what & RPMBUILD_NOBUILD); char *cookie = buildArgs->cookie ? xstrdup(buildArgs->cookie) : NULL; + if (rpmExpandNumeric("%{?source_date_epoch_from_changelog}") && + getenv("SOURCE_DATE_EPOCH") == NULL) { + /* Use date of first (== latest) changelog entry */ + Header h = spec->packages->header; + struct rpmtd_s td; + if (headerGet(h, RPMTAG_CHANGELOGTIME, &td, (HEADERGET_MINMEM|HEADERGET_RAW))) { + char sdestr[22]; + snprintf(sdestr, sizeof(sdestr), "%lli", + (long long) rpmtdGetNumber(&td)); + rpmlog(RPMLOG_NOTICE, _("setting %s=%s\n"), "SOURCE_DATE_EPOCH", sdestr); + setenv("SOURCE_DATE_EPOCH", sdestr, 0); + rpmtdFreeData(&td); + } + } + /* XXX TODO: rootDir is only relevant during build, eliminate from spec */ spec->rootDir = buildArgs->rootdir; if (!spec->recursing && spec->BACount) { diff --git a/build/expression.c b/build/expression.c index a71ad09..581a79e 100644 --- a/build/expression.c +++ b/build/expression.c @@ -105,7 +105,6 @@ typedef struct _parseState { char *p; /*!< current position in expression string */ int nextToken; /*!< current lookahead token */ Value tokenValue; /*!< valid when TOK_INTEGER or TOK_STRING */ - rpmSpec spec; /*!< spec file that we are parsing inside of */ } *ParseState; @@ -644,7 +643,7 @@ static Value doLogical(ParseState state) return v1; } -int parseExpressionBoolean(rpmSpec spec, const char *expr) +int parseExpressionBoolean(const char *expr) { struct _parseState state; int result = -1; @@ -654,7 +653,6 @@ int parseExpressionBoolean(rpmSpec spec, const char *expr) /* Initialize the expression parser state. */ state.p = state.str = xstrdup(expr); - state.spec = spec; state.nextToken = 0; state.tokenValue = NULL; (void) rdToken(&state); diff --git a/build/files.c b/build/files.c index 6f2cc7d..67268d4 100644 --- a/build/files.c +++ b/build/files.c @@ -9,11 +9,17 @@ #define MYALLPERMS 07777 #include +#include #include #if WITH_CAP #include #endif +#if HAVE_LIBDW +#include +#include +#endif + #include #include #include @@ -21,13 +27,8 @@ #include #include -#if HAVE_GELF_H -#include -#endif - #include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */ -#include "misc/fts.h" -#include "lib/cpio.h" +#include "misc/rpmfts.h" #include "lib/rpmfi_internal.h" /* XXX fi->apath */ #include "lib/rpmug.h" #include "build/rpmbuild_internal.h" @@ -37,8 +38,29 @@ #include #define SKIPSPACE(s) { while (*(s) && risspace(*(s))) (s)++; } -#define SKIPWHITE(_x) {while(*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} -#define SKIPNONWHITE(_x){while(*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPWHITE(_x) {while (*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while (*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} + +/* the following defines must be in sync with the equally hardcoded paths from + * scripts/find-debuginfo.sh + */ +#define BUILD_ID_DIR "/usr/lib/.build-id" +#define DEBUG_SRC_DIR "/usr/src/debug" +#define DEBUG_LIB_DIR "/usr/lib/debug" +#define DEBUG_LIB_PREFIX "/usr/lib/debug/" +#define DEBUG_ID_DIR "/usr/lib/debug/.build-id" +#define DEBUG_DWZ_DIR "/usr/lib/debug/.dwz" + +#undef HASHTYPE +#undef HTKEYTYPE +#undef HTDATATYPE +#define HASHTYPE fileRenameHash +#define HTKEYTYPE const char * +#define HTDATATYPE const char * +#include "lib/rpmhash.C" +#undef HASHTYPE +#undef HTKEYTYPE +#undef HTDATATYPE /** */ @@ -85,8 +107,8 @@ typedef struct FileListRec_s { char *diskPath; /* get file from here */ char *cpioPath; /* filename in cpio archive */ - const char *uname; - const char *gname; + rpmsid uname; + rpmsid gname; unsigned flags; specfFlags specdFlags; /* which attributes have been explicitly specified. */ rpmVerifyFlags verifyFlags; @@ -97,27 +119,17 @@ typedef struct FileListRec_s { /** */ typedef struct AttrRec_s { - char *ar_fmodestr; - char *ar_dmodestr; - char *ar_user; - char *ar_group; + rpmsid ar_fmodestr; + rpmsid ar_dmodestr; + rpmsid ar_user; + rpmsid ar_group; mode_t ar_fmode; mode_t ar_dmode; } * AttrRec; -static struct AttrRec_s root_ar = { NULL, NULL, "root", "root", 0, 0 }; - /* list of files */ static StringBuf check_fileList = NULL; -typedef struct specialDir_s { - char * dirname; - ARGV_t files; - struct AttrRec_s ar; - struct AttrRec_s def_ar; - rpmFlags sdtype; -} * specialDir; - typedef struct FileEntry_s { rpmfileAttrs attrFlags; specfFlags specdFlags; @@ -134,6 +146,23 @@ typedef struct FileEntry_s { int isDir; } * FileEntry; +typedef struct specialDir_s { + char * dirname; + ARGV_t files; + struct AttrRec_s ar; + struct AttrRec_s def_ar; + rpmFlags sdtype; + + int entriesCount; + int entriesAlloced; + + struct { + struct FileEntry_s defEntry; + struct FileEntry_s curEntry; + } *entries; + +} * specialDir; + typedef struct FileRecords_s { FileListRec recs; int alloced; @@ -146,11 +175,13 @@ typedef struct FileRecords_s { typedef struct FileList_s { /* global filelist state */ char * buildRoot; + size_t buildRootLen; int processingFailed; int haveCaps; int largeFiles; ARGV_t docDirs; rpmBuildPkgFlags pkgFlags; + rpmstrPool pool; /* actual file records */ struct FileRecords_s files; @@ -162,63 +193,45 @@ typedef struct FileList_s { struct FileEntry_s cur; } * FileList; -/** - */ static void nullAttrRec(AttrRec ar) { - ar->ar_fmodestr = NULL; - ar->ar_dmodestr = NULL; - ar->ar_user = NULL; - ar->ar_group = NULL; - ar->ar_fmode = 0; - ar->ar_dmode = 0; + memset(ar, 0, sizeof(*ar)); } -/** - */ -static void freeAttrRec(AttrRec ar) -{ - ar->ar_fmodestr = _free(ar->ar_fmodestr); - ar->ar_dmodestr = _free(ar->ar_dmodestr); - ar->ar_user = _free(ar->ar_user); - ar->ar_group = _free(ar->ar_group); - /* XXX doesn't free ar (yet) */ - return; -} - -/** - */ static void dupAttrRec(const AttrRec oar, AttrRec nar) { if (oar == nar) return; - freeAttrRec(nar); - nar->ar_fmodestr = (oar->ar_fmodestr ? xstrdup(oar->ar_fmodestr) : NULL); - nar->ar_dmodestr = (oar->ar_dmodestr ? xstrdup(oar->ar_dmodestr) : NULL); - nar->ar_user = (oar->ar_user ? xstrdup(oar->ar_user) : NULL); - nar->ar_group = (oar->ar_group ? xstrdup(oar->ar_group) : NULL); - nar->ar_fmode = oar->ar_fmode; - nar->ar_dmode = oar->ar_dmode; + *nar = *oar; /* struct assignment */ } -#if 0 -/** - */ -static void dumpAttrRec(const char * msg, AttrRec ar) +/* Creates a default $defattr string. Can be used with argvAdd(). + Caller owns the new string which needs to be freed when done. */ +static char *mkattr(void) { - if (msg) - fprintf(stderr, "%s:\t", msg); - fprintf(stderr, "(%s, %s, %s, %s)\n", - ar->ar_fmodestr, - ar->ar_user, - ar->ar_group, - ar->ar_dmodestr); + char *s = NULL; + rasprintf(&s, "%s(644,%s,%s,755)", "%defattr", UID_0_USER, GID_0_GROUP); + return s; +} + +static void copyFileEntry(FileEntry src, FileEntry dest) +{ + /* Copying struct makes just shallow copy */ + *dest = *src; + + /* Do also deep copying */ + if (src->langs != NULL) { + dest->langs = argvNew(); + argvAppend(&dest->langs, src->langs); + } + + if (src->caps != NULL) { + dest->caps = xstrdup(src->caps); + } } -#endif static void FileEntryFree(FileEntry entry) { - freeAttrRec(&(entry->ar)); argvFree(entry->langs); memset(entry, 0, sizeof(*entry)); } @@ -290,42 +303,6 @@ static VFA_t const verifyAttrs[] = { { NULL, 0 } }; -/** - * Add 'provides' information to debuginfo package - * @param h Header information from debuginfo package - * @return nothing - */ -static void addPackageProvides_for_debuginfo_pkg(Header h) -{ - const char *arch, *name; - char *evr, *isaprov; - rpmsenseFlags pflags = RPMSENSE_EQUAL; - - /* = provide */ - name = headerGetString(h, RPMTAG_NAME); - arch = headerGetString(h, RPMTAG_ARCH); - evr = headerGetAsString(h, RPMTAG_EVR); - headerPutString(h, RPMTAG_PROVIDENAME, name); - headerPutString(h, RPMTAG_PROVIDEVERSION, evr); - headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); - - /* - * () = provide - * FIXME: noarch needs special casing for now as BuildArch: noarch doesn't - * cause reading in the noarch macros :-/ - */ - - isaprov = rpmExpand(name, "%{?_isa}", NULL); - if (!rstreq(arch, "noarch") && !rstreq(name, isaprov)) { - headerPutString(h, RPMTAG_PROVIDENAME, isaprov); - headerPutString(h, RPMTAG_PROVIDEVERSION, evr); - headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); - } - - free(isaprov); - free(evr); -} - static rpmFlags vfaMatch(VFA_t *attrs, const char *token, rpmFlags *flags) { VFA_t *vfa; @@ -413,7 +390,11 @@ exit: return rc; } -#define isAttrDefault(_ars) ((_ars)[0] == '-' && (_ars)[1] == '\0') +static int isAttrDefault(rpmstrPool pool, rpmsid arsid) +{ + const char *ars = rpmstrPoolStr(pool, arsid); + return (ars && ars[0] == '-' && ars[1] == '\0'); +} /** * Parse %dev from file manifest. @@ -427,6 +408,7 @@ static rpmRC parseForDev(char * buf, FileEntry cur) const char * errstr = NULL; char *p, *pe, *q = NULL; rpmRC rc = RPMRC_FAIL; /* assume error */ + char *attr_parameters = NULL; if ((p = strstr(buf, (name = "%dev"))) == NULL) return RPMRC_OK; @@ -452,6 +434,10 @@ static rpmRC parseForDev(char * buf, FileEntry cur) /* Localize. Erase parsed string */ q = xmalloc((pe-p) + 1); rstrlcpy(q, p, (pe-p) + 1); + + attr_parameters = xmalloc((pe-p) + 1); + rstrlcpy(attr_parameters, p, (pe-p) + 1); + while (p <= pe) *p++ = ' '; @@ -501,23 +487,26 @@ static rpmRC parseForDev(char * buf, FileEntry cur) exit: if (rc) { - rpmlog(RPMLOG_ERR, _("Missing %s in %s %s\n"), errstr, name, p); + rpmlog(RPMLOG_ERR, _("Missing %s in %s(%s)\n"), errstr, name, attr_parameters); } + free(attr_parameters); free(q); return rc; } /** * Parse %attr and %defattr from file manifest. + * @param pool string pool * @param buf current spec file line * @param def parse for %defattr or %attr? * @param entry file entry data (current / default) * @return 0 on success */ -static rpmRC parseForAttr(char * buf, int def, FileEntry entry) +static rpmRC parseForAttr(rpmstrPool pool, char * buf, int def, FileEntry entry) { const char *name = def ? "%defattr" : "%attr"; char *p, *pe, *q = NULL; + char *attr_parameters = NULL; int x; struct AttrRec_s arbuf; AttrRec ar = &arbuf; @@ -555,6 +544,10 @@ static rpmRC parseForAttr(char * buf, int def, FileEntry entry) /* Localize. Erase parsed string */ q = xmalloc((pe-p) + 1); rstrlcpy(q, p, (pe-p) + 1); + + attr_parameters = xmalloc((pe-p) + 1); + rstrlcpy(attr_parameters, p, (pe-p) + 1); + while (p <= pe) *p++ = ' '; @@ -563,61 +556,61 @@ static rpmRC parseForAttr(char * buf, int def, FileEntry entry) p = q; SKIPWHITE(p); if (*p != '\0') { pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; - ar->ar_fmodestr = p; + ar->ar_fmodestr = rpmstrPoolId(pool, p, 1); p = pe; SKIPWHITE(p); } if (*p != '\0') { pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; - ar->ar_user = p; + ar->ar_user = rpmstrPoolId(pool, p, 1); p = pe; SKIPWHITE(p); } if (*p != '\0') { pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; - ar->ar_group = p; + ar->ar_group = rpmstrPoolId(pool, p, 1); p = pe; SKIPWHITE(p); } if (*p != '\0' && def) { /* %defattr */ pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; - ar->ar_dmodestr = p; + ar->ar_dmodestr = rpmstrPoolId(pool, p, 1); p = pe; SKIPWHITE(p); } if (!(ar->ar_fmodestr && ar->ar_user && ar->ar_group) || *p != '\0') { - rpmlog(RPMLOG_ERR, _("Bad syntax: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad syntax: %s(%s)\n"), name, attr_parameters); goto exit; } /* Do a quick test on the mode argument and adjust for "-" */ - if (ar->ar_fmodestr && !isAttrDefault(ar->ar_fmodestr)) { + if (ar->ar_fmodestr && !isAttrDefault(pool, ar->ar_fmodestr)) { unsigned int ui; - x = sscanf(ar->ar_fmodestr, "%o", &ui); + x = sscanf(rpmstrPoolStr(pool, ar->ar_fmodestr), "%o", &ui); if ((x == 0) || (ar->ar_fmode & ~MYALLPERMS)) { - rpmlog(RPMLOG_ERR, _("Bad mode spec: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad mode spec: %s(%s)\n"), name, attr_parameters); goto exit; } ar->ar_fmode = ui; } else { - ar->ar_fmodestr = NULL; + ar->ar_fmodestr = 0; } - if (ar->ar_dmodestr && !isAttrDefault(ar->ar_dmodestr)) { + if (ar->ar_dmodestr && !isAttrDefault(pool, ar->ar_dmodestr)) { unsigned int ui; - x = sscanf(ar->ar_dmodestr, "%o", &ui); + x = sscanf(rpmstrPoolStr(pool, ar->ar_dmodestr), "%o", &ui); if ((x == 0) || (ar->ar_dmode & ~MYALLPERMS)) { - rpmlog(RPMLOG_ERR, _("Bad dirmode spec: %s(%s)\n"), name, q); + rpmlog(RPMLOG_ERR, _("Bad dirmode spec: %s(%s)\n"), name, attr_parameters); goto exit; } ar->ar_dmode = ui; } else { - ar->ar_dmodestr = NULL; + ar->ar_dmodestr = 0; } - if (!(ar->ar_user && !isAttrDefault(ar->ar_user))) { - ar->ar_user = NULL; + if (!(ar->ar_user && !isAttrDefault(pool, ar->ar_user))) { + ar->ar_user = 0; } - if (!(ar->ar_group && !isAttrDefault(ar->ar_group))) { - ar->ar_group = NULL; + if (!(ar->ar_group && !isAttrDefault(pool, ar->ar_group))) { + ar->ar_group = 0; } dupAttrRec(ar, &(entry->ar)); @@ -628,6 +621,7 @@ static rpmRC parseForAttr(char * buf, int def, FileEntry entry) exit: free(q); + free(attr_parameters); return rc; } @@ -862,7 +856,9 @@ static VFA_t const virtualAttrs[] = { { "%readme", RPMFILE_README }, { "%license", RPMFILE_LICENSE }, { "%pubkey", RPMFILE_PUBKEY }, - { "%manifest", RPMFILE_SECMANIFEST }, + { "%missingok", RPMFILE_MISSINGOK }, + { "%artifact", RPMFILE_ARTIFACT }, + { "%manifest", RPMFILE_SECMANIFEST }, { NULL, 0 } }; @@ -943,7 +939,7 @@ static int isHardLink(FileListRec flp, FileListRec tlp) /** * Verify that file attributes scope over hardlinks correctly. * If partial hardlink sets are possible, then add tracking dependency. - * @param fl package file records + * @param files package file records * @return 1 if partial hardlink sets can exist, 0 otherwise. */ static int checkHardLinks(FileRecords files) @@ -982,22 +978,35 @@ static int seenHardLink(FileRecords files, FileListRec flp, rpm_ino_t *fileid) * @todo Should directories have %doc/%config attributes? (#14531) * @todo Remove RPMTAG_OLDFILENAMES, add dirname/basename instead. * @param fl package file tree walk data - * @retval *fip file info for package - * @param h - * @param isSrc + * @param pkg (sub) package + * @param isSrc pass 1 for source packages 0 otherwise */ -static void genCpioListAndHeader(FileList fl, - rpmfi * fip, Header h, int isSrc) +static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc) { - int _addDotSlash = !(isSrc || rpmExpandNumeric("%{_noPayloadPrefix}")); - size_t apathlen = 0; - size_t dpathlen = 0; - size_t skipLen = 0; FileListRec flp; char buf[BUFSIZ]; - int i; + int i, npaths = 0; uint32_t defaultalgo = PGPHASHALGO_MD5, digestalgo; rpm_loff_t totalFileSize = 0; + Header h = pkg->header; /* just a shortcut */ + int override_date = 0; + time_t source_date_epoch; + char *srcdate = getenv("SOURCE_DATE_EPOCH"); + + /* Limit the maximum date to SOURCE_DATE_EPOCH if defined + * similar to the tar --clamp-mtime option + * https://reproducible-builds.org/specs/source-date-epoch/ + */ + if (srcdate && rpmExpandNumeric("%{?clamp_mtime_to_source_date_epoch}")) { + char *endptr; + errno = 0; + source_date_epoch = strtol(srcdate, &endptr, 10); + if (srcdate == endptr || *endptr || errno != 0) { + rpmlog(RPMLOG_ERR, _("unable to parse %s=%s\n"), "SOURCE_DATE_EPOCH", srcdate); + exit(28); + } + override_date = 1; + } /* * See if non-md5 file digest algorithm is requested. If not @@ -1015,16 +1024,40 @@ static void genCpioListAndHeader(FileList fl, digestalgo); digestalgo = defaultalgo; } - + + /* Adjust paths if needed */ + if (!isSrc && pkg->removePostfixes) { + pkg->fileRenameMap = fileRenameHashCreate(fl->files.used, + rstrhash, strcmp, + (fileRenameHashFreeKey)rfree, (fileRenameHashFreeData)rfree); + for (i = 0, flp = fl->files.recs; i < fl->files.used; i++, flp++) { + char * cpiopath = flp->cpioPath; + char * cpiopath_orig = xstrdup(cpiopath); + + for (ARGV_const_t postfix_p = pkg->removePostfixes; *postfix_p; postfix_p++) { + int len = strlen(*postfix_p); + int plen = strlen(cpiopath); + if (len <= plen && !strncmp(cpiopath+plen-len, *postfix_p, len)) { + cpiopath[plen-len] = '\0'; + if (plen-len > 0 && cpiopath[plen-len-1] == '/') { + cpiopath[plen-len-1] = '\0'; + } + } + } + if (strcmp(cpiopath_orig, cpiopath)) + fileRenameHashAddEntry(pkg->fileRenameMap, xstrdup(cpiopath), cpiopath_orig); + else + _free(cpiopath_orig); + } + } + /* Sort the big list */ qsort(fl->files.recs, fl->files.used, sizeof(*(fl->files.recs)), compareFileListRecs); - /* Generate the header. */ - if (! isSrc) { - skipLen = 1; - } + pkg->dpaths = xmalloc((fl->files.used + 1) * sizeof(*pkg->dpaths)); + /* Generate the header. */ for (i = 0, flp = fl->files.recs; i < fl->files.used; i++, flp++) { rpm_ino_t fileid = flp - fl->files.recs; @@ -1080,29 +1113,26 @@ static void genCpioListAndHeader(FileList fl, } /* Skip files that were marked with %exclude. */ - if (flp->flags & RPMFILE_EXCLUDE) continue; + if (flp->flags & RPMFILE_EXCLUDE) + { + argvAdd(&pkg->fileExcludeList, flp->cpioPath); + continue; + } - /* Omit '/' and/or URL prefix, leave room for "./" prefix */ - apathlen += (strlen(flp->cpioPath) - skipLen + (_addDotSlash ? 3 : 1)); + /* Collect on-disk paths for archive creation */ + pkg->dpaths[npaths++] = xstrdup(flp->diskPath); - /* Leave room for both dirname and basename NUL's */ - dpathlen += (strlen(flp->diskPath) + 2); - - /* - * Make the header. Store the on-disk path to OLDFILENAMES for - * cpio list generation purposes for now, final path temporarily - * to ORIGFILENAMES, to be swapped later into OLDFILENAMES. - */ - headerPutString(h, RPMTAG_OLDFILENAMES, flp->diskPath); - headerPutString(h, RPMTAG_ORIGFILENAMES, flp->cpioPath); - headerPutString(h, RPMTAG_FILEUSERNAME, flp->uname); - headerPutString(h, RPMTAG_FILEGROUPNAME, flp->gname); + headerPutString(h, RPMTAG_OLDFILENAMES, flp->cpioPath); + headerPutString(h, RPMTAG_FILEUSERNAME, + rpmstrPoolStr(fl->pool, flp->uname)); + headerPutString(h, RPMTAG_FILEGROUPNAME, + rpmstrPoolStr(fl->pool, flp->gname)); /* Only use 64bit filesizes tag if required. */ if (fl->largeFiles) { rpm_loff_t rsize64 = (rpm_loff_t)flp->fl_size; headerPutUint64(h, RPMTAG_LONGFILESIZES, &rsize64, 1); - /* XXX TODO: add rpmlib() dependency for large files */ + (void) rpmlibNeedsFeature(pkg, "LargeFiles", "4.12.0-1"); } else { rpm_off_t rsize32 = (rpm_off_t)flp->fl_size; headerPutUint32(h, RPMTAG_FILESIZES, &rsize32, 1); @@ -1114,6 +1144,9 @@ static void genCpioListAndHeader(FileList fl, } } + if (override_date && flp->fl_mtime > source_date_epoch) { + flp->fl_mtime = source_date_epoch; + } /* * For items whose size varies between systems, always explicitly * cast to the header type before inserting. @@ -1152,7 +1185,7 @@ static void genCpioListAndHeader(FileList fl, } buf[0] = '\0'; - if (S_ISREG(flp->fl_mode)) + if (S_ISREG(flp->fl_mode) && !(flp->flags & RPMFILE_GHOST)) (void) rpmDoDigest(digestalgo, flp->diskPath, 1, (unsigned char *)buf, NULL); headerPutString(h, RPMTAG_FILEDIGESTS, buf); @@ -1167,7 +1200,7 @@ static void genCpioListAndHeader(FileList fl, } else { buf[llen] = '\0'; if (buf[0] == '/' && !rstreq(fl->buildRoot, "/") && - rstreqn(buf, fl->buildRoot, strlen(fl->buildRoot))) { + rstreqn(buf, fl->buildRoot, fl->buildRootLen)) { rpmlog(RPMLOG_ERR, _("Symlink points to BuildRoot: %s -> %s\n"), flp->cpioPath, buf); @@ -1193,6 +1226,7 @@ static void genCpioListAndHeader(FileList fl, headerPutUint32(h, RPMTAG_FILEFLAGS, &(flp->flags) ,1); } + pkg->dpaths[npaths] = NULL; if (totalFileSize < UINT32_MAX) { rpm_off_t totalsize = totalFileSize; @@ -1204,69 +1238,31 @@ static void genCpioListAndHeader(FileList fl, if (digestalgo != defaultalgo) { headerPutUint32(h, RPMTAG_FILEDIGESTALGO, &digestalgo, 1); - rpmlibNeedsFeature(h, "FileDigests", "4.6.0-1"); + rpmlibNeedsFeature(pkg, "FileDigests", "4.6.0-1"); } if (fl->haveCaps) { - rpmlibNeedsFeature(h, "FileCaps", "4.6.1-1"); + rpmlibNeedsFeature(pkg, "FileCaps", "4.6.1-1"); } - if (_addDotSlash) - (void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1"); - - { - struct rpmtd_s filenames; - rpmfiFlags flags = RPMFI_NOHEADER|RPMFI_NOFILEUSER|RPMFI_NOFILEGROUP; - rpmfi fi; - int fc; - const char *fn; - char *a, **apath; + if (!isSrc && !rpmExpandNumeric("%{_noPayloadPrefix}")) + (void) rpmlibNeedsFeature(pkg, "PayloadFilesHavePrefix", "4.0-1"); /* rpmfiNew() only groks compressed filelists */ headerConvert(h, HEADERCONV_COMPRESSFILELIST); - fi = rpmfiNew(NULL, h, RPMTAG_BASENAMES, flags); + pkg->cpioList = rpmfilesNew(NULL, h, RPMTAG_BASENAMES, + (RPMFI_NOFILEUSER|RPMFI_NOFILEGROUP)); - if (fi == NULL) { + if (pkg->cpioList == NULL || rpmfilesFC(pkg->cpioList) != npaths) { fl->processingFailed = 1; - return; } - /* - * Grab the real filenames from ORIGFILENAMES and put into OLDFILENAMES, - * remove temporary cruft and side-effects from filelist compression - * for rpmfiNew(). - */ - headerGet(h, RPMTAG_ORIGFILENAMES, &filenames, HEADERGET_ALLOC); - headerDel(h, RPMTAG_ORIGFILENAMES); - headerDel(h, RPMTAG_BASENAMES); - headerDel(h, RPMTAG_DIRNAMES); - headerDel(h, RPMTAG_DIRINDEXES); - rpmtdSetTag(&filenames, RPMTAG_OLDFILENAMES); - headerPut(h, &filenames, HEADERPUT_DEFAULT); - - /* Create hge-style archive path array, normally adding "./" */ - fc = rpmtdCount(&filenames); - apath = xmalloc(fc * sizeof(*apath) + apathlen + 1); - a = (char *)(apath + fc); - *a = '\0'; - rpmtdInit(&filenames); - for (int i = 0; (fn = rpmtdNextString(&filenames)); i++) { - apath[i] = a; - if (_addDotSlash) - a = stpcpy(a, "./"); - a = stpcpy(a, (fn + skipLen)); - a++; /* skip apath NUL */ - } - fi->apath = apath; - *fip = fi; - rpmtdFreeData(&filenames); - } - - /* Compress filelist unless legacy format requested */ - if (!(fl->pkgFlags & RPMBUILD_PKG_NODIRTOKENS)) { - headerConvert(h, HEADERCONV_COMPRESSFILELIST); + if (fl->pkgFlags & RPMBUILD_PKG_NODIRTOKENS) { + /* Uncompress filelist if legacy format requested */ + headerConvert(h, HEADERCONV_EXPANDFILELIST); + } else { /* Binary packages with dirNames cannot be installed by legacy rpm. */ - (void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1"); + (void) rpmlibNeedsFeature(pkg, "CompressedFileNames", "3.0.4-1"); } } @@ -1289,6 +1285,7 @@ static void FileListFree(FileList fl) FileRecordsFree(&(fl->files)); free(fl->buildRoot); argvFree(fl->docDirs); + rpmstrPoolFree(fl->pool); } /* forward ref */ @@ -1346,6 +1343,10 @@ static rpmRC addFile(FileList fl, const char * diskPath, } cpioPath = diskPath; + if (strncmp(diskPath, fl->buildRoot, fl->buildRootLen)) { + rpmlog(RPMLOG_ERR, _("Path is outside buildroot: %s\n"), diskPath); + goto exit; + } /* Path may have prepended buildRoot, so locate the original filename. */ /* @@ -1359,7 +1360,7 @@ static rpmRC addFile(FileList fl, const char * diskPath, * */ if (fl->buildRoot && !rstreq(fl->buildRoot, "/")) - cpioPath += strlen(fl->buildRoot); + cpioPath += fl->buildRootLen; /* XXX make sure '/' can be packaged also */ if (*cpioPath == '\0') @@ -1394,6 +1395,12 @@ static rpmRC addFile(FileList fl, const char * diskPath, } } + /* Error out when a non-directory is specified as one in spec */ + if (fl->cur.isDir && (statp == &statbuf) && !S_ISDIR(statp->st_mode)) { + rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath); + goto exit; + } + /* Don't recurse into explicit %dir, don't double-recurse from fts */ if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) { return recurseDir(fl, diskPath); @@ -1404,9 +1411,15 @@ static rpmRC addFile(FileList fl, const char * diskPath, fileGid = statp->st_gid; /* Explicit %attr() always wins */ - if (fl->cur.ar.ar_fmodestr != NULL) { - fileMode &= S_IFMT; - fileMode |= fl->cur.ar.ar_fmode; + if (fl->cur.ar.ar_fmodestr) { + if (S_ISLNK(fileMode)) { + rpmlog(RPMLOG_WARNING, + "Explicit %%attr() mode not applicable to symlink: %s\n", + diskPath); + } else { + fileMode &= S_IFMT; + fileMode |= fl->cur.ar.ar_fmode; + } } else { /* ...but %defattr() for directories and files is different */ if (S_ISDIR(fileMode)) { @@ -1414,22 +1427,22 @@ static rpmRC addFile(FileList fl, const char * diskPath, fileMode &= S_IFMT; fileMode |= fl->def.ar.ar_dmode; } - } else if (fl->def.ar.ar_fmodestr) { + } else if (!S_ISLNK(fileMode) && fl->def.ar.ar_fmodestr) { fileMode &= S_IFMT; fileMode |= fl->def.ar.ar_fmode; } } if (fl->cur.ar.ar_user) { - fileUname = fl->cur.ar.ar_user; + fileUname = rpmstrPoolStr(fl->pool, fl->cur.ar.ar_user); } else if (fl->def.ar.ar_user) { - fileUname = fl->def.ar.ar_user; + fileUname = rpmstrPoolStr(fl->pool, fl->def.ar.ar_user); } else { fileUname = rpmugUname(fileUid); } if (fl->cur.ar.ar_group) { - fileGname = fl->cur.ar.ar_group; + fileGname = rpmstrPoolStr(fl->pool, fl->cur.ar.ar_group); } else if (fl->def.ar.ar_group) { - fileGname = fl->def.ar.ar_group; + fileGname = rpmstrPoolStr(fl->pool, fl->def.ar.ar_group); } else { fileGname = rpmugGname(fileGid); } @@ -1459,11 +1472,13 @@ static rpmRC addFile(FileList fl, const char * diskPath, flp->fl_mode = fileMode; flp->fl_uid = fileUid; flp->fl_gid = fileGid; + if (S_ISDIR(fileMode)) + flp->fl_size = 0; flp->cpioPath = xstrdup(cpioPath); flp->diskPath = xstrdup(diskPath); - flp->uname = rpmugStashStr(fileUname); - flp->gname = rpmugStashStr(fileGname); + flp->uname = rpmstrPoolId(fl->pool, fileUname, 1); + flp->gname = rpmstrPoolId(fl->pool, fileGname, 1); if (fl->cur.langs) { flp->langs = argvJoin(fl->cur.langs, "|"); @@ -1472,7 +1487,7 @@ static rpmRC addFile(FileList fl, const char * diskPath, } if (fl->cur.caps) { - flp->caps = fl->cur.caps; + flp->caps = xstrdup(fl->cur.caps); } else { flp->caps = xstrdup(""); } @@ -1591,15 +1606,15 @@ static rpmRC processMetadataFile(Package pkg, FileList fl, apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen); break; } - case RPMTAG_SECMANIFEST: { + case RPMTAG_SECMANIFEST: { if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) { - rpmlog(RPMLOG_ERR, _("%s: Security manifest file read failed.\n"), fn); - goto exit; + rpmlog(RPMLOG_ERR, _("%s: Security manifest file read failed.\n"), fn); + goto exit; + } + apkt = rpmBase64Encode(pkt, pktlen, -1); + rpmlog(RPMLOG_INFO, _("Aptk: %s\n"), apkt); + break; } - apkt = rpmBase64Encode(pkt, pktlen, -1); - rpmlog(RPMLOG_INFO, _("Aptk: %s\n"), apkt); - break; - } } if (!apkt) { @@ -1624,6 +1639,448 @@ exit: return rc; } +/* add a file with possible virtual attributes to the file list */ +static void argvAddAttr(ARGV_t *filesp, rpmfileAttrs attrs, const char *path) +{ + char *line = NULL; + + for (VFA_t *vfa = virtualAttrs; vfa->attribute != NULL; vfa++) { + if (vfa->flag & attrs) + line = rstrscat(&line, vfa->attribute, " ", NULL); + } + line = rstrscat(&line, path, NULL); + argvAdd(filesp, line); + free(line); +} + +#if HAVE_LIBDW +/* How build id links are generated. See macros.in for description. */ +#define BUILD_IDS_NONE 0 +#define BUILD_IDS_ALLDEBUG 1 +#define BUILD_IDS_SEPARATE 2 +#define BUILD_IDS_COMPAT 3 + +static int addNewIDSymlink(ARGV_t *files, + char *targetpath, char *idlinkpath, + int isDbg, int *dups) +{ + const char *linkerr = _("failed symlink"); + int rc = 0; + int nr = 0; + int exists = 0; + char *origpath, *linkpath; + + if (isDbg) + rasprintf(&linkpath, "%s.debug", idlinkpath); + else + linkpath = idlinkpath; + origpath = linkpath; + + while (faccessat(AT_FDCWD, linkpath, F_OK, AT_SYMLINK_NOFOLLOW) == 0) { + /* We don't care about finding dups for compat links, they are + OK as is. Otherwise we will need to double check if + existing link points to the correct target. */ + if (dups == NULL) + { + exists = 1; + break; + } + + char ltarget[PATH_MAX]; + ssize_t llen; + /* In short-circuited builds the link might already exist */ + if ((llen = readlink(linkpath, ltarget, sizeof(ltarget)-1)) != -1) { + ltarget[llen] = '\0'; + if (rstreq(ltarget, targetpath)) { + exists = 1; + break; + } + } + + if (nr > 0) + free(linkpath); + nr++; + rasprintf(&linkpath, "%s.%d%s", idlinkpath, nr, + isDbg ? ".debug" : ""); + } + + if (!exists && symlink(targetpath, linkpath) < 0) { + rc = 1; + rpmlog(RPMLOG_ERR, "%s: %s -> %s: %m\n", + linkerr, linkpath, targetpath); + } else { + argvAddAttr(files, RPMFILE_ARTIFACT, linkpath); + } + + if (nr > 0) { + /* Lets see why there are multiple build-ids. If the original + targets are hard linked, then it is OK, otherwise warn + something fishy is going on. Would be nice to call + something like eu-elfcmp to see if they are really the same + ELF file or not. */ + struct stat st1, st2; + if (stat (origpath, &st1) != 0) { + rpmlog(RPMLOG_WARNING, _("Duplicate build-id, stat %s: %m\n"), + origpath); + } else if (stat (linkpath, &st2) != 0) { + rpmlog(RPMLOG_WARNING, _("Duplicate build-id, stat %s: %m\n"), + linkpath); + } else if (!(S_ISREG(st1.st_mode) && S_ISREG(st2.st_mode) + && st1.st_nlink > 1 && st2.st_nlink == st1.st_nlink + && st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev)) { + char *rpath1 = realpath(origpath, NULL); + char *rpath2 = realpath(linkpath, NULL); + rpmlog(RPMLOG_WARNING, _("Duplicate build-ids %s and %s\n"), + rpath1, rpath2); + free(rpath1); + free(rpath2); + } + } + + if (isDbg) + free(origpath); + if (nr > 0) + free(linkpath); + if (dups != NULL) + *dups = nr; + + return rc; +} + +static int generateBuildIDs(FileList fl, ARGV_t *files) +{ + int rc = 0; + int i; + FileListRec flp; + char **ids = NULL; + char **paths = NULL; + size_t nr_ids, allocated; + nr_ids = allocated = 0; + + /* How are we supposed to create the build-id links? */ + char *build_id_links_macro = rpmExpand("%{?_build_id_links}", NULL); + int build_id_links; + if (*build_id_links_macro == '\0') { + rpmlog(RPMLOG_WARNING, + _("_build_id_links macro not set, assuming 'compat'\n")); + build_id_links = BUILD_IDS_COMPAT; + } else if (strcmp(build_id_links_macro, "none") == 0) { + build_id_links = BUILD_IDS_NONE; + } else if (strcmp(build_id_links_macro, "alldebug") == 0) { + build_id_links = BUILD_IDS_ALLDEBUG; + } else if (strcmp(build_id_links_macro, "separate") == 0) { + build_id_links = BUILD_IDS_SEPARATE; + } else if (strcmp(build_id_links_macro, "compat") == 0) { + build_id_links = BUILD_IDS_COMPAT; + } else { + rc = 1; + rpmlog(RPMLOG_ERR, + _("_build_id_links macro set to unknown value '%s'\n"), + build_id_links_macro); + build_id_links = BUILD_IDS_NONE; + } + free(build_id_links_macro); + + if (build_id_links == BUILD_IDS_NONE || rc != 0) + return rc; + + /* Historically we have only checked build_ids when __debug_package + was defined. So don't terminate the build if __debug_package is + unset, even when _missing_build_ids_terminate_build is. */ + int terminate = (rpmExpandNumeric("%{?_missing_build_ids_terminate_build}") + && rpmExpandNumeric("%{?__debug_package}")); + + /* Collect and check all build-ids for ELF files in this package. */ + int needMain = 0; + int needDbg = 0; + for (i = 0, flp = fl->files.recs; i < fl->files.used; i++, flp++) { + struct stat sbuf; + if (lstat(flp->diskPath, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) { + /* We determine whether this is a main or + debug ELF based on path. */ + int isDbg = strncmp (flp->cpioPath, + DEBUG_LIB_PREFIX, strlen (DEBUG_LIB_PREFIX)) == 0; + + /* For the main package files mimic what find-debuginfo.sh does. + Only check build-ids for executable files. Debug files are + always non-executable. */ + if (!isDbg + && (sbuf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)) == 0) + continue; + + int fd = open (flp->diskPath, O_RDONLY); + if (fd >= 0) { + /* Only real ELF files, that are ET_EXEC, ET_DYN or + kernel modules (ET_REL files with names ending in .ko) + should have build-ids. */ + GElf_Ehdr ehdr; + Elf *elf = elf_begin (fd, ELF_C_READ, NULL); + if (elf != NULL && elf_kind(elf) == ELF_K_ELF + && gelf_getehdr(elf, &ehdr) != NULL + && (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN + || (ehdr.e_type == ET_REL + && rpmFileHasSuffix (flp->diskPath, ".ko")))) { + const void *build_id; + ssize_t len = dwelf_elf_gnu_build_id (elf, &build_id); + /* len == -1 means error. Zero means no + build-id. We want at least a length of 2 so we + have at least a xx/yy (hex) dir/file. But + reasonable build-ids are between 16 bytes (md5 + is 128 bits) and 64 bytes (largest sha3 is 512 + bits), common is 20 bytes (sha1 is 160 bits). */ + if (len >= 16 && len <= 64) { + int addid = 0; + if (isDbg) { + needDbg = 1; + addid = 1; + } + else if (build_id_links != BUILD_IDS_ALLDEBUG) { + needMain = 1; + addid = 1; + } + if (addid) { + const unsigned char *p = build_id; + const unsigned char *end = p + len; + char *id_str; + if (allocated <= nr_ids) { + allocated += 16; + paths = xrealloc (paths, + allocated * sizeof(char *)); + ids = xrealloc (ids, + allocated * sizeof(char *)); + } + + paths[nr_ids] = xstrdup(flp->cpioPath); + id_str = ids[nr_ids] = xmalloc(2 * len + 1); + while (p < end) + id_str += sprintf(id_str, "%02x", + (unsigned)*p++); + *id_str = '\0'; + nr_ids++; + } + } else { + if (len < 0) { + rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, + _("error reading build-id in %s: %s\n"), + flp->diskPath, elf_errmsg (-1)); + } else if (len == 0) { + rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, + _("Missing build-id in %s\n"), + flp->diskPath); + } else { + rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, + (len < 16 + ? _("build-id found in %s too small\n") + : _("build-id found in %s too large\n")), + flp->diskPath); + } + if (terminate) + rc = 1; + } + elf_end (elf); + } + close (fd); + } + } + } + + /* Process and clean up all build-ids. */ + if (nr_ids > 0) { + const char *errdir = _("failed to create directory"); + char *mainiddir = NULL; + char *debugiddir = NULL; + if (rc == 0) { + char *attrstr; + /* Add .build-id directories to hold the subdirs/symlinks. */ + + mainiddir = rpmGetPath(fl->buildRoot, BUILD_ID_DIR, NULL); + debugiddir = rpmGetPath(fl->buildRoot, DEBUG_ID_DIR, NULL); + + /* Make sure to reset all file flags to defaults. */ + attrstr = mkattr(); + argvAdd(files, attrstr); + free (attrstr); + + /* Supported, but questionable. */ + if (needMain && needDbg) + rpmlog(RPMLOG_WARNING, + _("Mixing main ELF and debug files in package")); + + if (needMain) { + if ((rc = rpmioMkpath(mainiddir, 0755, -1, -1)) != 0) { + rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, mainiddir); + } else { + argvAddAttr(files, RPMFILE_DIR|RPMFILE_ARTIFACT, mainiddir); + } + } + + if (rc == 0 && needDbg) { + if ((rc = rpmioMkpath(debugiddir, 0755, -1, -1)) != 0) { + rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, debugiddir); + } else { + argvAddAttr(files, RPMFILE_DIR|RPMFILE_ARTIFACT, debugiddir); + } + } + } + + /* In case we need ALLDEBUG links we might need the vra as + tagged onto the .debug file name. */ + char *vra = NULL; + if (rc == 0 && needDbg && build_id_links == BUILD_IDS_ALLDEBUG) { + int unique_debug_names = + rpmExpandNumeric("%{?_unique_debug_names}"); + if (unique_debug_names == 1) + vra = rpmExpand("-%{VERSION}-%{RELEASE}.%{_arch}", NULL); + } + + /* Now add a subdir and symlink for each buildid found. */ + for (i = 0; i < nr_ids; i++) { + /* Don't add anything more when an error occurred. But do + cleanup. */ + if (rc == 0) { + int isDbg = strncmp (paths[i], DEBUG_LIB_PREFIX, + strlen (DEBUG_LIB_PREFIX)) == 0; + + char *buildidsubdir; + char subdir[4]; + subdir[0] = '/'; + subdir[1] = ids[i][0]; + subdir[2] = ids[i][1]; + subdir[3] = '\0'; + if (isDbg) + buildidsubdir = rpmGetPath(debugiddir, subdir, NULL); + else + buildidsubdir = rpmGetPath(mainiddir, subdir, NULL); + /* We only need to create and add the subdir once. */ + int addsubdir = access (buildidsubdir, F_OK) == -1; + if (addsubdir + && (rc = rpmioMkpath(buildidsubdir, 0755, -1, -1)) != 0) { + rpmlog(RPMLOG_ERR, "%s %s: %m\n", errdir, buildidsubdir); + } else { + if (addsubdir) + argvAddAttr(files, RPMFILE_DIR|RPMFILE_ARTIFACT, buildidsubdir); + if (rc == 0) { + char *linkpattern, *targetpattern; + char *linkpath, *targetpath; + int dups = 0; + if (isDbg) { + linkpattern = "%s/%s"; + targetpattern = "../../../../..%s"; + } else { + linkpattern = "%s/%s"; + targetpattern = "../../../..%s"; + } + rasprintf(&linkpath, linkpattern, + buildidsubdir, &ids[i][2]); + rasprintf(&targetpath, targetpattern, paths[i]); + rc = addNewIDSymlink(files, targetpath, linkpath, + isDbg, &dups); + + /* We might want to have a link from the debug + build_ids dir to the main one. We create it + when we are creating compat links or doing + an old style alldebug build-ids package. In + the first case things are simple since we + just link to the main build-id symlink. The + second case is a bit tricky, since we + cannot be 100% sure the file names in the + main and debug package match. Currently + they do, but when creating parallel + installable debuginfo packages they might + not (in that case we might have to also + strip the nvr from the debug name). + + In general either method is discouraged + since it might create dangling symlinks if + the package versions get out of sync. */ + if (rc == 0 && isDbg + && build_id_links == BUILD_IDS_COMPAT) { + /* buildidsubdir already points to the + debug buildid. We just need to setup + the symlink to the main one. There + might be duplicate IDs, those are found + by the addNewIDSymlink above. Target + the last found duplicate, if any. */ + free(linkpath); + free(targetpath); + if (dups == 0) + { + rasprintf(&linkpath, "%s/%s", + buildidsubdir, &ids[i][2]); + rasprintf(&targetpath, + "../../../.build-id%s/%s", + subdir, &ids[i][2]); + } + else + { + rasprintf(&linkpath, "%s/%s.%d", + buildidsubdir, &ids[i][2], dups); + rasprintf(&targetpath, + "../../../.build-id%s/%s.%d", + subdir, &ids[i][2], dups); + } + rc = addNewIDSymlink(files, targetpath, linkpath, + 0, NULL); + } + + if (rc == 0 && isDbg + && build_id_links == BUILD_IDS_ALLDEBUG) { + /* buildidsubdir already points to the + debug buildid. We do have to figure out + the main ELF file though (which is most + likely not in this package). Guess we + can find it by stripping the + /usr/lib/debug path and .debug + prefix. Which might not really be + correct if there was a more involved + transformation (for example for + parallel installable debuginfo + packages), but then we shouldn't be + using ALLDEBUG in the first place. + Also ignore things like .dwz multifiles + which don't end in ".debug". */ + int pathlen = strlen(paths[i]); + int debuglen = strlen(".debug"); + int prefixlen = strlen(DEBUG_LIB_DIR); + int vralen = vra == NULL ? 0 : strlen(vra); + if (pathlen > prefixlen + debuglen + vralen + && strcmp ((paths[i] + pathlen - debuglen), + ".debug") == 0) { + free(linkpath); + free(targetpath); + char *targetstr = xstrdup (paths[i] + + prefixlen); + int targetlen = pathlen - prefixlen; + int targetend = targetlen - debuglen - vralen; + targetstr[targetend] = '\0'; + rasprintf(&linkpath, "%s/%s", + buildidsubdir, &ids[i][2]); + rasprintf(&targetpath, "../../../../..%s", + targetstr); + rc = addNewIDSymlink(files, targetpath, + linkpath, 0, &dups); + free(targetstr); + } + } + free(linkpath); + free(targetpath); + } + } + free(buildidsubdir); + } + free(paths[i]); + free(ids[i]); + } + free(mainiddir); + free(debugiddir); + free(vra); + free(paths); + free(ids); + } + return rc; +} +#endif + /** * Add a file to a binary package. * @param pkg @@ -1683,16 +2140,13 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName) } argvFree(argv); } else { - int lvl = RPMLOG_WARNING; const char *msg = (fl->cur.isDir) ? - _("Directory not found by glob: %s\n") : - _("File not found by glob: %s\n"); - if (!(fl->cur.attrFlags & RPMFILE_EXCLUDE)) { - lvl = RPMLOG_ERR; - rc = RPMRC_FAIL; - } - rpmlog(lvl, msg, diskPath); - goto exit; + _("Directory not found by glob: %s. " + "Trying without globbing.\n") : + _("File not found by glob: %s. " + "Trying without globbing.\n"); + rpmlog(RPMLOG_DEBUG, msg, diskPath); + rc = addFile(fl, diskPath, NULL); } } else { rc = addFile(fl, diskPath, NULL); @@ -1712,6 +2166,8 @@ static rpmRC readFilesManifest(rpmSpec spec, Package pkg, const char *path) char *fn, buf[BUFSIZ]; FILE *fd = NULL; rpmRC rc = RPMRC_FAIL; + unsigned int nlines = 0; + char *expanded; if (*path == '/') { fn = rpmGetPath(path, NULL); @@ -1726,13 +2182,28 @@ static rpmRC readFilesManifest(rpmSpec spec, Package pkg, const char *path) goto exit; } + /* XXX unmask %license while parsing files manifest*/ + rpmPushMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC); + while (fgets(buf, sizeof(buf), fd)) { - handleComments(buf); - if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { + if (handleComments(buf)) + continue; + if (rpmExpandMacros(spec->macros, buf, &expanded, 0) < 0) { rpmlog(RPMLOG_ERR, _("line: %s\n"), buf); goto exit; } - argvAdd(&(pkg->fileList), buf); + argvAdd(&(pkg->fileList), expanded); + free(expanded); + nlines++; + } + + if (nlines == 0) { + int terminate = + rpmExpandNumeric("%{?_empty_manifest_terminate_build}"); + rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING, + _("Empty %%files file %s\n"), fn); + if (terminate) + goto exit; } if (ferror(fd)) @@ -1741,6 +2212,7 @@ static rpmRC readFilesManifest(rpmSpec spec, Package pkg, const char *path) rc = RPMRC_OK; exit: + rpmPopMacro(NULL, "license"); if (fd) fclose(fd); free(fn); return rc; @@ -1773,24 +2245,47 @@ static char * getSpecialDocDir(Header h, rpmFlags sdtype) return res; } -static specialDir specialDirNew(Header h, rpmFlags sdtype, - AttrRec ar, AttrRec def_ar) +static specialDir specialDirNew(Header h, rpmFlags sdtype) { specialDir sd = xcalloc(1, sizeof(*sd)); - dupAttrRec(ar, &(sd->ar)); - dupAttrRec(def_ar, &(sd->def_ar)); + + sd->entriesCount = 0; + sd->entriesAlloced = 10; + sd->entries = xcalloc(sd->entriesAlloced, sizeof(sd->entries[0])); + sd->dirname = getSpecialDocDir(h, sdtype); sd->sdtype = sdtype; return sd; } +static void addSpecialFile(specialDir sd, const char *path, FileEntry cur, + FileEntry def) +{ + argvAdd(&sd->files, path); + + if (sd->entriesCount >= sd->entriesAlloced) { + sd->entriesAlloced <<= 1; + sd->entries = xrealloc(sd->entries, sd->entriesAlloced * + sizeof(sd->entries[0])); + } + + copyFileEntry(cur, &sd->entries[sd->entriesCount].curEntry); + copyFileEntry(def, &sd->entries[sd->entriesCount].defEntry); + sd->entriesCount++; +} + static specialDir specialDirFree(specialDir sd) { + int i = 0; + if (sd) { argvFree(sd->files); - freeAttrRec(&(sd->ar)); - freeAttrRec(&(sd->def_ar)); free(sd->dirname); + for (i = 0; i < sd->entriesCount; i++) { + FileEntryFree(&sd->entries[i].curEntry); + FileEntryFree(&sd->entries[i].defEntry); + } + free(sd->entries); free(sd); } return NULL; @@ -1803,10 +2298,13 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl, const char *sdname = (sd->sdtype == RPMFILE_DOC) ? "%doc" : "%license"; char *mkdocdir = rpmExpand("%{__mkdir_p} $", sdenv, NULL); StringBuf docScript = newStringBuf(); + char *basepath, **files; + int fi; appendStringBuf(docScript, sdenv); appendStringBuf(docScript, "=$RPM_BUILD_ROOT"); appendLineStringBuf(docScript, sd->dirname); + appendLineStringBuf(docScript, "export LC_ALL=C"); appendStringBuf(docScript, "export "); appendLineStringBuf(docScript, sdenv); appendLineStringBuf(docScript, mkdocdir); @@ -1817,7 +2315,8 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl, appendStringBuf(docScript, "cp -pr "); appendStringBuf(docScript, efn); appendStringBuf(docScript, " $"); - appendLineStringBuf(docScript, sdenv); + appendStringBuf(docScript, sdenv); + appendLineStringBuf(docScript, " ||:"); free(efn); } @@ -1829,52 +2328,77 @@ static void processSpecialDir(rpmSpec spec, Package pkg, FileList fl, fl->processingFailed = 1; } - /* Reset for %doc */ - FileEntryFree(&fl->cur); - - fl->cur.attrFlags |= sd->sdtype; - fl->cur.verifyFlags = fl->def.verifyFlags; - dupAttrRec(&(sd->ar), &(fl->cur.ar)); - dupAttrRec(&(sd->def_ar), &(fl->def.ar)); + basepath = rpmGenPath(spec->rootDir, "%{_builddir}", spec->buildSubdir); + files = sd->files; + fi = 0; + while (*files != NULL) { + char *origfile = rpmGenPath(basepath, *files, NULL); + char *eorigfile = rpmEscapeSpaces(origfile); + ARGV_t globFiles; + int globFilesCount, i; + char *newfile; + + FileEntryFree(&fl->cur); + FileEntryFree(&fl->def); + copyFileEntry(&sd->entries[fi].curEntry, &fl->cur); + copyFileEntry(&sd->entries[fi].defEntry, &fl->def); + fi++; + + if (rpmGlob(eorigfile, &globFilesCount, &globFiles) == 0) { + for (i = 0; i < globFilesCount; i++) { + rasprintf(&newfile, "%s/%s", sd->dirname, basename(globFiles[i])); + processBinaryFile(pkg, fl, newfile); + free(newfile); + } + argvFree(globFiles); + } else { + rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), eorigfile); + fl->processingFailed = 1; + } + free(eorigfile); + free(origfile); + files++; + } + free(basepath); + FileEntryFree(&fl->cur); + FileEntryFree(&fl->def); + copyFileEntry(&sd->entries[0].defEntry, &fl->def); + fl->cur.isDir = 1; (void) processBinaryFile(pkg, fl, sd->dirname); freeStringBuf(docScript); free(mkdocdir); } - -static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, - Package pkg, int installSpecialDoc, int test) -{ - struct FileList_s fl; - ARGV_t fileNames = NULL; - specialDir specialDoc = NULL; - specialDir specialLic = NULL; - - pkg->cpioList = NULL; - for (ARGV_const_t fp = pkg->fileFile; fp && *fp != NULL; fp++) { - if (readFilesManifest(spec, pkg, *fp)) - return RPMRC_FAIL; - } - /* Init the file list structure */ - memset(&fl, 0, sizeof(fl)); +/* Resets the default settings for files in the package list. + Used in processPackageFiles whenever a new set of files is added. */ +static void resetPackageFilesDefaults (struct FileList_s *fl, + rpmBuildPkgFlags pkgFlags) +{ + struct AttrRec_s root_ar = { 0, 0, 0, 0, 0, 0 }; - /* XXX spec->buildRoot == NULL, then xstrdup("") is returned */ - fl.buildRoot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); + root_ar.ar_user = rpmstrPoolId(fl->pool, UID_0_USER, 1); + root_ar.ar_group = rpmstrPoolId(fl->pool, GID_0_GROUP, 1); + dupAttrRec(&root_ar, &fl->def.ar); /* XXX assume %defattr(-,root,root) */ - dupAttrRec(&root_ar, &fl.def.ar); /* XXX assume %defattr(-,root,root) */ - fl.def.verifyFlags = RPMVERIFY_ALL; + fl->def.verifyFlags = RPMVERIFY_ALL; - fl.pkgFlags = pkgFlags; + fl->pkgFlags = pkgFlags; +} - { char *docs = rpmGetPath("%{?__docdir_path}", NULL); - argvSplit(&fl.docDirs, docs, ":"); - free(docs); - } - - for (ARGV_const_t fp = pkg->fileList; *fp != NULL; fp++) { +/* Adds the given fileList to the package. If fromSpecFileList is not zero + then the specialDirs are also filled in and the files are sanitized + through processBinaryFile(). Otherwise no special files are processed + and the files are added directly through addFile(). */ +static void addPackageFileList (struct FileList_s *fl, Package pkg, + ARGV_t *fileList, + specialDir *specialDoc, specialDir *specialLic, + int fromSpecFileList) +{ + ARGV_t fileNames = NULL; + for (ARGV_const_t fp = *fileList; *fp != NULL; fp++) { char buf[strlen(*fp) + 1]; const char *s = *fp; SKIPSPACE(s); @@ -1884,92 +2408,169 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, rstrlcpy(buf, s, sizeof(buf)); /* Reset for a new line in %files */ - FileEntryFree(&fl.cur); + FileEntryFree(&fl->cur); /* turn explicit flags into %def'd ones (gosh this is hacky...) */ - fl.cur.specdFlags = ((unsigned)fl.def.specdFlags) >> 8; - fl.cur.verifyFlags = fl.def.verifyFlags; - - if (parseForVerify(buf, 0, &fl.cur) || - parseForVerify(buf, 1, &fl.def) || - parseForAttr(buf, 0, &fl.cur) || - parseForAttr(buf, 1, &fl.def) || - parseForDev(buf, &fl.cur) || - parseForConfig(buf, &fl.cur) || - parseForLang(buf, &fl.cur) || - parseForCaps(buf, &fl.cur) || - parseForSimple(buf, &fl.cur, &fileNames)) + fl->cur.specdFlags = ((unsigned)fl->def.specdFlags) >> 8; + fl->cur.verifyFlags = fl->def.verifyFlags; + + if (parseForVerify(buf, 0, &fl->cur) || + parseForVerify(buf, 1, &fl->def) || + parseForAttr(fl->pool, buf, 0, &fl->cur) || + parseForAttr(fl->pool, buf, 1, &fl->def) || + parseForDev(buf, &fl->cur) || + parseForConfig(buf, &fl->cur) || + parseForLang(buf, &fl->cur) || + parseForCaps(buf, &fl->cur) || + parseForSimple(buf, &fl->cur, &fileNames)) { - fl.processingFailed = 1; + fl->processingFailed = 1; continue; } for (ARGV_const_t fn = fileNames; fn && *fn; fn++) { - if (fl.cur.attrFlags & RPMFILE_SPECIALDIR) { - rpmFlags oattrs = (fl.cur.attrFlags & ~RPMFILE_SPECIALDIR); + + /* For file lists that don't come from a spec file list + processing is easy. There are no special files and the + file names don't need to be adjusted. */ + if (!fromSpecFileList) { + if (fl->cur.attrFlags & RPMFILE_SPECIALDIR + || fl->cur.attrFlags & RPMFILE_DOCDIR + || fl->cur.attrFlags & RPMFILE_PUBKEY) { + rpmlog(RPMLOG_ERR, + _("Special file in generated file list: %s\n"), + *fn); + fl->processingFailed = 1; + continue; + } + if (fl->cur.attrFlags & RPMFILE_DIR) + fl->cur.isDir = 1; + addFile(fl, *fn, NULL); + continue; + } + + /* File list does come from the spec, try to detect special + files and adjust the actual file names. */ + if (fl->cur.attrFlags & RPMFILE_SPECIALDIR) { + rpmFlags oattrs = (fl->cur.attrFlags & ~RPMFILE_SPECIALDIR); specialDir *sdp = NULL; if (oattrs == RPMFILE_DOC) { - sdp = &specialDoc; + sdp = specialDoc; } else if (oattrs == RPMFILE_LICENSE) { - sdp = &specialLic; + sdp = specialLic; } if (sdp == NULL || **fn == '/') { rpmlog(RPMLOG_ERR, _("Can't mix special %s with other forms: %s\n"), (oattrs & RPMFILE_DOC) ? "%doc" : "%license", *fn); - fl.processingFailed = 1; + fl->processingFailed = 1; continue; } /* save attributes on first special doc/license for later use */ if (*sdp == NULL) { - *sdp = specialDirNew(pkg->header, oattrs, - &fl.cur.ar, &fl.def.ar); + *sdp = specialDirNew(pkg->header, oattrs); } - argvAdd(&(*sdp)->files, *fn); + addSpecialFile(*sdp, *fn, &fl->cur, &fl->def); continue; } /* this is now an artificial limitation */ if (fn != fileNames) { rpmlog(RPMLOG_ERR, _("More than one file on a line: %s\n"),*fn); - fl.processingFailed = 1; + fl->processingFailed = 1; continue; } - if (fl.cur.attrFlags & RPMFILE_DOCDIR) { - argvAdd(&(fl.docDirs), *fn); - } else if (fl.cur.attrFlags & RPMFILE_PUBKEY) { - (void) processMetadataFile(pkg, &fl, *fn, RPMTAG_PUBKEYS); - } else if (fl.cur.attrFlags & RPMFILE_SECMANIFEST) { - (void) processMetadataFile(pkg, &fl, *fn, RPMTAG_SECMANIFEST); - } else { - if (fl.cur.attrFlags & RPMFILE_DIR) - fl.cur.isDir = 1; - (void) processBinaryFile(pkg, &fl, *fn); + if (fl->cur.attrFlags & RPMFILE_DOCDIR) { + argvAdd(&(fl->docDirs), *fn); + } else if (fl->cur.attrFlags & RPMFILE_PUBKEY) { + (void) processMetadataFile(pkg, fl, *fn, RPMTAG_PUBKEYS); + } else if (fl->cur.attrFlags & RPMFILE_SECMANIFEST) { + (void) processMetadataFile(pkg, fl, *fn, RPMTAG_SECMANIFEST); + }else { + if (fl->cur.attrFlags & RPMFILE_DIR) + fl->cur.isDir = 1; + (void) processBinaryFile(pkg, fl, *fn); } } - if (fl.cur.caps) - fl.haveCaps = 1; + if (fl->cur.caps) + fl->haveCaps = 1; } + argvFree(fileNames); +} + +static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, + Package pkg, int didInstall, int test) +{ + struct FileList_s fl; + specialDir specialDoc = NULL; + specialDir specialLic = NULL; + + pkg->cpioList = NULL; + + for (ARGV_const_t fp = pkg->fileFile; fp && *fp != NULL; fp++) { + if (readFilesManifest(spec, pkg, *fp)) + return RPMRC_FAIL; + } + /* Init the file list structure */ + memset(&fl, 0, sizeof(fl)); + + fl.pool = rpmstrPoolLink(spec->pool); + /* XXX spec->buildRoot == NULL, then xstrdup("") is returned */ + fl.buildRoot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); + fl.buildRootLen = strlen(fl.buildRoot); + + resetPackageFilesDefaults (&fl, pkgFlags); + + { char *docs = rpmGetPath("%{?__docdir_path}", NULL); + argvSplit(&fl.docDirs, docs, ":"); + free(docs); + } + + addPackageFileList (&fl, pkg, &pkg->fileList, + &specialDoc, &specialLic, 1); /* Now process special docs and licenses if present */ if (specialDoc) - processSpecialDir(spec, pkg, &fl, specialDoc, installSpecialDoc, test); + processSpecialDir(spec, pkg, &fl, specialDoc, didInstall, test); if (specialLic) - processSpecialDir(spec, pkg, &fl, specialLic, installSpecialDoc, test); + processSpecialDir(spec, pkg, &fl, specialLic, didInstall, test); if (fl.processingFailed) goto exit; +#if HAVE_LIBDW + /* Check build-ids and add build-ids links for files to package list. */ + const char *arch = headerGetString(pkg->header, RPMTAG_ARCH); + if (!rstreq(arch, "noarch")) { + /* Go through the current package list and generate a files list. */ + ARGV_t idFiles = NULL; + if (generateBuildIDs (&fl, &idFiles) != 0) { + rpmlog(RPMLOG_ERR, _("Generating build-id links failed\n")); + fl.processingFailed = 1; + argvFree(idFiles); + goto exit; + } + + if (idFiles != NULL) { + resetPackageFilesDefaults (&fl, pkgFlags); + addPackageFileList (&fl, pkg, &idFiles, NULL, NULL, 0); + } + argvFree(idFiles); + + if (fl.processingFailed) + goto exit; + } +#endif + /* Verify that file attributes scope over hardlinks correctly. */ if (checkHardLinks(&fl.files)) - (void) rpmlibNeedsFeature(pkg->header, - "PartialHardlinkSets", "4.0.4-1"); + (void) rpmlibNeedsFeature(pkg, "PartialHardlinkSets", "4.0.4-1"); - genCpioListAndHeader(&fl, &pkg->cpioList, pkg->header, 0); + genCpioListAndHeader(&fl, pkg, 0); exit: FileListFree(&fl); @@ -1994,6 +2595,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) struct FileList_s fl; ARGV_t files = NULL; Package pkg; + Package sourcePkg = spec->sourcePackage; static char *_srcdefattr; static int oneshot; @@ -2024,13 +2626,14 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) } } - spec->sourceCpioList = NULL; + sourcePkg->cpioList = NULL; /* Init the file list structure */ memset(&fl, 0, sizeof(fl)); + fl.pool = rpmstrPoolLink(spec->pool); if (_srcdefattr) { char *a = rstrscat(NULL, "%defattr ", _srcdefattr, NULL); - parseForAttr(a, 1, &fl.def); + parseForAttr(fl.pool, a, 1, &fl.def); free(a); } fl.files.alloced = spec->numSources + 1; @@ -2075,31 +2678,39 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) flp->fl_mode &= S_IFMT; flp->fl_mode |= fl.def.ar.ar_fmode; } + if (fl.def.ar.ar_user) { - flp->uname = rpmugStashStr(fl.def.ar.ar_user); + flp->uname = fl.def.ar.ar_user; } else { - flp->uname = rpmugStashStr(rpmugUname(flp->fl_uid)); + flp->uname = rpmstrPoolId(fl.pool, rpmugUname(flp->fl_uid), 1); + } + if (! flp->uname) { + flp->uname = rpmstrPoolId(fl.pool, rpmugUname(getuid()), 1); + } + if (! flp->uname) { + flp->uname = rpmstrPoolId(fl.pool, UID_0_USER, 1); } + if (fl.def.ar.ar_group) { - flp->gname = rpmugStashStr(fl.def.ar.ar_group); + flp->gname = fl.def.ar.ar_group; } else { - flp->gname = rpmugStashStr(rpmugGname(flp->fl_gid)); + flp->gname = rpmstrPoolId(fl.pool, rpmugGname(flp->fl_gid), 1); } - flp->langs = xstrdup(""); - - if (! (flp->uname && flp->gname)) { - rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), diskPath); - fl.processingFailed = 1; + if (! flp->gname) { + flp->gname = rpmstrPoolId(fl.pool, rpmugGname(getgid()), 1); + } + if (! flp->gname) { + flp->gname = rpmstrPoolId(fl.pool, GID_0_GROUP, 1); } + flp->langs = xstrdup(""); fl.files.used++; } argvFree(files); if (! fl.processingFailed) { - if (spec->sourceHeader != NULL) { - genCpioListAndHeader(&fl, &spec->sourceCpioList, - spec->sourceHeader, 1); + if (sourcePkg->header != NULL) { + genCpioListAndHeader(&fl, sourcePkg, 1); } } @@ -2109,6 +2720,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags) /** * Check packaged file list against what's in the build root. + * @param buildRoot path of build root * @param fileList packaged file list * @return -1 if skipped, 0 on OK, 1 on error */ @@ -2145,259 +2757,357 @@ exit: return rc; } -#if HAVE_GELF_H && HAVE_LIBELF -/* Query the build-id from the ELF file NAME and store it in the newly - allocated *build_id array of size *build_id_size. Returns -1 on - error. */ +static rpmTag copyTagsFromMainDebug[] = { + RPMTAG_ARCH, + RPMTAG_SUMMARY, + RPMTAG_DESCRIPTION, + RPMTAG_GROUP, + /* see addTargets */ + RPMTAG_OS, + RPMTAG_PLATFORM, + RPMTAG_OPTFLAGS, +}; -int -getELFBuildId (const char *name, - unsigned char **id, size_t *id_size) +/* this is a hack: patch the summary and the description to include + * the correct package name */ +static void patchDebugPackageString(Package dbg, rpmTag tag, Package pkg, Package mainpkg) { - int fd, i; - Elf *elf; - GElf_Ehdr ehdr; - Elf_Data *build_id = NULL; - size_t build_id_offset = 0, build_id_size = 0; - - /* Now query the build-id of the file and add the - corresponding links in the .build-id tree. - The following code is based on tools/debugedit.c. */ - fd = open (name, O_RDONLY); - if (fd < 0) - return -1; - elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); - if (elf == NULL) - { - fprintf (stderr, "cannot open ELF file: %s", - elf_errmsg (-1)); - close (fd); - return -1; - } - if (elf_kind (elf) != ELF_K_ELF - || gelf_getehdr (elf, &ehdr) == NULL - || (ehdr.e_type != ET_DYN - && ehdr.e_type != ET_EXEC - && ehdr.e_type != ET_REL)) - { - elf_end (elf); - close (fd); - return -1; - } - for (i = 0; i < ehdr.e_shnum; ++i) - { - Elf_Scn *s = elf_getscn (elf, i); - GElf_Shdr shdr; - Elf_Data *data; - Elf32_Nhdr nh; - Elf_Data dst = - { - .d_version = EV_CURRENT, .d_type = ELF_T_NHDR, - .d_buf = &nh, .d_size = sizeof nh - }; - Elf_Data src = dst; - - gelf_getshdr (s, &shdr); - if (shdr.sh_type != SHT_NOTE - || !(shdr.sh_flags & SHF_ALLOC)) - continue; - - /* Look for a build-ID note here. */ - data = elf_rawdata (s, NULL); - src.d_buf = data->d_buf; - assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr)); - while (data->d_buf + data->d_size - src.d_buf > (int) sizeof nh - && elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA])) - { - Elf32_Word len = sizeof nh + nh.n_namesz; - len = (len + 3) & ~3; + const char *oldname, *newname, *old; + char *oldsubst = NULL, *newsubst = NULL, *p; + oldname = headerGetString(mainpkg->header, RPMTAG_NAME); + newname = headerGetString(pkg->header, RPMTAG_NAME); + rasprintf(&oldsubst, "package %s", oldname); + rasprintf(&newsubst, "package %s", newname); + old = headerGetString(dbg->header, tag); + p = old ? strstr(old, oldsubst) : NULL; + if (p) { + char *new = NULL; + rasprintf(&new, "%.*s%s%s", (int)(p - old), old, newsubst, p + strlen(oldsubst)); + headerDel(dbg->header, tag); + headerPutString(dbg->header, tag, new); + _free(new); + } + _free(oldsubst); + _free(newsubst); +} - if (nh.n_namesz == sizeof "GNU" && nh.n_type == 3 - && !memcmp (src.d_buf + sizeof nh, "GNU", sizeof "GNU")) - { - build_id = data; - build_id_offset = src.d_buf + len - data->d_buf; - build_id_size = nh.n_descsz; - break; - } +/* Early prototype for use in filterDebuginfoPackage. */ +static void addPackageDeps(Package from, Package to, enum rpmTag_e tag); - len += nh.n_descsz; - len = (len + 3) & ~3; - src.d_buf += len; - } +/* create a new debuginfo subpackage for package pkg from the + * main debuginfo package */ +static Package cloneDebuginfoPackage(rpmSpec spec, Package pkg, Package maindbg) +{ + const char *name = headerGetString(pkg->header, RPMTAG_NAME); + char *dbgname = NULL; + Package dbg; + + rasprintf(&dbgname, "%s-%s", name, "debuginfo"); + dbg = newPackage(dbgname, spec->pool, &spec->packages); + headerPutString(dbg->header, RPMTAG_NAME, dbgname); + copyInheritedTags(dbg->header, pkg->header); + headerDel(dbg->header, RPMTAG_GROUP); + headerCopyTags(maindbg->header, dbg->header, copyTagsFromMainDebug); + dbg->autoReq = maindbg->autoReq; + dbg->autoProv = maindbg->autoProv; + + /* patch summary and description strings */ + patchDebugPackageString(dbg, RPMTAG_SUMMARY, pkg, spec->packages); + patchDebugPackageString(dbg, RPMTAG_DESCRIPTION, pkg, spec->packages); + + /* Add self-provides (normally done by addTargets) */ + addPackageProvides(dbg); + dbg->ds = rpmdsThis(dbg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); + + _free(dbgname); + return dbg; +} - if (build_id != NULL) - break; - } +/* collect the debug files for package pkg and put them into + * a (possibly new) debuginfo subpackage */ +static void filterDebuginfoPackage(rpmSpec spec, Package pkg, + Package maindbg, Package dbgsrc, + char *buildroot, char *uniquearch) +{ + rpmfi fi; + ARGV_t files = NULL; + ARGV_t dirs = NULL; + int lastdiridx = -1, dirsadded; + char *path = NULL, *p, *pmin; + size_t buildrootlen = strlen(buildroot); - if (build_id == NULL) - return -1; + /* ignore noarch subpackages */ + if (rstreq(headerGetString(pkg->header, RPMTAG_ARCH), "noarch")) + return; - *id = malloc (build_id_size); - *id_size = build_id_size; - memcpy (*id, build_id->d_buf + build_id_offset, build_id_size); + if (!uniquearch) + uniquearch = ""; + + fi = rpmfilesIter(pkg->cpioList, RPMFI_ITER_FWD); + /* Check if the current package has files with debug info + and add them to the file list */ + fi = rpmfiInit(fi, 0); + while (rpmfiNext(fi) >= 0) { + const char *name = rpmfiFN(fi); + int namel = strlen(name); + + /* strip trailing .debug like in find-debuginfo.sh */ + if (namel > 6 && !strcmp(name + namel - 6, ".debug")) + namel -= 6; + + /* fileRenameMap doesn't necessarily have to be initialized */ + if (pkg->fileRenameMap) { + const char **names = NULL; + int namec = 0; + fileRenameHashGetEntry(pkg->fileRenameMap, name, &names, &namec, NULL); + if (namec) { + if (namec > 1) + rpmlog(RPMLOG_WARNING, _("%s was mapped to multiple filenames"), name); + name = *names; + namel = strlen(name); + } + } + + /* generate path */ + rasprintf(&path, "%s%s%.*s%s.debug", buildroot, DEBUG_LIB_DIR, namel, name, uniquearch); + + /* If that file exists we have debug information for it */ + if (access(path, F_OK) == 0) { + /* Append the file list preamble */ + if (!files) { + char *attr = mkattr(); + argvAdd(&files, attr); + argvAddAttr(&files, RPMFILE_DIR, DEBUG_LIB_DIR); + free(attr); + } - elf_end (elf); - close (fd); + /* Add the files main debug-info file */ + argvAdd(&files, path + buildrootlen); + + /* Add the dir(s) */ + dirsadded = 0; + pmin = path + buildrootlen + strlen(DEBUG_LIB_DIR); + while ((p = strrchr(path + buildrootlen, '/')) != NULL && p > pmin) { + *p = 0; + if (lastdiridx >= 0 && !strcmp(dirs[lastdiridx], path + buildrootlen)) + break; /* already added this one */ + argvAdd(&dirs, path + buildrootlen); + dirsadded++; + } + if (dirsadded) + lastdiridx = argvCount(dirs) - dirsadded; /* remember longest dir */ + } + path = _free(path); + } + rpmfiFree(fi); + /* Exclude debug files for files which were excluded in respective non-debug package */ + for (ARGV_const_t excl = pkg->fileExcludeList; excl && *excl; excl++) { + const char *name = *excl; + + /* generate path */ + rasprintf(&path, "%s%s%s%s.debug", buildroot, DEBUG_LIB_DIR, name, uniquearch); + /* Exclude only debuginfo files which actually exist */ + if (access(path, F_OK) == 0) { + char *line = NULL; + rasprintf(&line, "%%exclude %s", path + buildrootlen); + argvAdd(&files, line); + _free(line); + } + path = _free(path); + } - return 0; -} + /* add collected directories to file list */ + if (dirs) { + int i; + argvSort(dirs, NULL); + for (i = 0; dirs[i]; i++) { + if (!i || strcmp(dirs[i], dirs[i - 1]) != 0) + argvAddAttr(&files, RPMFILE_DIR, dirs[i]); + } + dirs = argvFree(dirs); + } + if (files) { + /* Add security manifest to set right SMACK labels */ + argvAdd(&files, "%manifest %{name}-debuginfo.manifest"); -static rpmTag copyTagsForDebug[] = { - RPMTAG_EPOCH, - RPMTAG_VERSION, - RPMTAG_RELEASE, - RPMTAG_LICENSE, - RPMTAG_PACKAGER, - RPMTAG_DISTRIBUTION, - RPMTAG_DISTURL, - RPMTAG_VENDOR, - RPMTAG_ICON, - RPMTAG_URL, - RPMTAG_CHANGELOGTIME, - RPMTAG_CHANGELOGNAME, - RPMTAG_CHANGELOGTEXT, - RPMTAG_PREFIXES, - RPMTAG_RHNPLATFORM, - RPMTAG_OS, - RPMTAG_DISTTAG, - RPMTAG_CVSID, - RPMTAG_ARCH, - 0 -}; + /* we have collected some files. Now put them in a debuginfo + * package. If this is not the main package, clone the main + * debuginfo package */ + if (pkg == spec->packages) + maindbg->fileList = files; + else { + Package dbg = cloneDebuginfoPackage(spec, pkg, maindbg); + dbg->fileList = files; + /* Recommend the debugsource package (or the main debuginfo). */ + addPackageDeps(dbg, dbgsrc ? dbgsrc : maindbg, + RPMTAG_RECOMMENDNAME); + } + } +} -static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot) +/* add the debug dwz files to package pkg. + * return 1 if something was added, 0 otherwise. */ +static int addDebugDwz(Package pkg, char *buildroot) { - const char *a; - const char *ver, *rel; - - elf_version(EV_CURRENT); - a = headerGetString(pkg->header, RPMTAG_ARCH); - ver = headerGetAsString(pkg->header, RPMTAG_VERSION); - rel = headerGetAsString(pkg->header, RPMTAG_RELEASE); - - if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0) - { - Package dbg; - rpmfi fi = pkg->cpioList; - char tmp[1024]; - const char *name; - ARGV_t files = NULL; - int seen_build_id = 0; - - /* Check if the current package has files with debug info - and record them. */ - fi = rpmfiInit (fi, 0); - while (rpmfiNext (fi) >= 0) - { - const char *base; - int i; - unsigned char *build_id; - size_t build_id_size = 0; - struct stat sbuf; - - name = rpmfiFN (fi); - /* Skip leading buildroot. */ - base = name + strlen (buildroot); - /* Pre-pend %buildroot/usr/lib/debug and append .debug. */ - snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug", - buildroot, base); - /* If that file exists we have debug information for it. */ - if (access (tmp, F_OK) != 0) - continue; + int ret = 0; + char *path = NULL; + struct stat sbuf; + + rasprintf(&path, "%s%s", buildroot, DEBUG_DWZ_DIR); + if (lstat(path, &sbuf) == 0 && S_ISDIR(sbuf.st_mode)) { + if (!pkg->fileList) { + char *attr = mkattr(); + argvAdd(&pkg->fileList, attr); + argvAddAttr(&pkg->fileList, RPMFILE_DIR|RPMFILE_ARTIFACT, DEBUG_LIB_DIR); + free(attr); + } + argvAddAttr(&pkg->fileList, RPMFILE_ARTIFACT, DEBUG_DWZ_DIR); + ret = 1; + } + path = _free(path); + return ret; +} - /* Append the file list preamble. */ - if (!files) - { - argvAdd(&files, "%defattr(-,root,root)"); - argvAdd(&files, "%dir /usr/lib/debug"); - } - /* Add the files main debug-info file. */ - snprintf (tmp, 1024, "/usr/lib/debug/%s.debug", base); - argvAdd(&files, tmp); - - /* Do not bother to check build-ids for symbolic links. - We'll handle them for the link target. */ - if (lstat (name, &sbuf) == -1 - || S_ISLNK (sbuf.st_mode)) - continue; +/* add the debug source files to package pkg. + * return 1 if something was added, 0 otherwise. */ +static int addDebugSrc(Package pkg, char *buildroot) +{ + int ret = 0; + char *path = NULL; + DIR *d; + struct dirent *de; + + /* not needed if we have an extra debugsource subpackage */ + if (rpmExpandNumeric("%{?_debugsource_packages}")) + return 0; + + rasprintf(&path, "%s%s", buildroot, DEBUG_SRC_DIR); + d = opendir(path); + path = _free(path); + if (d) { + while ((de = readdir(d)) != NULL) { + if (!strcmp(de->d_name, ".") || !strcmp(de->d_name, "..")) + continue; + rasprintf(&path, "%s/%s", DEBUG_SRC_DIR, de->d_name); + if (!pkg->fileList) { + char *attr = mkattr(); + argvAdd(&pkg->fileList, attr); + free(attr); + } + argvAdd(&pkg->fileList, path); + path = _free(path); + ret = 1; + } + closedir(d); + } + return ret; +} - /* Try to gather the build-id from the binary. */ - if (getELFBuildId (name, &build_id, &build_id_size) == -1) - continue; +/* find the debugsource package, if it has been created. + * We do this simply by searching for a package with the right name. */ +static Package findDebugsourcePackage(rpmSpec spec) +{ + Package pkg = NULL; + if (lookupPackage(spec, "debugsource", PART_SUBNAME|PART_QUIET, &pkg)) + return NULL; + return pkg && pkg->fileList ? pkg : NULL; +} - /* If we see build-id links for the first time add the - directory. */ - if (!seen_build_id) - argvAdd(&files, "%dir /usr/lib/debug/.build-id"); - - /* From the build-id construct the two links pointing back - to the debug information file and the binary. */ - snprintf (tmp, 1024, "/usr/lib/debug/.build-id/%02x/", - build_id[0]); - for (i = 1; i < build_id_size; ++i) - sprintf (tmp + strlen (tmp), "%02x", build_id[i]); - argvAdd(&files, tmp); - sprintf (tmp + strlen (tmp), ".debug"); - argvAdd(&files, tmp); - - free (build_id); - } +/* find the main debuginfo package. We do this simply by + * searching for a package with the right name. */ +static Package findDebuginfoPackage(rpmSpec spec) +{ + Package pkg = NULL; + if (lookupPackage(spec, "debuginfo", PART_SUBNAME|PART_QUIET, &pkg)) + return NULL; + return pkg && pkg->fileList ? pkg : NULL; +} - /* If there are debuginfo files for this package add a - new debuginfo package. */ - if (files) - { - /* Add security manifest to set right SMACK labels */ - argvAdd(&files, "%manifest %{name}-debuginfo.manifest"); - - dbg = newPackage (spec); - headerNVR (pkg->header, &name, NULL, NULL); - /* Set name, summary and group. */ - snprintf (tmp, 1024, "%s-debuginfo", name); - headerPutString(dbg->header, RPMTAG_NAME, tmp); - headerPutString(dbg->header, RPMTAG_VERSION, ver); - headerPutString(dbg->header, RPMTAG_RELEASE, rel); - headerPutString(dbg->header, RPMTAG_ARCH, a); - snprintf (tmp, 1024, "Debug information for package %s", name); - headerPutString(dbg->header, RPMTAG_SUMMARY, tmp); - snprintf (tmp, 1024, "This package provides debug information for package %s.\n" - "Debug information is useful when developing applications that use this\n" - "package or when debugging this package.", name); - headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp); - headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug"); - - /* Add 'provides' information to debuginfo package. */ - addPackageProvides_for_debuginfo_pkg(dbg->header); - - /* Inherit other tags from parent. */ - headerCopyTags (pkg->header, dbg->header, copyTagsForDebug); - - /* Build up the files list. */ - dbg->fileList = files; - } - } +/* add a dependency (e.g. RPMTAG_REQUIRENAME or RPMTAG_RECOMMENDNAME) + for package "to" into package "from". */ +static void addPackageDeps(Package from, Package to, enum rpmTag_e tag) +{ + const char *name; + char *evr, *isaprov; + name = headerGetString(to->header, RPMTAG_NAME); + evr = headerGetAsString(to->header, RPMTAG_EVR); + isaprov = rpmExpand(name, "%{?_isa}", NULL); + addReqProv(from, tag, isaprov, evr, RPMSENSE_EQUAL, 0); + free(isaprov); + free(evr); } -#endif rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, - int installSpecialDoc, int test) + int didInstall, int test) { Package pkg; rpmRC rc = RPMRC_OK; char *buildroot; + char *uniquearch = NULL; + Package maindbg = NULL; /* the (existing) main debuginfo package */ + Package deplink = NULL; /* create requires to this package */ + /* The debugsource package, if it exists, that the debuginfo package(s) + should Recommend. */ + Package dbgsrcpkg = findDebugsourcePackage(spec); +#if HAVE_LIBDW + elf_version (EV_CURRENT); +#endif check_fileList = newStringBuf(); - buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); genSourceRpmName(spec); + buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); + if (rpmExpandNumeric("%{?_debuginfo_subpackages}")) { + maindbg = findDebuginfoPackage(spec); + if (maindbg) { + /* move debuginfo package to back */ + if (maindbg->next) { + Package *pp; + /* dequeue */ + for (pp = &spec->packages; *pp != maindbg; pp = &(*pp)->next) + ; + *pp = maindbg->next; + maindbg->next = 0; + /* enqueue at tail */ + for (; *pp; pp = &(*pp)->next) + ; + *pp = maindbg; + } + /* delete unsplit file list, we will re-add files back later */ + maindbg->fileFile = argvFree(maindbg->fileFile); + maindbg->fileList = argvFree(maindbg->fileList); + if (rpmExpandNumeric("%{?_unique_debug_names}")) + uniquearch = rpmExpand("-%{VERSION}-%{RELEASE}.%{_arch}", NULL); + } + } else if (dbgsrcpkg != NULL) { + /* We have a debugsource package, but no debuginfo subpackages. + The main debuginfo package should recommend the debugsource one. */ + Package dbgpkg = findDebuginfoPackage(spec); + if (dbgpkg) + addPackageDeps(dbgpkg, dbgsrcpkg, RPMTAG_RECOMMENDNAME); + } + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { char *nvr; const char *a; int header_color; int arch_color; + if (pkg == maindbg) { + /* if there is just one debuginfo package, we put our extra stuff + * in it. Otherwise we put it in the main debug package */ + Package extradbg = !maindbg->fileList && maindbg->next && !maindbg->next->next ? + maindbg->next : maindbg; + if (addDebugDwz(extradbg, buildroot)) + deplink = extradbg; + if (addDebugSrc(extradbg, buildroot)) + deplink = extradbg; + if (dbgsrcpkg != NULL) + addPackageDeps(extradbg, dbgsrcpkg, RPMTAG_RECOMMENDNAME); + maindbg = NULL; /* all normal packages processed */ + } + if (pkg->fileList == NULL) continue; @@ -2406,13 +3116,17 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, nvr = headerGetAsString(pkg->header, RPMTAG_NVRA); rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr); free(nvr); - - if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK) + + if ((rc = processPackageFiles(spec, pkgFlags, pkg, didInstall, test)) != RPMRC_OK) goto exit; -#if HAVE_GELF_H && HAVE_LIBELF - addDebuginfoPackage(spec, pkg, buildroot); -#endif - if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) + + if (maindbg) + filterDebuginfoPackage(spec, pkg, maindbg, dbgsrcpkg, + buildroot, uniquearch); + else if (deplink && pkg != deplink) + addPackageDeps(pkg, deplink, RPMTAG_REQUIRENAME); + + if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK) goto exit; a = headerGetString(pkg->header, RPMTAG_ARCH); @@ -2447,6 +3161,8 @@ rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, } exit: check_fileList = freeStringBuf(check_fileList); + _free(buildroot); + _free(uniquearch); return rc; } diff --git a/build/pack.c b/build/pack.c index 6b71038..34e0568 100644 --- a/build/pack.c +++ b/build/pack.c @@ -6,8 +6,7 @@ #include "system.h" #include -#include -#include +#include #include /* RPMSIGTAG*, rpmReadPackageFile */ #include @@ -15,7 +14,6 @@ #include "rpmio/rpmio_internal.h" /* fdInitDigest, fdFiniDigest */ #include "lib/fsm.h" -#include "lib/cpio.h" #include "lib/signature.h" #include "lib/rpmlead.h" #include "build/rpmbuild_internal.h" @@ -23,15 +21,54 @@ #include "debug.h" -typedef struct cpioSourceArchive_s { - rpm_loff_t cpioArchiveSize; - rpmfi cpioList; -} * CSA_t; +static int rpmPackageFilesArchive(rpmfiles fi, int isSrc, + FD_t cfd, ARGV_t dpaths, + rpm_loff_t * archiveSize, char ** failedFile) +{ + int rc = 0; + rpmfi archive = rpmfiNewArchiveWriter(cfd, fi); + + while (!rc && (rc = rpmfiNext(archive)) >= 0) { + /* Copy file into archive. */ + FD_t rfd = NULL; + const char *path = dpaths[rpmfiFX(archive)]; + rfd = Fopen(path, "r.ufdio"); + if (Ferror(rfd)) { + rc = RPMERR_OPEN_FAILED; + } else { + rc = rpmfiArchiveWriteFile(archive, rfd); + } + + if (rc && failedFile) + *failedFile = xstrdup(path); + if (rfd) { + /* preserve any prior errno across close */ + int myerrno = errno; + Fclose(rfd); + errno = myerrno; + } + } + + if (rc == RPMERR_ITER_END) + rc = 0; + + /* Finish the payload stream */ + if (!rc) + rc = rpmfiArchiveClose(archive); + + if (archiveSize) + *archiveSize = (rc == 0) ? rpmfiArchiveTell(archive) : 0; + + rpmfiFree(archive); + + return rc; +} /** * @todo Create transaction set *much* earlier. */ -static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa, const char * fmodeMacro) +static rpmRC cpio_doio(FD_t fdo, Package pkg, const char * fmodeMacro, + rpm_loff_t *archiveSize) { char *failedFile = NULL; FD_t cfd; @@ -42,16 +79,18 @@ static rpmRC cpio_doio(FD_t fdo, Header h, CSA_t csa, const char * fmodeMacro) if (cfd == NULL) return RPMRC_FAIL; - fsmrc = rpmPackageFilesArchive(csa->cpioList, headerIsSource(h), cfd, - &csa->cpioArchiveSize, &failedFile); + fsmrc = rpmPackageFilesArchive(pkg->cpioList, headerIsSource(pkg->header), + cfd, pkg->dpaths, + archiveSize, &failedFile); if (fsmrc) { + char *emsg = rpmfileStrerror(fsmrc); if (failedFile) rpmlog(RPMLOG_ERR, _("create archive failed on file %s: %s\n"), - failedFile, rpmcpioStrerror(fsmrc)); + failedFile, emsg); else - rpmlog(RPMLOG_ERR, _("create archive failed: %s\n"), - rpmcpioStrerror(fsmrc)); + rpmlog(RPMLOG_ERR, _("create archive failed: %s\n"), emsg); + free(emsg); } free(failedFile); @@ -92,11 +131,13 @@ static rpmRC addFileToTag(rpmSpec spec, const char * file, } while (fgets(buf, sizeof(buf), f)) { - if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { + char *expanded; + if (rpmExpandMacros(spec->macros, buf, &expanded, 0) < 0) { rpmlog(RPMLOG_ERR, _("%s: line: %s\n"), fn, buf); goto exit; } - appendStringBuf(sb, buf); + appendStringBuf(sb, expanded); + free(expanded); } headerPutString(h, tag, getStringBuf(sb)); rc = RPMRC_OK; @@ -109,40 +150,31 @@ exit: return rc; } -static rpm_time_t * getBuildTime(void) -{ - static rpm_time_t buildTime[1]; - - if (buildTime[0] == 0) - buildTime[0] = (int32_t) time(NULL); - return buildTime; -} - -static const char * buildHost(void) -{ - static char hostname[1024]; - static int oneshot = 0; - struct hostent *hbn; - - if (! oneshot) { - (void) gethostname(hostname, sizeof(hostname)); - hbn = gethostbyname(hostname); - if (hbn) - strcpy(hostname, hbn->h_name); - else - rpmlog(RPMLOG_WARNING, - _("Could not canonicalize hostname: %s\n"), hostname); - oneshot = 1; - } - return(hostname); -} - static rpmRC processScriptFiles(rpmSpec spec, Package pkg) { struct TriggerFileEntry *p; int addflags = 0; rpmRC rc = RPMRC_FAIL; Header h = pkg->header; + struct TriggerFileEntry *tfa[] = {pkg->triggerFiles, + pkg->fileTriggerFiles, + pkg->transFileTriggerFiles}; + + rpmTagVal progTags[] = {RPMTAG_TRIGGERSCRIPTPROG, + RPMTAG_FILETRIGGERSCRIPTPROG, + RPMTAG_TRANSFILETRIGGERSCRIPTPROG}; + + rpmTagVal flagTags[] = {RPMTAG_TRIGGERSCRIPTFLAGS, + RPMTAG_FILETRIGGERSCRIPTFLAGS, + RPMTAG_TRANSFILETRIGGERSCRIPTFLAGS}; + + rpmTagVal scriptTags[] = {RPMTAG_TRIGGERSCRIPTS, + RPMTAG_FILETRIGGERSCRIPTS, + RPMTAG_TRANSFILETRIGGERSCRIPTS}; + rpmTagVal priorityTags[] = {0, + RPMTAG_FILETRIGGERPRIORITIES, + RPMTAG_TRANSFILETRIGGERPRIORITIES}; + int i; if (addFileToTag(spec, pkg->preInFile, h, RPMTAG_PREIN, 1) || addFileToTag(spec, pkg->preUnFile, h, RPMTAG_PREUN, 1) || @@ -155,30 +187,39 @@ static rpmRC processScriptFiles(rpmSpec spec, Package pkg) goto exit; } - /* if any trigger has flags, we need to add flags entry for all of them */ - for (p = pkg->triggerFiles; p != NULL; p = p->next) { - if (p->flags) { - addflags = 1; - break; - } - } - for (p = pkg->triggerFiles; p != NULL; p = p->next) { - headerPutString(h, RPMTAG_TRIGGERSCRIPTPROG, p->prog); - if (addflags) { - headerPutUint32(h, RPMTAG_TRIGGERSCRIPTFLAGS, &p->flags, 1); + for (i = 0; i < sizeof(tfa)/sizeof(tfa[0]); i++) { + addflags = 0; + /* if any trigger has flags, we need to add flags entry for all of them */ + for (p = tfa[i]; p != NULL; p = p->next) { + if (p->flags) { + addflags = 1; + break; + } } - if (p->script) { - headerPutString(h, RPMTAG_TRIGGERSCRIPTS, p->script); - } else if (p->fileName) { - if (addFileToTag(spec, p->fileName, h, RPMTAG_TRIGGERSCRIPTS, 0)) { - goto exit; + for (p = tfa[i]; p != NULL; p = p->next) { + headerPutString(h, progTags[i], p->prog); + + if (priorityTags[i]) { + headerPutUint32(h, priorityTags[i], &p->priority, 1); + } + + if (addflags) { + headerPutUint32(h, flagTags[i], &p->flags, 1); + } + + if (p->script) { + headerPutString(h, scriptTags[i], p->script); + } else if (p->fileName) { + if (addFileToTag(spec, p->fileName, h, scriptTags[i], 0)) { + goto exit; + } + } else { + /* This is dumb. When the header supports NULL string */ + /* this will go away. */ + headerPutString(h, scriptTags[i], ""); } - } else { - /* This is dumb. When the header supports NULL string */ - /* this will go away. */ - headerPutString(h, RPMTAG_TRIGGERSCRIPTS, ""); } } rc = RPMRC_OK; @@ -187,92 +228,40 @@ exit: return rc; } -static rpmRC copyPayload(FD_t ifd, const char *ifn, FD_t ofd, const char *ofn) +static int haveTildeDep(Package pkg) { - char buf[BUFSIZ]; - size_t nb; - rpmRC rc = RPMRC_OK; - - while ((nb = Fread(buf, 1, sizeof(buf), ifd)) > 0) { - if (Fwrite(buf, sizeof(buf[0]), nb, ofd) != nb) { - rpmlog(RPMLOG_ERR, _("Unable to write payload to %s: %s\n"), - ofn, Fstrerror(ofd)); - rc = RPMRC_FAIL; - break; + for (int i = 0; i < PACKAGE_NUM_DEPS; i++) { + rpmds ds = rpmdsInit(pkg->dependencies[i]); + while (rpmdsNext(ds) >= 0) { + if (strchr(rpmdsEVR(ds), '~')) + return 1; } } - - if (nb < 0) { - rpmlog(RPMLOG_ERR, _("Unable to read payload from %s: %s\n"), - ifn, Fstrerror(ifd)); - rc = RPMRC_FAIL; - } - - return rc; + return 0; } -static int depContainsTilde(Header h, rpmTagVal tagEVR) +static int haveRichDep(Package pkg) { - struct rpmtd_s evrs; - const char *evr = NULL; - - if (headerGet(h, tagEVR, &evrs, HEADERGET_MINMEM)) { - while ((evr = rpmtdNextString(&evrs)) != NULL) - if (strchr(evr, '~')) - break; - rpmtdFreeData(&evrs); + for (int i = 0; i < PACKAGE_NUM_DEPS; i++) { + rpmds ds = rpmdsInit(pkg->dependencies[i]); + rpmTagVal tagN = rpmdsTagN(ds); + if (tagN != RPMTAG_REQUIRENAME && tagN != RPMTAG_CONFLICTNAME) + continue; + while (rpmdsNext(ds) >= 0) { + if (rpmdsIsRich(ds)) + return 1; + } } - return evr != NULL; -} - -static rpmTagVal depevrtags[] = { - RPMTAG_PROVIDEVERSION, - RPMTAG_REQUIREVERSION, - RPMTAG_OBSOLETEVERSION, - RPMTAG_CONFLICTVERSION, - RPMTAG_ORDERVERSION, - RPMTAG_TRIGGERVERSION, - RPMTAG_SUGGESTSVERSION, - RPMTAG_ENHANCESVERSION, - 0 -}; - -static int haveTildeDep(Header h) -{ - int i; - - for (i = 0; depevrtags[i] != 0; i++) - if (depContainsTilde(h, depevrtags[i])) - return 1; return 0; } -static rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileName, - CSA_t csa, char **cookie) +static char *getIOFlags(Package pkg) { - FD_t fd = NULL; - FD_t ifd = NULL; - char * sigtarget = NULL;; - char * rpmio_flags = NULL; - char * SHA1 = NULL; + char *rpmio_flags; const char *s; - Header h; - Header sig = NULL; - int xx; - rpmRC rc = RPMRC_OK; - struct rpmtd_s td; - rpmTagVal sizetag; - rpmTagVal payloadtag; - - /* Transfer header reference form *hdrp to h. */ - h = headerLink(*hdrp); - *hdrp = headerFree(*hdrp); - - if (pkgidp) - *pkgidp = NULL; /* Save payload information */ - if (headerIsSource(h)) + if (headerIsSource(pkg->header)) rpmio_flags = rpmExpand("%{?_source_payload}", NULL); else rpmio_flags = rpmExpand("%{?_binary_payload}", NULL); @@ -286,7 +275,7 @@ static rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileNam if (s) { char *buf = NULL; const char *compr = NULL; - headerPutString(h, RPMTAG_PAYLOADFORMAT, "cpio"); + headerPutString(pkg->header, RPMTAG_PAYLOADFORMAT, "cpio"); if (rstreq(s+1, "ufdio")) { compr = NULL; @@ -296,252 +285,300 @@ static rpmRC writeRPM(Header *hdrp, unsigned char ** pkgidp, const char *fileNam } else if (rstreq(s+1, "bzdio")) { compr = "bzip2"; /* Add prereq on rpm version that understands bzip2 payloads */ - (void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1"); + (void) rpmlibNeedsFeature(pkg, "PayloadIsBzip2", "3.0.5-1"); #endif #if HAVE_LZMA_H } else if (rstreq(s+1, "xzdio")) { compr = "xz"; - (void) rpmlibNeedsFeature(h, "PayloadIsXz", "5.2-1"); + (void) rpmlibNeedsFeature(pkg, "PayloadIsXz", "5.2-1"); } else if (rstreq(s+1, "lzdio")) { compr = "lzma"; - (void) rpmlibNeedsFeature(h, "PayloadIsLzma", "4.4.6-1"); + (void) rpmlibNeedsFeature(pkg, "PayloadIsLzma", "4.4.6-1"); +#endif +#ifdef HAVE_ZSTD + } else if (rstreq(s+1, "zstdio")) { + compr = "zstd"; + /* Add prereq on rpm version that understands zstd payloads */ + (void) rpmlibNeedsFeature(pkg, "PayloadIsZstd", "5.4.18-1"); #endif } else { rpmlog(RPMLOG_ERR, _("Unknown payload compression: %s\n"), rpmio_flags); - rc = RPMRC_FAIL; + rpmio_flags = _free(rpmio_flags); goto exit; } if (compr) - headerPutString(h, RPMTAG_PAYLOADCOMPRESSOR, compr); + headerPutString(pkg->header, RPMTAG_PAYLOADCOMPRESSOR, compr); buf = xstrdup(rpmio_flags); buf[s - rpmio_flags] = '\0'; - headerPutString(h, RPMTAG_PAYLOADFLAGS, buf+1); + headerPutString(pkg->header, RPMTAG_PAYLOADFLAGS, buf+1); free(buf); } +exit: + return rpmio_flags; +} +static void finalizeDeps(Package pkg) +{ /* check if the package has a dependency with a '~' */ - if (haveTildeDep(h)) - (void) rpmlibNeedsFeature(h, "TildeInVersions", "4.10.0-1"); + if (haveTildeDep(pkg)) + (void) rpmlibNeedsFeature(pkg, "TildeInVersions", "4.10.0-1"); + + /* check if the package has a rich dependency */ + if (haveRichDep(pkg)) + (void) rpmlibNeedsFeature(pkg, "RichDependencies", "4.12.0-1"); + + /* All dependencies added finally, write them into the header */ + for (int i = 0; i < PACKAGE_NUM_DEPS; i++) { + /* Nuke any previously added dependencies from the header */ + headerDel(pkg->header, rpmdsTagN(pkg->dependencies[i])); + headerDel(pkg->header, rpmdsTagEVR(pkg->dependencies[i])); + headerDel(pkg->header, rpmdsTagF(pkg->dependencies[i])); + headerDel(pkg->header, rpmdsTagTi(pkg->dependencies[i])); + /* ...and add again, now with automatic dependencies included */ + rpmdsPutToHeader(pkg->dependencies[i], pkg->header); + } +} - /* Create and add the cookie */ - if (cookie) { - rasprintf(cookie, "%s %d", buildHost(), (int) (*getBuildTime())); - headerPutString(h, RPMTAG_COOKIE, *cookie); +static void *nullDigest(int algo, int ascii) +{ + void *d = NULL; + DIGEST_CTX ctx = rpmDigestInit(algo, 0); + rpmDigestFinal(ctx, &d, NULL, ascii); + return d; +} + +static rpmRC fdJump(FD_t fd, off_t offset) +{ + if (Fseek(fd, offset, SEEK_SET) < 0) { + rpmlog(RPMLOG_ERR, _("Could not seek in file %s: %s\n"), + Fdescr(fd), Fstrerror(fd)); + return RPMRC_FAIL; } + return RPMRC_OK; +} - /* - * Add system-wide Tizen build information - */ - char *buildinfo = rpmExpand("%{?_buildinfo}", NULL); - if (buildinfo && *buildinfo) { - int err; - int count = 0; - char **strings = NULL; - - if ((err = poptParseArgvString(buildinfo, &count, &strings))) { - rc = RPMRC_FAIL; - free(buildinfo); - rpmlog(RPMLOG_ERR, _("Can't parse BUILDINFO tag: %s\n"), poptStrerror(err)); - goto exit; - } +static rpmRC fdConsume(FD_t fd, off_t start, off_t nbytes) +{ + size_t bufsiz = 32*BUFSIZ; + unsigned char buf[bufsiz]; + off_t left = nbytes; + ssize_t nb; - if (count) - headerPutStringArray(h, RPMTAG_BUILDINFO, strings, count); + if (start && fdJump(fd, start)) + return RPMRC_FAIL; - strings = _free(strings); - } - free(buildinfo); + while (left > 0) { + nb = Fread(buf, 1, (left < bufsiz) ? left : bufsiz, fd); + if (nb > 0) + left -= nb; + else + break; + }; - /* Reallocate the header into one contiguous region. */ - h = headerReload(h, RPMTAG_HEADERIMMUTABLE); - if (h == NULL) { /* XXX can't happen */ - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to create immutable header region.\n")); - goto exit; + if (left) { + rpmlog(RPMLOG_ERR, _("Failed to read %jd bytes in file %s: %s\n"), + (intmax_t) nbytes, Fdescr(fd), Fstrerror(fd)); } - /* Re-reference reallocated header. */ - *hdrp = headerLink(h); - /* - * Write the header+archive into a temp file so that the size of - * archive (after compression) can be added to the header. - */ - fd = rpmMkTempFile(NULL, &sigtarget); - if (fd == NULL || Ferror(fd)) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to open temp file.\n")); + return (left == 0) ? RPMRC_OK : RPMRC_FAIL; +} + +static rpmRC writeHdr(FD_t fd, Header pkgh) +{ + /* Reallocate the header into one contiguous region for writing. */ + Header h = headerReload(headerCopy(pkgh), RPMTAG_HEADERIMMUTABLE); + rpmRC rc = RPMRC_FAIL; + + if (h == NULL) { + rpmlog(RPMLOG_ERR,_("Unable to create immutable header region\n")); goto exit; } - fdInitDigest(fd, PGPHASHALGO_SHA1, 0); if (headerWrite(fd, h, HEADER_MAGIC_YES)) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to write temp header\n")); - } else { /* Write the archive and get the size */ - (void) Fflush(fd); - fdFiniDigest(fd, PGPHASHALGO_SHA1, (void **)&SHA1, NULL, 1); - if (csa->cpioList != NULL) { - rc = cpio_doio(fd, h, csa, rpmio_flags); - } else { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Bad CSA data\n")); - } + rpmlog(RPMLOG_ERR, _("Unable to write header to %s: %s\n"), + Fdescr(fd), Fstrerror(fd)); + goto exit; } + (void) Fflush(fd); + rc = RPMRC_OK; + +exit: + headerFree(h); + return rc; +} + +/* + * This is more than just a little insane: + * In order to write the signature, we need to know the size and + * the size and digests of the header and payload, which are located + * after the signature on disk. We also need a digest of the compressed + * payload for the main header, and of course the payload is after the + * header on disk. So we need to create placeholders for both the + * signature and main header that exactly match the final sizes, calculate + * the payload digest, then generate and write the real main header to + * be able to FINALLY calculate the digests we need for the signature + * header. In other words, we need to write things in the exact opposite + * order to how the RPM format is laid on disk. + */ +static rpmRC writeRPM(Package pkg, unsigned char ** pkgidp, + const char *fileName, char **cookie, + rpm_time_t buildTime, const char* buildHost) +{ + FD_t fd = NULL; + char * rpmio_flags = NULL; + char * SHA1 = NULL; + char * SHA256 = NULL; + uint8_t * MD5 = NULL; + char * pld = NULL; + uint32_t pld_algo = PGPHASHALGO_SHA256; /* TODO: macro configuration */ + rpmRC rc = RPMRC_FAIL; /* assume failure */ + rpm_loff_t archiveSize = 0; + off_t sigStart, hdrStart, payloadStart, payloadEnd; - if (rc != RPMRC_OK) + if (pkgidp) + *pkgidp = NULL; + + rpmio_flags = getIOFlags(pkg); + if (!rpmio_flags) goto exit; - (void) Fclose(fd); - fd = NULL; - (void) unlink(fileName); + finalizeDeps(pkg); - /* Generate the signature */ - (void) fflush(stdout); - sig = rpmNewSignature(); + /* Create and add the cookie */ + if (cookie) { + rasprintf(cookie, "%s %d", buildHost, buildTime); + headerPutString(pkg->header, RPMTAG_COOKIE, *cookie); + } /* - * There should be rpmlib() dependency on this, but that doesn't - * really do much good as these are signature tags that get read - * way before dependency checking has a chance to figure out anything. - * On the positive side, not inserting the 32bit tag at all means - * older rpm will just bail out with error message on attempt to read - * such a package. + * Add system-wide Tizen build information */ - if (csa->cpioArchiveSize < UINT32_MAX) { - sizetag = RPMSIGTAG_SIZE; - payloadtag = RPMSIGTAG_PAYLOADSIZE; - } else { - sizetag = RPMSIGTAG_LONGSIZE; - payloadtag = RPMSIGTAG_LONGARCHIVESIZE; - } - (void) rpmGenDigest(sig, sigtarget, sizetag); - (void) rpmGenDigest(sig, sigtarget, RPMSIGTAG_MD5); - - if (SHA1) { - /* XXX can't use rpmtdFromFoo() on RPMSIGTAG_* items */ - rpmtdReset(&td); - td.tag = RPMSIGTAG_SHA1; - td.type = RPM_STRING_TYPE; - td.data = SHA1; - td.count = 1; - headerPut(sig, &td, HEADERPUT_DEFAULT); - SHA1 = _free(SHA1); - } + char *buildinfo = rpmExpand("%{?_buildinfo}", NULL); + if (buildinfo && *buildinfo) { + int xx; + int count = 0; + char **strings = NULL; - { - /* XXX can't use headerPutType() on legacy RPMSIGTAG_* items */ - rpmtdReset(&td); - td.tag = payloadtag; - td.count = 1; - if (payloadtag == RPMSIGTAG_PAYLOADSIZE) { - rpm_off_t asize = csa->cpioArchiveSize; - td.type = RPM_INT32_TYPE; - td.data = &asize; - headerPut(sig, &td, HEADERPUT_DEFAULT); - } else { - rpm_loff_t asize = csa->cpioArchiveSize; - td.type = RPM_INT64_TYPE; - td.data = &asize; - headerPut(sig, &td, HEADERPUT_DEFAULT); - } + + if ((xx = poptParseArgvString(buildinfo, &count, &strings))) { + rc = RPMRC_FAIL; + free(buildinfo); + rpmlog(RPMLOG_ERR, _("Can't parse BUILDINFO tag: %s\n"), poptStrerror(xx)); + goto exit; + } + + if (count) + headerPutStringArray(pkg->header, RPMTAG_BUILDINFO, strings, count); + + strings = _free(strings); } + free(buildinfo); - /* Reallocate the signature into one contiguous region. */ - sig = headerReload(sig, RPMTAG_HEADERSIGNATURES); - if (sig == NULL) { /* XXX can't happen */ - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to reload signature header.\n")); + /* Create a dummy payload digest to get the header size right */ + pld = nullDigest(pld_algo, 1); + headerPutUint32(pkg->header, RPMTAG_PAYLOADDIGESTALGO, &pld_algo, 1); + headerPutString(pkg->header, RPMTAG_PAYLOADDIGEST, pld); + pld = _free(pld); + + /* Check for UTF-8 encoding of string tags, add encoding tag if all good */ + if (checkForEncoding(pkg->header, 1)) goto exit; - } /* Open the output file */ - fd = Fopen(fileName, "w.ufdio"); + fd = Fopen(fileName, "w+.ufdio"); if (fd == NULL || Ferror(fd)) { - rc = RPMRC_FAIL; rpmlog(RPMLOG_ERR, _("Could not open %s: %s\n"), fileName, Fstrerror(fd)); goto exit; } /* Write the lead section into the package. */ - { - rpmlead lead = rpmLeadFromHeader(h); - rc = rpmLeadWrite(fd, lead); - rpmLeadFree(lead); - if (rc != RPMRC_OK) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), - Fstrerror(fd)); - goto exit; - } + if (rpmLeadWrite(fd, pkg->header)) { + rpmlog(RPMLOG_ERR, _("Unable to write package: %s\n"), Fstrerror(fd)); + goto exit; } - /* Write the signature section into the package. */ - if (rpmWriteSignature(fd, sig)) { - rc = RPMRC_FAIL; + /* Save the position of signature section */ + sigStart = Ftell(fd); + + /* Generate and write a placeholder signature header */ + SHA1 = nullDigest(PGPHASHALGO_SHA1, 1); + SHA256 = nullDigest(PGPHASHALGO_SHA256, 1); + MD5 = nullDigest(PGPHASHALGO_MD5, 0); + if (rpmGenerateSignature(SHA256, SHA1, MD5, 0, 0, fd)) goto exit; - } + SHA1 = _free(SHA1); + SHA256 = _free(SHA256); + MD5 = _free(MD5); - /* Append the header and archive */ - ifd = Fopen(sigtarget, "r.ufdio"); - if (ifd == NULL || Ferror(ifd)) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to open sigtarget %s: %s\n"), - sigtarget, Fstrerror(ifd)); + /* Write a placeholder header. */ + hdrStart = Ftell(fd); + if (writeHdr(fd, pkg->header)) goto exit; - } - /* Add signatures to header, and write header into the package. */ - /* XXX header+payload digests/signatures might be checked again here. */ - { Header nh = headerRead(ifd, HEADER_MAGIC_YES); + /* Write payload section (cpio archive) */ + payloadStart = Ftell(fd); + if (cpio_doio(fd, pkg, rpmio_flags, &archiveSize)) + goto exit; + payloadEnd = Ftell(fd); - if (nh == NULL) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to read header from %s: %s\n"), - sigtarget, Fstrerror(ifd)); - goto exit; - } + /* Re-read payload to calculate compressed digest */ + fdInitDigestID(fd, pld_algo, RPMTAG_PAYLOADDIGEST, 0); + if (fdConsume(fd, payloadStart, payloadEnd - payloadStart)) + goto exit; + fdFiniDigest(fd, RPMTAG_PAYLOADDIGEST, (void **)&pld, NULL, 1); - xx = headerWrite(fd, nh, HEADER_MAGIC_YES); - headerFree(nh); + /* Insert the payload digest in main header */ + headerDel(pkg->header, RPMTAG_PAYLOADDIGEST); + headerPutString(pkg->header, RPMTAG_PAYLOADDIGEST, pld); + pld = _free(pld); - if (xx) { - rc = RPMRC_FAIL; - rpmlog(RPMLOG_ERR, _("Unable to write header to %s: %s\n"), - fileName, Fstrerror(fd)); - goto exit; - } - } - - /* Write the payload into the package. */ - rc = copyPayload(ifd, fileName, fd, sigtarget); + /* Write the final header */ + if (fdJump(fd, hdrStart)) + goto exit; + if (writeHdr(fd, pkg->header)) + goto exit; + + /* Calculate digests: SHA on header, legacy MD5 on header + payload */ + fdInitDigestID(fd, PGPHASHALGO_MD5, RPMTAG_SIGMD5, 0); + fdInitDigestID(fd, PGPHASHALGO_SHA1, RPMTAG_SHA1HEADER, 0); + fdInitDigestID(fd, PGPHASHALGO_SHA256, RPMTAG_SHA256HEADER, 0); + if (fdConsume(fd, hdrStart, payloadStart - hdrStart)) + goto exit; + fdFiniDigest(fd, RPMTAG_SHA1HEADER, (void **)&SHA1, NULL, 1); + fdFiniDigest(fd, RPMTAG_SHA256HEADER, (void **)&SHA256, NULL, 1); + + if (fdConsume(fd, 0, payloadEnd - payloadStart)) + goto exit; + fdFiniDigest(fd, RPMTAG_SIGMD5, (void **)&MD5, NULL, 0); + + if (fdJump(fd, sigStart)) + goto exit; + + /* Generate the signature. Now with right values */ + if (rpmGenerateSignature(SHA256, SHA1, MD5, payloadEnd - hdrStart, archiveSize, fd)) + goto exit; + + rc = RPMRC_OK; exit: free(rpmio_flags); free(SHA1); - headerFree(h); + free(SHA256); /* XXX Fish the pkgid out of the signature header. */ - if (sig != NULL && pkgidp != NULL) { - struct rpmtd_s md5tag; - headerGet(sig, RPMSIGTAG_MD5, &md5tag, HEADERGET_DEFAULT); - if (rpmtdType(&md5tag) == RPM_BIN_TYPE && - md5tag.count == 16 && md5tag.data != NULL) { - *pkgidp = md5tag.data; + if (pkgidp != NULL) { + if (MD5 != NULL) { + *pkgidp = MD5; } + } else { + free(MD5); } - rpmFreeSignature(sig); - Fclose(ifd); Fclose(fd); - if (sigtarget) { - (void) unlink(sigtarget); - free(sigtarget); - } - if (rc == RPMRC_OK) rpmlog(RPMLOG_NOTICE, _("Wrote: %s\n"), fileName); else @@ -576,78 +613,13 @@ static rpmRC checkPackages(char *pkgcheck) return RPMRC_OK; } -static void trimChangelog(Header h) +static rpmRC packageBinary(rpmSpec spec, Package pkg, const char *cookie, int cheating, char** filename) { - static int oneshot; - static int cuttime, minnum, maxnum; - int * times; - char ** names = 0, ** texts = 0; - int i, keep, count = 0; - - if (!oneshot) { - char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL); - oneshot = 1; - if (binarychangelogtrim && *binarychangelogtrim) { - maxnum = atoi(binarychangelogtrim); - binarychangelogtrim = strchr(binarychangelogtrim, ','); - if (binarychangelogtrim) - binarychangelogtrim++; - } - if (binarychangelogtrim && *binarychangelogtrim) { - cuttime = atoi(binarychangelogtrim); - binarychangelogtrim = strchr(binarychangelogtrim, ','); - if (binarychangelogtrim) - binarychangelogtrim++; - } - if (binarychangelogtrim && *binarychangelogtrim) { - minnum = atoi(binarychangelogtrim); - binarychangelogtrim = strchr(binarychangelogtrim, ','); - } - } - if (!cuttime && !minnum && !maxnum) { - return; - } - if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count)) - return; - if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) { - return; - } - keep = count; - if (maxnum && keep > maxnum) - keep = maxnum; - if (cuttime) { - for (i = 0; i < keep; i++) { - if (i >= minnum && times[i] < cuttime) - break; - } - keep = i; - } - if (keep >= count) - return; - headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count); - headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count); - headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, keep); - headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, keep); - headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, keep); - free(names); - free(texts); -} - -rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) -{ - struct cpioSourceArchive_s csabuf; - CSA_t csa = &csabuf; - rpmRC rc; - const char *errorString; - Package pkg; - char *pkglist = NULL; - - trimChangelog(spec->packages->header); - for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - char *fn; + const char *errorString; + rpmRC rc = RPMRC_OK; if (pkg->fileList == NULL) - continue; + return rc; if ((rc = processScriptFiles(spec, pkg))) return rc; @@ -660,15 +632,15 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) headerCopyTags(spec->packages->header, pkg->header, copyTags); headerPutString(pkg->header, RPMTAG_RPMVERSION, VERSION); - headerPutString(pkg->header, RPMTAG_BUILDHOST, buildHost()); - headerPutUint32(pkg->header, RPMTAG_BUILDTIME, getBuildTime(), 1); + headerPutString(pkg->header, RPMTAG_BUILDHOST, spec->buildHost); + headerPutUint32(pkg->header, RPMTAG_BUILDTIME, &(spec->buildTime), 1); if (spec->sourcePkgId != NULL) { headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16); } if (cheating) { - (void) rpmlibNeedsFeature(pkg->header, "ShortCircuited", "4.9.0-1"); + (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1"); } { char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); @@ -681,14 +653,14 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) headerGetString(pkg->header, RPMTAG_NAME), errorString); return RPMRC_FAIL; } - fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); + *filename = rpmGetPath("%{_rpmdir}/", binRpm, NULL); if ((binDir = strchr(binRpm, '/')) != NULL) { struct stat st; char *dn; *binDir = '\0'; dn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); if (stat(dn, &st) < 0) { - switch(errno) { + switch (errno) { case ENOENT: if (mkdir(dn, 0755) == 0) break; @@ -703,19 +675,28 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) free(binRpm); } - memset(csa, 0, sizeof(*csa)); - csa->cpioArchiveSize = 0; - csa->cpioList = rpmfiLink(pkg->cpioList); - - rc = writeRPM(&pkg->header, NULL, fn, csa, NULL); - csa->cpioList = rpmfiFree(csa->cpioList); + rc = writeRPM(pkg, NULL, *filename, NULL, spec->buildTime, spec->buildHost); if (rc == RPMRC_OK) { /* Do check each written package if enabled */ - char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", fn, NULL); + char *pkgcheck = rpmExpand("%{?_build_pkgcheck} ", *filename, NULL); if (pkgcheck[0] != ' ') { rc = checkPackages(pkgcheck); } free(pkgcheck); + } + return rc; +} + +rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) +{ + rpmRC rc; + Package pkg; + char *pkglist = NULL; + + for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + char *fn = NULL; + rc = packageBinary(spec, pkg, cookie, cheating, &fn); + if (rc == RPMRC_OK) { rstrcat(&pkglist, fn); rstrcat(&pkglist, " "); } @@ -741,32 +722,28 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating) rpmRC packageSources(rpmSpec spec, char **cookie) { - struct cpioSourceArchive_s csabuf; - CSA_t csa = &csabuf; + Package sourcePkg = spec->sourcePackage; rpmRC rc; + uint32_t one = 1; /* Add some cruft */ - headerPutString(spec->sourceHeader, RPMTAG_RPMVERSION, VERSION); - headerPutString(spec->sourceHeader, RPMTAG_BUILDHOST, buildHost()); - headerPutUint32(spec->sourceHeader, RPMTAG_BUILDTIME, getBuildTime(), 1); + headerPutString(sourcePkg->header, RPMTAG_RPMVERSION, VERSION); + headerPutString(sourcePkg->header, RPMTAG_BUILDHOST, spec->buildHost); + headerPutUint32(sourcePkg->header, RPMTAG_BUILDTIME, &(spec->buildTime), 1); + headerPutUint32(sourcePkg->header, RPMTAG_SOURCEPACKAGE, &one, 1); /* XXX this should be %_srpmdir */ { char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL); char *pkgcheck = rpmExpand("%{?_build_pkgcheck_srpm} ", fn, NULL); - memset(csa, 0, sizeof(*csa)); - csa->cpioArchiveSize = 0; - csa->cpioList = rpmfiLink(spec->sourceCpioList); - spec->sourcePkgId = NULL; - rc = writeRPM(&spec->sourceHeader, &spec->sourcePkgId, fn, csa, cookie); + rc = writeRPM(sourcePkg, &spec->sourcePkgId, fn, cookie, spec->buildTime, spec->buildHost); /* Do check SRPM package if enabled */ if (rc == RPMRC_OK && pkgcheck[0] != ' ') { rc = checkPackages(pkgcheck); } - rpmfiFree(csa->cpioList); free(pkgcheck); free(fn); } diff --git a/build/parseBuildInstallClean.c b/build/parseBuildInstallClean.c index 7cfd707..f7b4bb7 100644 --- a/build/parseBuildInstallClean.c +++ b/build/parseBuildInstallClean.c @@ -49,7 +49,7 @@ int parseBuildInstallClean(rpmSpec spec, int parsePart) if (parsePart == PART_BUILD) { char* buf = strdup( - "if [[ $RPM_ARCH == \"aarch64\" ]]; then\n" + "if [[ `uname -m` == \"aarch64\" ]]; then\n" "ref=/usr/lib/rpm\n" "for s in guess sub; do\n" " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n" diff --git a/build/parseChangelog.c b/build/parseChangelog.c index b06c923..105bb20 100644 --- a/build/parseChangelog.c +++ b/build/parseChangelog.c @@ -32,17 +32,20 @@ static int sameDate(const struct tm *ot, const struct tm *nt) /** * Parse date string to seconds. + * accepted date formats are "Mon Jun 6 2016" (original one) + * and "Thu Oct 6 06:48:39 CEST 2016" (extended one) * @param datestr date string (e.g. 'Wed Jan 1 1997') * @retval secs secs since the unix epoch * @return 0 on success, -1 on error */ -static int dateToTimet(const char * datestr, time_t * secs) +static int dateToTimet(const char * datestr, time_t * secs, int * date_words) { int rc = -1; /* assume failure */ struct tm time, ntime; const char * const * idx; char *p, *pe, *q, *date, *tz; - + char tz_name[10]; /* name of timezone (if extended format is used) */ + static const char * const days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", NULL }; static const char * const months[] = @@ -80,26 +83,93 @@ static int dateToTimet(const char * datestr, time_t * secs) if (*p == '\0') goto exit; pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; - /* make this noon so the day is always right (as we make this UTC) */ - time.tm_hour = 12; - time.tm_mday = strtol(p, &q, 10); if (!(q && *q == '\0')) goto exit; if (time.tm_mday < 0 || time.tm_mday > lengths[time.tm_mon]) goto exit; - /* year */ - p = pe; SKIPSPACE(p); - if (*p == '\0') goto exit; - pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe = '\0'; + /* first part of year entry (original format) / time entry (extended format)*/ + p = pe; + SKIPSPACE(p); + if (*p == '\0') + goto exit; + + /* in the original format here is year record (e.g. 1999), + * in the extended one here is time stamp (e.g. 10:22:30). + * Choose the format + */ + if ((p[1]==':') || ((p[1]!='\0') && ((p[2]==':')))) { + /* it can be extended format */ + *date_words = 6; + + /* second part of time entry */ + /* hours */ + time.tm_hour = strtol(p, &q, 10); + if ( (time.tm_hour < 0) || (time.tm_hour > 23) ) + goto exit; + if (*q!=':') + goto exit; + p = ++q; + /* minutes */ + time.tm_min = strtol(p, &q, 10); + if ( (time.tm_min < 0) || (time.tm_min > 59) ) + goto exit; + if (*q != ':') + goto exit; + p = ++q; + /* time - seconds */ + time.tm_sec = strtol(p, &q, 10); + if ( (time.tm_sec < 0) || (time.tm_sec > 59) ) + goto exit; + p = q; + + /* time zone name */ + SKIPSPACE(p); + if (*p == '\0') + goto exit; + pe = p; + SKIPNONSPACE(pe); + if (*pe != '\0') + *pe++ = '\0'; + if (((int)(pe-p) + 1) > 9 ) + goto exit; + strncpy(tz_name, p, (int)(pe-p)); + tz_name[(int)(pe-p)] = '\0'; + + /* first part of year entry */ + p = pe; + SKIPSPACE(p); + if (*p == '\0') + goto exit; + } else { + *date_words = 4; + /* the original format */ + /* make this noon so the day is always right (as we make this UTC) */ + time.tm_hour = 12; + } + + /* year - second part */ + pe = p; + SKIPNONSPACE(pe); + if (*pe != '\0') + *pe = '\0'; time.tm_year = strtol(p, &q, 10); if (!(q && *q == '\0')) goto exit; if (time.tm_year < 1990 || time.tm_year >= 3000) goto exit; time.tm_year -= 1900; - /* chnagelog date is always in UTC */ + /* change time zone and compute calendar time representation */ tz = getenv("TZ"); - if (tz) tz = xstrdup(tz); - setenv("TZ", "UTC", 1); + if (tz) + tz = xstrdup(tz); + if (*date_words == 6) { + /* changelog date is in read time zone */ + tz = getenv("TZ"); + if (tz) tz = xstrdup(tz); + setenv("TZ", tz_name, 1); + } else { + /* changelog date is always in UTC */ + setenv("TZ", "UTC", 1); + } ntime = time; /* struct assignment */ *secs = mktime(&ntime); unsetenv("TZ"); @@ -107,6 +177,7 @@ static int dateToTimet(const char * datestr, time_t * secs) setenv("TZ", tz, 1); free(tz); } + if (*secs == -1) goto exit; /* XXX Turn this into a hard error in a release or two */ @@ -135,6 +206,7 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb) time_t lastTime = 0; time_t trimtime = rpmExpandNumeric("%{?_changelog_trimtime}"); char *date, *name, *text, *next; + int date_words; /* number of words in date string */ s = sp = argvJoin(sb, ""); @@ -149,7 +221,7 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb) /* find end of line */ date = s; - while(*s && *s != '\n') s++; + while (*s && *s != '\n') s++; if (! *s) { rpmlog(RPMLOG_ERR, _("incomplete %%changelog entry\n")); goto exit; @@ -160,12 +232,8 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb) /* 4 fields of date */ date++; s = date; - for (i = 0; i < 4; i++) { - SKIPSPACE(s); - SKIPNONSPACE(s); - } SKIPSPACE(date); - if (dateToTimet(date, &time)) { + if (dateToTimet(date, &time, &date_words)) { rpmlog(RPMLOG_ERR, _("bad date in %%changelog: %s\n"), date); goto exit; } @@ -174,6 +242,10 @@ static rpmRC addChangelog(Header h, ARGV_const_t sb) _("%%changelog not in descending chronological order\n")); goto exit; } + for (i = 0; i < date_words; i++) { + SKIPSPACE(s); + SKIPNONSPACE(s); + } lastTime = time; /* skip space to the name */ @@ -237,6 +309,11 @@ int parseChangelog(rpmSpec spec) { int nextPart, rc, res = PART_ERROR; ARGV_t sb = NULL; + + if (headerIsEntry(spec->packages->header, RPMTAG_CHANGELOGTIME)) { + rpmlog(RPMLOG_ERR, _("line %d: second %%changelog\n"), spec->lineNum); + goto exit; + } /* There are no options to %changelog */ if ((rc = readLine(spec, STRIP_COMMENTS)) > 0) { diff --git a/build/parseDescription.c b/build/parseDescription.c index f233d8d..428821e 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -60,22 +60,8 @@ int parseDescription(rpmSpec spec) } } - if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), - spec->lineNum, spec->line); + if (lookupPackage(spec, name, flag, &pkg)) goto exit; - } - - - /******************/ - -#if 0 - if (headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { - rpmlog(RPMLOG_ERR, _("line %d: Second description\n"), - spec->lineNum); - goto exit; - } -#endif sb = newStringBuf(); @@ -99,11 +85,10 @@ int parseDescription(rpmSpec spec) } stripTrailingBlanksStringBuf(sb); - if (!((spec->flags & RPMSPEC_NOLANG) && !rstreq(lang, RPMBUILD_DEFAULT_LANG))) { - (void) headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION, - getStringBuf(sb), lang); + if (addLangTag(spec, pkg->header, + RPMTAG_DESCRIPTION, getStringBuf(sb), lang)) { + nextPart = PART_ERROR; } - exit: freeStringBuf(sb); diff --git a/build/parseFiles.c b/build/parseFiles.c index ea0d638..5ccc945 100644 --- a/build/parseFiles.c +++ b/build/parseFiles.c @@ -27,7 +27,7 @@ int parseFiles(rpmSpec spec) }; /* XXX unmask %license while parsing %files */ - addMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC); + rpmPushMacro(spec->macros, "license", NULL, "%%license", RMIL_SPEC); if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { rpmlog(RPMLOG_ERR, _("line %d: Error parsing %%files: %s\n"), @@ -61,10 +61,18 @@ int parseFiles(rpmSpec spec) } } - if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), - spec->lineNum, spec->line); + if (lookupPackage(spec, name, flag, &pkg)) goto exit; + + /* + * This should be an error, but its surprisingly commonly abused for the + * effect of multiple -f arguments in versions that dont support it. + * Warn but preserve behavior, except for leaking memory. + */ + if (pkg->fileList != NULL) { + rpmlog(RPMLOG_WARNING, _("line %d: multiple %%files for package '%s'\n"), + spec->lineNum, rpmstrPoolStr(pkg->pool, pkg->name)); + pkg->fileList = argvFree(pkg->fileList); } for (arg=1; arglineNum, spec->line); + if (lookupPackage(spec, name, flag, &pkg)) goto exit; - } if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { nextPart = PART_NONE; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index f02e14e..96bf9c0 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -19,8 +19,8 @@ #define SKIPSPACE(s) { while (*(s) && risspace(*(s))) (s)++; } #define SKIPNONSPACE(s) { while (*(s) && !risspace(*(s))) (s)++; } -#define SKIPWHITE(_x) {while(*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} -#define SKIPNONWHITE(_x){while(*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPWHITE(_x) {while (*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while (*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} /** */ @@ -92,7 +92,7 @@ static int parseSimplePart(const char *line, char **name, int *flag) *name = NULL; if (!(tok = strtok(NULL, " \t\n"))) { - rc = 0; + rc = 1; goto exit; } @@ -299,14 +299,14 @@ static int addSource(rpmSpec spec, Package pkg, const char *field, rpmTagVal tag rasprintf(&buf, "%s%d", (flag & RPMBUILD_ISPATCH) ? "PATCH" : "SOURCE", num); - addMacro(spec->macros, buf, NULL, body, RMIL_SPEC); + rpmPushMacro(spec->macros, buf, NULL, body, RMIL_SPEC); free(buf); rasprintf(&buf, "%sURL%d", (flag & RPMBUILD_ISPATCH) ? "PATCH" : "SOURCE", num); - addMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC); + rpmPushMacro(spec->macros, buf, NULL, p->fullSource, RMIL_SPEC); free(buf); #ifdef WITH_LUA - if (!spec->recursing) { + { rpmlua lua = NULL; /* global state */ const char * what = (flag & RPMBUILD_ISPATCH) ? "patches" : "sources"; rpmluaPushTable(lua, what); @@ -428,6 +428,11 @@ static rpmRC checkForValidArchitectures(rpmSpec spec) char *arch = rpmExpand("%{_target_cpu}", NULL); char *os = rpmExpand("%{_target_os}", NULL); rpmRC rc = RPMRC_FAIL; /* assume failure */ + + if (!strcmp(arch, "noarch")) { + free(arch); + arch = rpmExpand("%{_build_cpu}", NULL); + } if (isMemberInEntry(spec->buildRestrictions, arch, RPMTAG_EXCLUDEARCH) == 1) { @@ -539,6 +544,13 @@ static void fillOutMainPackage(Header h) /** */ +void copyInheritedTags(Header h, Header fromh) +{ + headerCopyTags(fromh, h, (rpmTagVal *)copyTagsDuringParse); +} + +/** + */ static rpmRC readIcon(Header h, const char * file) { char *fn = NULL; @@ -598,36 +610,113 @@ if (multiToken) { \ return RPMRC_FAIL; \ } +static void specLog(rpmSpec spec, int lvl, const char *line, const char *msg) +{ + if (spec) { + rpmlog(lvl, _("line %d: %s in: %s\n"), spec->lineNum, msg, spec->line); + } else { + rpmlog(lvl, _("%s in: %s\n"), msg, line); + } +} + /** * Check for inappropriate characters. All alphanums are considered sane. - * @param spec spec + * @param spec spec (or NULL) * @param field string to check - * @param fsize size of string to check * @param whitelist string of permitted characters * @return RPMRC_OK if OK */ -rpmRC rpmCharCheck(rpmSpec spec, const char *field, size_t fsize, const char *whitelist) +rpmRC rpmCharCheck(rpmSpec spec, const char *field, const char *whitelist) { - const char *ch, *stop = &field[fsize]; + const char *ch; + char *err = NULL; + rpmRC rc = RPMRC_OK; - for (ch=field; *ch && ch < stop; ch++) { + for (ch=field; *ch; ch++) { if (risalnum(*ch) || strchr(whitelist, *ch)) continue; - if (isprint(*ch)) { - rpmlog(RPMLOG_ERR, _("line %d: Illegal char '%c' in: %s\n"), - spec->lineNum, *ch, spec->line); - } else { - rpmlog(RPMLOG_ERR, _("line %d: Illegal char in: %s\n"), - spec->lineNum, spec->line); + rasprintf(&err, _("Illegal char '%c' (0x%x)"), + isprint(*ch) ? *ch : '?', *ch); + } + for (ch=field; *ch; ch++) { + if (strchr("%{}", *ch)) { + specLog(spec, RPMLOG_WARNING, field, + _("Possible unexpanded macro")); + break; } - return RPMRC_FAIL; } - if (strstr(field, "..") != NULL) { - rpmlog(RPMLOG_ERR, _("line %d: Illegal sequence \"..\" in: %s\n"), - spec->lineNum, spec->line); - return RPMRC_FAIL; + + if (err == NULL && strstr(field, "..") != NULL) { + rasprintf(&err, _("Illegal sequence \"..\"")); } - - return RPMRC_OK; + + if (err) { + specLog(spec, RPMLOG_ERR, field, err); + free(err); + rc = RPMRC_FAIL; + } + return rc; +} + +static int haveLangTag(Header h, rpmTagVal tag, const char *lang) +{ + int rc = 0; /* assume tag not present */ + int langNum = -1; + + if (lang && *lang) { + /* See if the language is in header i18n table */ + struct rpmtd_s langtd; + const char *s = NULL; + headerGet(h, RPMTAG_HEADERI18NTABLE, &langtd, HEADERGET_MINMEM); + while ((s = rpmtdNextString(&langtd)) != NULL) { + if (rstreq(s, lang)) { + langNum = rpmtdGetIndex(&langtd); + break; + } + } + rpmtdFreeData(&langtd); + } else { + /* C locale */ + langNum = 0; + } + + /* If locale is present, check the actual tag content */ + if (langNum >= 0) { + struct rpmtd_s td; + headerGet(h, tag, &td, HEADERGET_MINMEM|HEADERGET_RAW); + if (rpmtdSetIndex(&td, langNum) == langNum) { + const char *s = rpmtdGetString(&td); + /* non-empty string means a dupe */ + if (s && *s) + rc = 1; + } + rpmtdFreeData(&td); + }; + + return rc; +} + +int addLangTag(rpmSpec spec, Header h, rpmTagVal tag, + const char *field, const char *lang) +{ + int skip = 0; + + if (haveLangTag(h, tag, lang)) { + /* Turn this into an error eventually */ + rpmlog(RPMLOG_WARNING, _("line %d: second %s\n"), + spec->lineNum, rpmTagGetName(tag)); + } + + if (!*lang) { + headerPutString(h, tag, field); + } else { + skip = ((spec->flags & RPMSPEC_NOLANG) && + !rstreq(lang, RPMBUILD_DEFAULT_LANG)); + if (skip) + return 0; + headerAddI18NString(h, tag, field, lang); + } + + return 0; } static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, @@ -669,14 +758,17 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, switch (tag) { case RPMTAG_NAME: SINGLE_TOKEN_ONLY; - if (rpmCharCheck(spec, field, strlen(field), ".-_+%{}")) + if (rpmCharCheck(spec, field, WHITELIST_NAME)) goto exit; headerPutString(pkg->header, tag, field); + /* Main pkg name is unknown at the start, populate as soon as we can */ + if (pkg == spec->packages) + pkg->name = rpmstrPoolId(spec->pool, field, 1); break; case RPMTAG_VERSION: case RPMTAG_RELEASE: SINGLE_TOKEN_ONLY; - if (rpmCharCheck(spec, field, strlen(field), "._+%{}~")) + if (rpmCharCheck(spec, field, "._+%{}~")) goto exit; headerPutString(pkg->header, tag, field); break; @@ -694,11 +786,8 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, case RPMTAG_VENDOR: case RPMTAG_LICENSE: case RPMTAG_PACKAGER: - if (!*lang) { - headerPutString(pkg->header, tag, field); - } else if (!((spec->flags & RPMSPEC_NOLANG) && - !rstreq(lang, RPMBUILD_DEFAULT_LANG))) - headerAddI18NString(pkg->header, tag, field, lang); + if (addLangTag(spec, pkg->header, tag, field, lang)) + goto exit; break; case RPMTAG_BUILDROOT: /* just silently ignore BuildRoot */ @@ -731,8 +820,8 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, goto exit; } macro = NULL; - delMacro(NULL, "_docdir"); - addMacro(NULL, "_docdir", NULL, field, RMIL_SPEC); + rpmPopMacro(NULL, "_docdir"); + rpmPushMacro(NULL, "_docdir", NULL, field, RMIL_SPEC); break; case RPMTAG_EPOCH: { SINGLE_TOKEN_ONLY; @@ -773,8 +862,8 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, if (parseNoSource(spec, field, tag)) goto exit; break; - case RPMTAG_ORDERFLAGS: - case RPMTAG_REQUIREFLAGS: + case RPMTAG_ORDERNAME: + case RPMTAG_REQUIRENAME: if (parseBits(lang, installScriptBits, &tagflags)) { rpmlog(RPMLOG_ERR, _("line %d: Bad %s: qualifiers: %s\n"), spec->lineNum, rpmTagGetName(tag), spec->line); @@ -782,17 +871,24 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, } /* fallthrough */ case RPMTAG_PREREQ: + case RPMTAG_RECOMMENDNAME: + case RPMTAG_SUGGESTNAME: + case RPMTAG_SUPPLEMENTNAME: + case RPMTAG_ENHANCENAME: + case RPMTAG_CONFLICTNAME: + case RPMTAG_OBSOLETENAME: + case RPMTAG_PROVIDENAME: + if (parseRCPOT(spec, pkg, field, tag, 0, tagflags, addReqProvPkg, NULL)) + goto exit; + break; case RPMTAG_BUILDPREREQ: case RPMTAG_BUILDREQUIRES: case RPMTAG_BUILDCONFLICTS: - case RPMTAG_CONFLICTFLAGS: - case RPMTAG_OBSOLETEFLAGS: - case RPMTAG_PROVIDEFLAGS: - if (parseRCPOT(spec, pkg, field, tag, 0, tagflags)) + if (parseRCPOT(spec, spec->sourcePackage, field, tag, 0, tagflags, addReqProvPkg, NULL)) goto exit; break; - case RPMTAG_SUGGESTSFLAGS: - case RPMTAG_ENHANCESFLAGS: + case RPMTAG_OLDSUGGESTSFLAGS: + case RPMTAG_OLDENHANCESFLAGS: case RPMTAG_BUILDSUGGESTS: case RPMTAG_BUILDENHANCES: tagflags = RPMSENSE_MISSINGOK; @@ -800,7 +896,7 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, tagflags |= RPMSENSE_STRONG; if (macro && (!strcmp(macro, "supplements") || !strcmp(macro, "buildsupplements"))) tagflags |= RPMSENSE_STRONG; - if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags))) + if (parseRCPOT(spec, pkg, field, tag, 0, tagflags, addReqProvPkg, NULL)) return rc; break; case RPMTAG_EXCLUDEARCH: @@ -820,6 +916,13 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, goto exit; } if (spec->packages == pkg) { + if (spec->BANames) { + rpmlog(RPMLOG_ERR, + _("line %d: Duplicate BuildArch entry: %s\n"), + spec->lineNum, spec->line); + BANames = _free(BANames); + goto exit; + } spec->BACount = BACount; spec->BANames = BANames; } else { @@ -836,8 +939,10 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, spec->BANames = _free(spec->BANames); break; } - case RPMTAG_COLLECTIONS: - case RPMTAG_BUILDINFO: + case RPMTAG_REMOVEPATHPOSTFIXES: + argvSplit(&pkg->removePostfixes, field, ":"); + break; + case RPMTAG_BUILDINFO: if (addOrAppendListEntry(pkg->header, tag, field)) goto exit; break; @@ -846,8 +951,17 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag, goto exit; } - if (macro) - addMacro(spec->macros, macro, NULL, field, RMIL_SPEC); + if (macro) { + rpmPushMacro(spec->macros, macro, NULL, field, RMIL_SPEC); + /* Add a separate uppercase macro for tags from the main package */ + if (pkg == spec->packages) { + char *m = xstrdup(macro); + for (char *p = m; *p; ++p) + *p = rtoupper(*p); + rpmPushMacro(spec->macros, m, NULL, field, RMIL_SPEC); + free(m); + } + } rc = RPMRC_OK; exit: return rc; @@ -881,7 +995,7 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_GROUP, 1, 0, LEN_AND_STR("group")}, {RPMTAG_PACKAGER, 0, 0, LEN_AND_STR("packager")}, {RPMTAG_URL, 0, 0, LEN_AND_STR("url")}, - {RPMTAG_VCS, 0, 0, LEN_AND_STR("vcs")}, + {RPMTAG_VCS, 0, 0, LEN_AND_STR("vcs")}, {RPMTAG_SOURCE, 0, 0, LEN_AND_STR("source")}, {RPMTAG_PATCH, 0, 0, LEN_AND_STR("patch")}, {RPMTAG_NOSOURCE, 0, 0, LEN_AND_STR("nosource")}, @@ -891,11 +1005,15 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_EXCLUDEOS, 0, 0, LEN_AND_STR("excludeos")}, {RPMTAG_EXCLUSIVEOS, 0, 0, LEN_AND_STR("exclusiveos")}, {RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")}, - {RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")}, - {RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")}, + {RPMTAG_PROVIDENAME, 0, 0, LEN_AND_STR("provides")}, + {RPMTAG_REQUIRENAME, 2, 0, LEN_AND_STR("requires")}, + {RPMTAG_RECOMMENDNAME, 0, 0, LEN_AND_STR("recommends")}, + {RPMTAG_SUGGESTNAME, 0, 0, LEN_AND_STR("suggests")}, + {RPMTAG_SUPPLEMENTNAME, 0, 0, LEN_AND_STR("supplements")}, + {RPMTAG_ENHANCENAME, 0, 0, LEN_AND_STR("enhances")}, {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")}, - {RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")}, - {RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")}, + {RPMTAG_CONFLICTNAME, 0, 0, LEN_AND_STR("conflicts")}, + {RPMTAG_OBSOLETENAME, 0, 0, LEN_AND_STR("obsoletes")}, {RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")}, {RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefix")}, {RPMTAG_BUILDROOT, 0, 0, LEN_AND_STR("buildroot")}, @@ -910,18 +1028,19 @@ static struct PreambleRec_s const preambleList[] = { {RPMTAG_DOCDIR, 0, 0, LEN_AND_STR("docdir")}, {RPMTAG_DISTTAG, 0, 0, LEN_AND_STR("disttag")}, {RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")}, - {RPMTAG_COLLECTIONS, 0, 0, LEN_AND_STR("collections")}, {RPMTAG_ORDERFLAGS, 2, 0, LEN_AND_STR("orderwithrequires")}, - {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")}, - {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")}, - {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")}, - {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")}, + {RPMTAG_OLDSUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")}, + {RPMTAG_OLDSUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")}, + {RPMTAG_OLDENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")}, + {RPMTAG_OLDENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")}, {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")}, {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")}, {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")}, {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")}, {RPMTAG_SECMANIFEST, 0, 0, LEN_AND_STR("manifest")}, - {RPMTAG_BUILDINFO, 0, 0, LEN_AND_STR("buildinfo")}, + {RPMTAG_ORDERNAME, 2, 0, LEN_AND_STR("orderwithrequires")}, + {RPMTAG_REMOVEPATHPOSTFIXES,0, 0, LEN_AND_STR("removepathpostfixes")}, + {RPMTAG_BUILDINFO, 0, 0, LEN_AND_STR("buildinfo")}, {0, 0, 0, 0} }; @@ -995,8 +1114,6 @@ int parsePreamble(rpmSpec spec, int initialPackage) char *NVR = NULL; char lang[BUFSIZ]; - pkg = newPackage(spec); - if (! initialPackage) { /* There is one option to %package: or -n */ if (parseSimplePart(spec->line, &name, &flag)) { @@ -1004,9 +1121,11 @@ int parsePreamble(rpmSpec spec, int initialPackage) spec->line); goto exit; } + + //if (rpmCharCheck(spec, name, WHITELIST_NAME)) + // goto exit; if (!lookupPackage(spec, name, flag, NULL)) { - rpmlog(RPMLOG_ERR, _("Package already exists: %s\n"), spec->line); free(name); goto exit; } @@ -1018,9 +1137,13 @@ int parsePreamble(rpmSpec spec, int initialPackage) } else NVR = xstrdup(name); free(name); + pkg = newPackage(NVR, spec->pool, &spec->packages); headerPutString(pkg->header, RPMTAG_NAME, NVR); } else { NVR = xstrdup("(main package)"); + pkg = newPackage(NULL, spec->pool, &spec->packages); + spec->sourcePackage = newPackage(NULL, spec->pool, NULL); + } if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { @@ -1037,6 +1160,14 @@ int parsePreamble(rpmSpec spec, int initialPackage) SKIPSPACE(linep); if (*linep != '\0') { if (findPreambleTag(spec, &tag, ¯o, lang)) { + if (spec->lineNum == 1 && + (unsigned char)(spec->line[0]) == 0xed && + (unsigned char)(spec->line[1]) == 0xab && + (unsigned char)(spec->line[2]) == 0xee && + (unsigned char)(spec->line[3]) == 0xdb) { + rpmlog(RPMLOG_ERR, _("Binary rpm package found. Expected spec file!\n")); + goto exit; + } rpmlog(RPMLOG_ERR, _("line %d: Unknown tag: %s\n"), spec->lineNum, spec->line); goto exit; @@ -1060,7 +1191,7 @@ int parsePreamble(rpmSpec spec, int initialPackage) } } - /* + /* * Expand buildroot one more time to get %{version} and the like * from the main package, validate sanity. The spec->buildRoot could * still contain unexpanded macros but it cannot be empty or '/', and it @@ -1078,7 +1209,7 @@ int parsePreamble(rpmSpec spec, int initialPackage) } free(spec->buildRoot); spec->buildRoot = buildRoot; - addMacro(spec->macros, "buildroot", NULL, spec->buildRoot, RMIL_SPEC); + rpmPushMacro(spec->macros, "buildroot", NULL, spec->buildRoot, RMIL_SPEC); } /* XXX Skip valid arch check if not building binary package */ @@ -1100,8 +1231,7 @@ int parsePreamble(rpmSpec spec, int initialPackage) } if (pkg != spec->packages) { - headerCopyTags(spec->packages->header, pkg->header, - (rpmTagVal *)copyTagsDuringParse); + copyInheritedTags(pkg->header, spec->packages->header); } if (checkForRequired(pkg->header, NVR)) { diff --git a/build/parsePrep.c b/build/parsePrep.c index fd4d30c..a62123e 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -6,6 +6,7 @@ #include "system.h" #include +#include #include #include @@ -29,10 +30,6 @@ static rpmRC checkOwners(const char * urlfn) urlfn, strerror(errno)); return RPMRC_FAIL; } - if (!rpmugUname(sb.st_uid) || !rpmugGname(sb.st_gid)) { - rpmlog(RPMLOG_ERR, _("Bad owner/group: %s\n"), urlfn); - return RPMRC_FAIL; - } return RPMRC_OK; } @@ -47,21 +44,25 @@ static rpmRC checkOwners(const char * urlfn) * @param removeEmpties include -E? * @param fuzz fuzz factor, fuzz<0 means no fuzz set * @param dir dir to change to (i.e. patch -d argument) + * @param outfile send output to this file (i.e. patch -o argument) * @return expanded %patch macro (NULL on error) */ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db, - int reverse, int removeEmpties, int fuzz, const char *dir) + int reverse, int removeEmpties, int fuzz, const char *dir, + const char *outfile) { char *fn = NULL; char *buf = NULL; char *arg_backup = NULL; char *arg_fuzz = NULL; char *arg_dir = NULL; + char *arg_outfile = NULL; char *args = NULL; char *arg_patch_flags = rpmExpand("%{?_default_patch_flags}", NULL); struct Source *sp; char *patchcmd; + rpmCompressedMagic compressed = COMPRESSED_NOT; for (sp = spec->sources; sp != NULL; sp = sp->next) { if ((sp->flags & RPMBUILD_ISPATCH) && (sp->num == c)) { @@ -80,7 +81,7 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db, fn = rpmGetPath("%{_sourcedir}/", sp->source, NULL); /* On non-build parse's, file cannot be stat'd or read. */ - if ((spec->flags & RPMSPEC_FORCE) || checkOwners(fn)) goto exit; + if ((spec->flags & RPMSPEC_FORCE) || rpmFileIsCompressed(fn, &compressed) || checkOwners(fn)) goto exit; if (db) { rasprintf(&arg_backup, @@ -94,17 +95,28 @@ static char *doPatch(rpmSpec spec, uint32_t c, int strip, const char *db, rasprintf(&arg_dir, " -d %s", dir); } else arg_dir = xstrdup(""); + if (outfile) { + rasprintf(&arg_outfile, " -o %s", outfile); + } else arg_outfile = xstrdup(""); + if (fuzz >= 0) { rasprintf(&arg_fuzz, " --fuzz=%d", fuzz); } else arg_fuzz = xstrdup(""); - rasprintf(&args, "%s -p%d %s%s%s%s%s", arg_patch_flags, strip, arg_backup, arg_fuzz, arg_dir, + rasprintf(&args, "%s -p%d %s%s%s%s%s%s", arg_patch_flags, strip, arg_backup, arg_fuzz, arg_dir, arg_outfile, reverse ? " -R" : "", removeEmpties ? " -E" : ""); - patchcmd = rpmExpand("%{uncompress: ", fn, "} | %{__patch} ", args, NULL); + /* Avoid the extra cost of fork and pipe for uncompressed patches */ + if (compressed != COMPRESSED_NOT) { + patchcmd = rpmExpand("{ %{uncompress: ", fn, "} || echo patch_fail ; } | " + "%{__patch} ", args, NULL); + } else { + patchcmd = rpmExpand("%{__patch} ", args, " < ", fn, NULL); + } free(arg_fuzz); + free(arg_outfile); free(arg_dir); free(arg_backup); free(args); @@ -138,7 +150,7 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) char *fn = NULL; char *buf = NULL; char *tar = NULL; - const char *taropts = ((rpmIsVerbose() && !quietly) ? "-xvvf" : "-xf"); + const char *taropts = ((rpmIsVerbose() && !quietly) ? "-xvvof" : "-xof"); struct Source *sp; rpmCompressedMagic compressed = COMPRESSED_NOT; @@ -167,6 +179,7 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) if (compressed != COMPRESSED_NOT) { char *zipper, *t = NULL; int needtar = 1; + int needgemspec = 0; switch (compressed) { case COMPRESSED_NOT: /* XXX can't happen */ @@ -197,6 +210,14 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) t = "%{__7zip} x"; needtar = 0; break; + case COMPRESSED_ZSTD: + t = "%{__zstd} -dc"; + break; + case COMPRESSED_GEM: + t = "%{__gem} unpack"; + needtar = 0; + needgemspec = 1; + break; } zipper = rpmGetPath(t, NULL); if (needtar) { @@ -205,6 +226,22 @@ static char *doUntar(rpmSpec spec, uint32_t c, int quietly) "if [ $STATUS -ne 0 ]; then\n" " exit $STATUS\n" "fi", zipper, fn, tar, taropts); + } else if (needgemspec) { + char *gem = rpmGetPath("%{__gem}", NULL); + char *gemspec = NULL; + char gemnameversion[strlen(sp->source) - 3]; + + rstrlcpy(gemnameversion, sp->source, strlen(sp->source) - 3); + gemspec = rpmGetPath("%{_builddir}/", gemnameversion, ".gemspec", NULL); + + rasprintf(&buf, "%s '%s' && %s spec '%s' --ruby > '%s'\n" + "STATUS=$?\n" + "if [ $STATUS -ne 0 ]; then\n" + " exit $STATUS\n" + "fi", zipper, fn, gem, fn, gemspec); + + free(gemspec); + free(gem); } else { rasprintf(&buf, "%s '%s'\n" "STATUS=$?\n" @@ -225,7 +262,6 @@ exit: /** * Parse %setup macro. - * @todo FIXME: Option -q broken when not immediately after %setup. * @param spec build info * @param line current line from spec file * @return RPMRC_OK on success @@ -245,6 +281,7 @@ static int doSetupMacro(rpmSpec spec, const char *line) uint32_t num; int leaveDirs = 0, skipDefaultAction = 0; int createDir = 0, quietly = 0; + int buildInPlace = 0; const char * dirName = NULL; struct poptOption optionsTable[] = { { NULL, 'a', POPT_ARG_STRING, NULL, 'a', NULL, NULL}, @@ -257,6 +294,8 @@ static int doSetupMacro(rpmSpec spec, const char *line) { 0, 0, 0, 0, 0, NULL, NULL} }; + if (strstr(line+6, " -q")) quietly = 1; + if ((xx = poptParseArgvString(line, &argc, &argv))) { rpmlog(RPMLOG_ERR, _("Error parsing %%setup: %s\n"), poptStrerror(xx)); goto exit; @@ -298,7 +337,16 @@ static int doSetupMacro(rpmSpec spec, const char *line) headerGetString(spec->packages->header, RPMTAG_NAME), headerGetString(spec->packages->header, RPMTAG_VERSION)); } - addMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC); + /* Mer addition - support --build-in-place */ + if (rpmExpandNumeric("%{_build_in_place}")) { + buildInPlace = 1; + spec->buildSubdir = NULL; + } + rpmPushMacro(spec->macros, "buildsubdir", NULL, spec->buildSubdir, RMIL_SPEC); + if (buildInPlace) { + rc = RPMRC_OK; + goto exit; + } /* cd to the build dir */ { char * buildDir = rpmGenPath(spec->rootDir, "%{_builddir}", ""); @@ -316,6 +364,8 @@ static int doSetupMacro(rpmSpec spec, const char *line) free(buf); } + appendStringBuf(spec->prep, getStringBuf(before)); + /* if necessary, create and cd into the proper dir */ if (createDir) { buf = rpmExpand("%{__mkdir_p} ", spec->buildSubdir, "\n", @@ -333,8 +383,6 @@ static int doSetupMacro(rpmSpec spec, const char *line) free(chptr); } - appendStringBuf(spec->prep, getStringBuf(before)); - if (!createDir) { rasprintf(&buf, "cd '%s'", spec->buildSubdir); appendLineStringBuf(spec->prep, buf); @@ -372,12 +420,12 @@ exit: /** * Parse %patch line. * This supports too many crazy syntaxes: - * - %patchN is equal to %patch -P - * - -P -P... can be used to apply several patch on a single line + * - %patchN is equal to %patch -P\ + * - -P\ -P\... can be used to apply several patch on a single line * - Any trailing arguments are treated as patch numbers * - Any combination of the above, except unless at least one -P is specified, - * %patch is treated as %patch -P0 so that "%patch 1" is actually - * equal to "%patch -P0 -P1". + * %patch is treated as "numberless patch" so that "%patch 1" actually tries + * to pull in numberless "Patch:" and numbered "Patch1:". * * @param spec build info * @param line current line from spec file @@ -385,7 +433,7 @@ exit: */ static rpmRC doPatchMacro(rpmSpec spec, const char *line) { - char *opt_b, *opt_P, *opt_d; + char *opt_b, *opt_P, *opt_d, *opt_o; char *buf = NULL; int opt_p, opt_R, opt_E, opt_F; int argc, c; @@ -402,13 +450,14 @@ static rpmRC doPatchMacro(rpmSpec spec, const char *line) { NULL, 'z', POPT_ARG_STRING, &opt_b, 'z', NULL, NULL }, { NULL, 'F', POPT_ARG_INT, &opt_F, 'F', NULL, NULL }, { NULL, 'd', POPT_ARG_STRING, &opt_d, 'd', NULL, NULL }, + { NULL, 'o', POPT_ARG_STRING, &opt_o, 'o', NULL, NULL }, { NULL, 0, 0, NULL, 0, NULL, NULL } }; poptContext optCon = NULL; opt_p = opt_R = opt_E = 0; opt_F = rpmExpandNumeric("%{_default_patch_fuzz}"); /* get default fuzz factor for %patch */ - opt_b = opt_d = NULL; + opt_b = opt_d = opt_o = NULL; /* Convert %patchN to %patch -PN to simplify further processing */ if (! strchr(" \t\n", line[6])) { @@ -460,7 +509,7 @@ static rpmRC doPatchMacro(rpmSpec spec, const char *line) *patch, line); goto exit; } - s = doPatch(spec, pnum, opt_p, opt_b, opt_R, opt_E, opt_F, opt_d); + s = doPatch(spec, pnum, opt_p, opt_b, opt_R, opt_E, opt_F, opt_d, opt_o); if (s == NULL) { goto exit; } diff --git a/build/parseReqs.c b/build/parseReqs.c index 1507090..4d7e8e8 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -12,119 +12,230 @@ #include "build/rpmbuild_misc.h" #include "debug.h" -/** - */ -static struct ReqComp { -const char * token; - rpmsenseFlags sense; -} const ReqComparisons[] = { - { "<=", RPMSENSE_LESS | RPMSENSE_EQUAL}, - { "=<", RPMSENSE_LESS | RPMSENSE_EQUAL}, - { "<", RPMSENSE_LESS}, - - { "==", RPMSENSE_EQUAL}, - { "=", RPMSENSE_EQUAL}, - - { ">=", RPMSENSE_GREATER | RPMSENSE_EQUAL}, - { "=>", RPMSENSE_GREATER | RPMSENSE_EQUAL}, - { ">", RPMSENSE_GREATER}, - - { NULL, 0 }, + +#define SKIPWHITE(_x) {while (*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} +#define SKIPNONWHITE(_x){while (*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} + +static rpmRC checkSep(const char *s, char c, char **emsg) +{ + const char *sep = strchr(s, c); + if (sep && strchr(sep + 1, c)) { + rasprintf(emsg, "Invalid version (double separator '%c'): %s", c, s); + return RPMRC_FAIL; + } + return RPMRC_OK; +} + +static rpmRC checkEpoch(const char *s, char **emsg) +{ + const char *si, *sep = strchr(s, ':'); + + if (!sep) + return RPMRC_OK; + + for (si = s; si != sep; si++) { + if (!risdigit(*si)) { + rasprintf(emsg, "Invalid version (epoch must be unsigned integer): %s", s); + return RPMRC_FAIL; + } + } + return RPMRC_OK; +} + +static rpmRC checkDep(rpmSpec spec, char *N, char *EVR, char **emsg) +{ + /* + * Tokens must begin with alphanumeric, _, or /, but we don't know + * the spec's encoding so we only check what we can: plain ascii. + */ + if (isascii(N[0]) && !(risalnum(N[0]) || N[0] == '_' || N[0] == '/')) { + rasprintf(emsg, _("Dependency tokens must begin with alpha-numeric, '_' or '/'")); + return RPMRC_FAIL; + } + if (EVR) { + if (N[0] == '/') { + rasprintf(emsg, _("Versioned file name not permitted")); + return RPMRC_FAIL; + } + // if (rpmCharCheck(spec, EVR, ".-_+:%{}~")) + // return RPMRC_FAIL; + if (checkSep(EVR, '-', emsg) != RPMRC_OK || + checkSep(EVR, ':', emsg) != RPMRC_OK || + checkEpoch(EVR, emsg) != RPMRC_OK) { + + if (rpmExpandNumeric("%{?_wrong_version_format_terminate_build}")) + return RPMRC_FAIL; + } + } + return RPMRC_OK; +} + +struct parseRCPOTRichData { + rpmSpec spec; + StringBuf sb; }; -#define SKIPWHITE(_x) {while(*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} -#define SKIPNONWHITE(_x){while(*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} +/* Callback for the rich dependency parser. We use this to do check for invalid + * characters and to build a normailzed version of the dependency */ +static rpmRC parseRCPOTRichCB(void *cbdata, rpmrichParseType type, + const char *n, int nl, const char *e, int el, rpmsenseFlags sense, + rpmrichOp op, char **emsg) { + struct parseRCPOTRichData *data = cbdata; + StringBuf sb = data->sb; + rpmRC rc = RPMRC_OK; + + if (type == RPMRICH_PARSE_ENTER) { + appendStringBuf(sb, "("); + } else if (type == RPMRICH_PARSE_LEAVE) { + appendStringBuf(sb, ")"); + } else if (type == RPMRICH_PARSE_SIMPLE) { + char *N = xmalloc(nl + 1); + char *EVR = NULL; + rstrlcpy(N, n, nl + 1); + appendStringBuf(sb, N); + if (el) { + char rel[6], *rp = rel; + EVR = xmalloc(el + 1); + rstrlcpy(EVR, e, el + 1); + *rp++ = ' '; + if (sense & RPMSENSE_LESS) + *rp++ = '<'; + if (sense & RPMSENSE_GREATER) + *rp++ = '>'; + if (sense & RPMSENSE_EQUAL) + *rp++ = '='; + *rp++ = ' '; + *rp = 0; + appendStringBuf(sb, rel); + appendStringBuf(sb, EVR); + } + rc = checkDep(data->spec, N, EVR, emsg); + _free(N); + _free(EVR); + } else if (type == RPMRICH_PARSE_OP) { + appendStringBuf(sb, " "); + appendStringBuf(sb, rpmrichOpStr(op)); + appendStringBuf(sb, " "); + } + return rc; +} rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, - int index, rpmsenseFlags tagflags) + int index, rpmsenseFlags tagflags, addReqProvFunction cb, void *cbdata) { - const char *r, *re, *v, *ve; - const char *emsg = NULL; - char * N = NULL, * EVR = NULL; - rpmTagVal nametag = RPMTAG_NOT_FOUND; - rpmsenseFlags Flags; - Header h = pkg->header; /* everything except buildrequires go here */ - rpmRC rc = RPMRC_FAIL; /* assume failure */ - - switch (tagN) { - default: - case RPMTAG_REQUIREFLAGS: - nametag = RPMTAG_REQUIRENAME; + const char *r, *re, *v, *ve; + char *emsg = NULL; + char * N = NULL, * EVR = NULL; + rpmTagVal nametag = RPMTAG_NOT_FOUND; + rpmsenseFlags Flags; + rpmRC rc = RPMRC_FAIL; /* assume failure */ + int allow_richdeps = 0; + + if (!cbdata) + cbdata = pkg; + + switch (tagN) { + default: + case RPMTAG_REQUIRENAME: tagflags |= RPMSENSE_ANY; + /* fall through */ + case RPMTAG_RECOMMENDNAME: + case RPMTAG_SUGGESTNAME: + case RPMTAG_SUPPLEMENTNAME: + case RPMTAG_ENHANCENAME: + case RPMTAG_CONFLICTNAME: + allow_richdeps = 1; + /* fall through */ + case RPMTAG_PROVIDENAME: + case RPMTAG_OBSOLETENAME: + case RPMTAG_ORDERNAME: + nametag = tagN; break; - case RPMTAG_PROVIDEFLAGS: - nametag = RPMTAG_PROVIDENAME; - break; - case RPMTAG_OBSOLETEFLAGS: - nametag = RPMTAG_OBSOLETENAME; - break; - case RPMTAG_CONFLICTFLAGS: - nametag = RPMTAG_CONFLICTNAME; - break; - case RPMTAG_ORDERFLAGS: - nametag = RPMTAG_ORDERNAME; - break; - case RPMTAG_PREREQ: + case RPMTAG_PREREQ: /* XXX map legacy PreReq into Requires(pre,preun) */ nametag = RPMTAG_REQUIRENAME; tagflags |= (RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_PREUN); + allow_richdeps = 1; break; - case RPMTAG_TRIGGERPREIN: + case RPMTAG_TRIGGERPREIN: nametag = RPMTAG_TRIGGERNAME; tagflags |= RPMSENSE_TRIGGERPREIN; break; - case RPMTAG_TRIGGERIN: + case RPMTAG_TRIGGERIN: nametag = RPMTAG_TRIGGERNAME; tagflags |= RPMSENSE_TRIGGERIN; break; - case RPMTAG_TRIGGERPOSTUN: + case RPMTAG_TRIGGERPOSTUN: nametag = RPMTAG_TRIGGERNAME; tagflags |= RPMSENSE_TRIGGERPOSTUN; break; - case RPMTAG_TRIGGERUN: + case RPMTAG_TRIGGERUN: nametag = RPMTAG_TRIGGERNAME; tagflags |= RPMSENSE_TRIGGERUN; break; - case RPMTAG_BUILDPREREQ: - case RPMTAG_BUILDREQUIRES: + case RPMTAG_BUILDPREREQ: + case RPMTAG_BUILDREQUIRES: nametag = RPMTAG_REQUIRENAME; tagflags |= RPMSENSE_ANY; - h = spec->buildRestrictions; + allow_richdeps = 1; break; - case RPMTAG_BUILDCONFLICTS: + case RPMTAG_BUILDCONFLICTS: nametag = RPMTAG_CONFLICTNAME; - h = spec->buildRestrictions; + allow_richdeps = 1; break; - case RPMTAG_SUGGESTSFLAGS: - nametag = RPMTAG_SUGGESTSNAME; + case RPMTAG_FILETRIGGERIN: + nametag = RPMTAG_FILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERIN; break; - case RPMTAG_ENHANCESFLAGS: - nametag = RPMTAG_ENHANCESNAME; + case RPMTAG_FILETRIGGERUN: + nametag = RPMTAG_FILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERUN; break; - case RPMTAG_BUILDSUGGESTS: - nametag = RPMTAG_SUGGESTSNAME; - h = spec->buildRestrictions; + case RPMTAG_FILETRIGGERPOSTUN: + nametag = RPMTAG_FILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERPOSTUN; break; - case RPMTAG_BUILDENHANCES: - nametag = RPMTAG_ENHANCESNAME; - h = spec->buildRestrictions; + case RPMTAG_TRANSFILETRIGGERIN: + nametag = RPMTAG_TRANSFILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERIN; break; - } + case RPMTAG_TRANSFILETRIGGERUN: + nametag = RPMTAG_TRANSFILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERUN; + break; + case RPMTAG_TRANSFILETRIGGERPOSTUN: + nametag = RPMTAG_TRANSFILETRIGGERNAME; + tagflags |= RPMSENSE_TRIGGERPOSTUN; + break; + } - for (r = field; *r != '\0'; r = re) { + for (r = field; *r != '\0'; r = re) { SKIPWHITE(r); if (*r == '\0') - break; + break; Flags = (tagflags & ~RPMSENSE_SENSEMASK); - /* - * Tokens must begin with alphanumeric, _, or /, but we don't know - * the spec's encoding so we only check what we can: plain ascii. - */ - if (isascii(r[0]) && !(risalnum(r[0]) || r[0] == '_' || r[0] == '/')) { - emsg = _("Dependency tokens must begin with alpha-numeric, '_' or '/'"); - goto exit; + if (r[0] == '(') { + struct parseRCPOTRichData data; + if (!allow_richdeps) { + rasprintf(&emsg, _("No rich dependencies allowed for this type")); + goto exit; + } + data.spec = spec; + data.sb = newStringBuf(); + if (rpmrichParseForTag(&r, &emsg, parseRCPOTRichCB, &data, nametag) != RPMRC_OK) { + freeStringBuf(data.sb); + goto exit; + } + if (cb && cb(cbdata, nametag, getStringBuf(data.sb), NULL, Flags, index) != RPMRC_OK) { + rasprintf(&emsg, _("invalid dependency")); + freeStringBuf(data.sb); + goto exit; + } + freeStringBuf(data.sb); + re = r; + continue; } re = r; @@ -133,71 +244,106 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, rstrlcpy(N, r, (re-r) + 1); /* Parse EVR */ + EVR = NULL; v = re; SKIPWHITE(v); ve = v; SKIPNONWHITE(ve); - re = v; /* ==> next token (if no EVR found) starts here */ + re = v; /* ==> next token (if no EVR found) starts here */ /* Check for possible logical operator */ if (ve > v) { - const struct ReqComp *rc; - for (rc = ReqComparisons; rc->token != NULL; rc++) { - if ((ve-v) != strlen(rc->token) || !rstreqn(v, rc->token, (ve-v))) - continue; + rpmsenseFlags sense = rpmParseDSFlags(v, ve - v); + if (sense) { + Flags |= sense; + + /* now parse EVR */ + v = ve; + SKIPWHITE(v); + ve = v; + SKIPNONWHITE(ve); + if (*v == '\0' || ve == v) { + rasprintf(&emsg, _("Version required")); + goto exit; + } + EVR = xmalloc((ve-v) + 1); + rstrlcpy(EVR, v, (ve-v) + 1); + re = ve; /* ==> next token after EVR string starts here */ + } + } - if (r[0] == '/') { - emsg = _("Versioned file name not permitted"); + /* check that dependency is well-formed */ + if (checkDep(spec, N, EVR, &emsg)) goto exit; - } - Flags |= rc->sense; + if (nametag == RPMTAG_OBSOLETENAME) { + if (rpmCharCheck(spec, N, WHITELIST_NAME)) { + rasprintf(&emsg, _("Only package names are allowed in " + "Obsoletes")); + goto exit; + } + if (!EVR) { + rasprintf(&emsg, _("It's not recommended to have " + "unversioned Obsoletes")); + } else if (Flags & RPMSENSE_GREATER) { + rasprintf(&emsg, _("It's not recommended to use " + "'>' in Obsoletes")); + } + } - /* now parse EVR */ - v = ve; - SKIPWHITE(v); - ve = v; - SKIPNONWHITE(ve); - break; - } + if (nametag == RPMTAG_FILETRIGGERNAME || + nametag == RPMTAG_TRANSFILETRIGGERNAME) { + if (N[0] != '/') { + rasprintf(&emsg, _("Only absolute paths are allowed in " + "file triggers")); + } } - if (Flags & RPMSENSE_SENSEMASK) { - if (*v == '\0' || ve == v) { - emsg = _("Version required"); + + /* Deny more "normal" triggers fired by the same pakage. File triggers are ok */ + if (nametag == RPMTAG_TRIGGERNAME) { + rpmds *pdsp = packageDependencies(pkg, nametag); + rpmds newds = rpmdsSingle(nametag, N, EVR, Flags); + rpmdsInit(*pdsp); + while (rpmdsNext(*pdsp) >= 0) { + if (rpmdsCompare(*pdsp, newds) && (rpmdsFlags(*pdsp) & tagflags )) { + rasprintf(&emsg, _("Trigger fired by the same package " + "is already defined in spec file")); + break; + } + } + rpmdsFree(newds); + if (emsg) + goto exit; + } + + if (cb && cb(cbdata, nametag, N, EVR, Flags, index) != RPMRC_OK) { + rasprintf(&emsg, _("invalid dependency")); goto exit; - } - EVR = xmalloc((ve-v) + 1); - rstrlcpy(EVR, v, (ve-v) + 1); - if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}~")) goto exit; - re = ve; /* ==> next token after EVR string starts here */ - } else - EVR = NULL; - - if (addReqProv(h, nametag, N, EVR, Flags, index)) { - emsg = _("invalid dependency"); - goto exit; } N = _free(N); EVR = _free(EVR); - } - rc = RPMRC_OK; + } + rc = RPMRC_OK; exit: - if (emsg) { + if (emsg) { + int lvl = (rc == RPMRC_OK) ? RPMLOG_WARNING : RPMLOG_ERR; /* Automatic dependencies don't relate to spec lines */ if (tagflags & (RPMSENSE_FIND_REQUIRES|RPMSENSE_FIND_PROVIDES)) { - rpmlog(RPMLOG_ERR, "%s: %s\n", emsg, r); + rpmlog(lvl, "%s: %s\n", emsg, r); } else { - rpmlog(RPMLOG_ERR, _("line %d: %s: %s\n"), + rpmlog(lvl, _("line %d: %s: %s\n"), spec->lineNum, emsg, spec->line); } - } - free(N); - free(EVR); + free(emsg); + } + _free(N); + _free(EVR); - return rc; + return rc; } + diff --git a/build/parseScript.c b/build/parseScript.c index 1a149e1..bd0c2f0 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -15,16 +15,29 @@ #include "debug.h" +#define SKIPSPACE(s) { while (*(s) && risspace(*(s))) (s)++; } /** */ static int addTriggerIndex(Package pkg, const char *file, - const char *script, const char *prog, rpmscriptFlags flags) + const char *script, const char *prog, rpmscriptFlags flags, + rpmTagVal tag, uint32_t priority) { struct TriggerFileEntry *tfe; - struct TriggerFileEntry *list = pkg->triggerFiles; + struct TriggerFileEntry *list; struct TriggerFileEntry *last = NULL; int index = 0; + struct TriggerFileEntry **tfp; + + if (tag == RPMTAG_FILETRIGGERSCRIPTS) { + tfp = &pkg->fileTriggerFiles; + } else if (tag == RPMTAG_TRANSFILETRIGGERSCRIPTS) { + tfp = &pkg->transFileTriggerFiles; + } else { + tfp = &pkg->triggerFiles; + } + + list = *tfp; while (list) { last = list; @@ -41,12 +54,13 @@ static int addTriggerIndex(Package pkg, const char *file, tfe->prog = xstrdup(prog); tfe->flags = flags; tfe->index = index; + tfe->priority = priority; tfe->next = NULL; if (last) last->next = tfe; else - pkg->triggerFiles = tfe; + *tfp = tfe; return index; } @@ -90,6 +104,7 @@ int parseScript(rpmSpec spec, int parsePart) const char *name = NULL; const char *prog = "/bin/sh"; const char *file = NULL; + int priority = 1000000; struct poptOption optionsTable[] = { { NULL, 'p', POPT_ARG_STRING, &prog, 'p', NULL, NULL}, { NULL, 'n', POPT_ARG_STRING, &name, 'n', NULL, NULL}, @@ -98,6 +113,7 @@ int parseScript(rpmSpec spec, int parsePart) NULL, NULL}, { NULL, 'q', POPT_BIT_SET, &scriptFlags, RPMSCRIPT_FLAG_QFORMAT, NULL, NULL}, + { NULL, 'P', POPT_ARG_INT, &priority, 'P', NULL, NULL}, { 0, 0, 0, 0, 0, NULL, NULL} }; @@ -183,19 +199,82 @@ int parseScript(rpmSpec spec, int parsePart) flagtag = RPMTAG_TRIGGERSCRIPTFLAGS; partname = "%triggerpostun"; break; + case PART_FILETRIGGERIN: + tag = RPMTAG_FILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_FILETRIGGERIN; + progtag = RPMTAG_FILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_FILETRIGGERSCRIPTFLAGS; + partname = "%filetriggerin"; + break; + case PART_FILETRIGGERUN: + tag = RPMTAG_FILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_FILETRIGGERUN; + progtag = RPMTAG_FILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_FILETRIGGERSCRIPTFLAGS; + partname = "%filetriggerun"; + break; + case PART_FILETRIGGERPOSTUN: + tag = RPMTAG_FILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_FILETRIGGERPOSTUN; + progtag = RPMTAG_FILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_FILETRIGGERSCRIPTFLAGS; + partname = "%filetriggerpostun"; + break; + case PART_TRANSFILETRIGGERIN: + tag = RPMTAG_TRANSFILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRANSFILETRIGGERIN; + progtag = RPMTAG_TRANSFILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_TRANSFILETRIGGERSCRIPTFLAGS; + partname = "%transfiletriggerin"; + break; + case PART_TRANSFILETRIGGERUN: + tag = RPMTAG_TRANSFILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRANSFILETRIGGERUN; + progtag = RPMTAG_TRANSFILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_TRANSFILETRIGGERSCRIPTFLAGS; + partname = "%transfiletriggerun"; + break; + case PART_TRANSFILETRIGGERPOSTUN: + tag = RPMTAG_TRANSFILETRIGGERSCRIPTS; + tagflags = 0; + reqtag = RPMTAG_TRANSFILETRIGGERPOSTUN; + progtag = RPMTAG_TRANSFILETRIGGERSCRIPTPROG; + flagtag = RPMTAG_TRANSFILETRIGGERSCRIPTFLAGS; + partname = "%transfiletriggerpostun"; + break; } - if (tag == RPMTAG_TRIGGERSCRIPTS) { - /* break line into two */ - char *s = strstr(spec->line, "--"); - if (!s) { + if (tag == RPMTAG_TRIGGERSCRIPTS || tag == RPMTAG_FILETRIGGERSCRIPTS || + tag == RPMTAG_TRANSFILETRIGGERSCRIPTS) { + /* break line into two at the -- separator */ + char *sep, *s = spec->line; + while ((s = strstr(s, "--")) != NULL) { + s += 2; + if (risblank(*(s-3)) && risblank(*s)) + break; + } + + if (s == NULL) { rpmlog(RPMLOG_ERR, _("line %d: triggers must have --: %s\n"), spec->lineNum, spec->line); - return PART_ERROR; + goto exit; + } + + sep = s; + SKIPSPACE(s); + if (*s == '\0') { + rpmlog(RPMLOG_ERR, _("line %d: missing trigger condition: %s\n"), + spec->lineNum, spec->line); + goto exit; } - *s = '\0'; - reqargs = xstrdup(s + 2); + *sep = '\0'; + reqargs = xstrdup(s); } if ((rc = poptParseArgvString(spec->line, &argc, &argv))) { @@ -225,9 +304,19 @@ int parseScript(rpmSpec spec, int parsePart) case 'n': flag = PART_NAME; break; + case 'P': + if (tag != RPMTAG_TRIGGERSCRIPTS && + tag != RPMTAG_FILETRIGGERSCRIPTS && + tag != RPMTAG_TRANSFILETRIGGERSCRIPTS) { + + rpmlog(RPMLOG_ERR, + _("line %d: Priorities are allowed only for file " + "triggers : %s\n"), spec->lineNum, prog); + goto exit; + } } } - + if (arg < -1) { rpmlog(RPMLOG_ERR, _("line %d: Bad option %s: %s\n"), spec->lineNum, @@ -247,11 +336,8 @@ int parseScript(rpmSpec spec, int parsePart) } } - if (lookupPackage(spec, name, flag, &pkg)) { - rpmlog(RPMLOG_ERR, _("line %d: Package does not exist: %s\n"), - spec->lineNum, spec->line); + if (lookupPackage(spec, name, flag, &pkg)) goto exit; - } if (tag != RPMTAG_TRIGGERSCRIPTS) { if (headerIsEntry(pkg->header, progtag)) { @@ -292,8 +378,7 @@ int parseScript(rpmSpec spec, int parsePart) if (rpmluaCheckScript(lua, p, partname) != RPMRC_OK) { goto exit; } - (void) rpmlibNeedsFeature(pkg->header, - "BuiltinLuaScripts", "4.2.2-1"); + (void) rpmlibNeedsFeature(pkg, "BuiltinLuaScripts", "4.2.2-1"); } else #endif if (progArgv[0][0] == '<') { @@ -302,17 +387,24 @@ int parseScript(rpmSpec spec, int parsePart) spec->lineNum, progArgv[0]); goto exit; } else { - (void) addReqProv(pkg->header, RPMTAG_REQUIRENAME, + (void) addReqProv(pkg, RPMTAG_REQUIRENAME, progArgv[0], NULL, (tagflags | RPMSENSE_INTERP), 0); } if (scriptFlags) { - rpmlibNeedsFeature(pkg->header, "ScriptletExpansion", "4.9.0-1"); + rpmlibNeedsFeature(pkg, "ScriptletExpansion", "4.9.0-1"); } /* Trigger script insertion is always delayed in order to */ /* get the index right. */ - if (tag == RPMTAG_TRIGGERSCRIPTS) { + if (tag == RPMTAG_TRIGGERSCRIPTS || tag == RPMTAG_FILETRIGGERSCRIPTS || + tag == RPMTAG_TRANSFILETRIGGERSCRIPTS) { + if (tag != RPMTAG_TRIGGERSCRIPTS && *reqargs != '/') { + rpmlog(RPMLOG_ERR, + _("line %d: file trigger condition must begin with '/': %s"), + spec->lineNum, reqargs); + goto exit; + } if (progArgc > 1) { rpmlog(RPMLOG_ERR, _("line %d: interpreter arguments not allowed in triggers: %s\n"), @@ -320,10 +412,11 @@ int parseScript(rpmSpec spec, int parsePart) goto exit; } /* Add file/index/prog triple to the trigger file list */ - index = addTriggerIndex(pkg, file, p, progArgv[0], scriptFlags); + index = addTriggerIndex(pkg, file, p, progArgv[0], scriptFlags, tag, + priority); /* Generate the trigger tags */ - if (parseRCPOT(spec, pkg, reqargs, reqtag, index, tagflags)) + if (parseRCPOT(spec, pkg, reqargs, reqtag, index, tagflags, addReqProvPkg, NULL)) goto exit; } else { struct rpmtd_s td; @@ -339,7 +432,7 @@ int parseScript(rpmSpec spec, int parsePart) td.data = (void *) *progArgv; td.type = RPM_STRING_TYPE; } else { - (void) rpmlibNeedsFeature(pkg->header, + (void) rpmlibNeedsFeature(pkg, "ScriptletInterpreterArgs", "4.0.3-1"); td.data = progArgv; td.type = RPM_STRING_ARRAY_TYPE; diff --git a/build/parseSpec.c b/build/parseSpec.c index 729d4fa..d0c42a4 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -6,6 +6,9 @@ #include "system.h" #include +#ifdef HAVE_ICONV +#include +#endif #include #include /* RPM_MACHTABLE & related */ @@ -28,7 +31,8 @@ typedef struct OpenFileInfo { char * fileName; FILE *fp; int lineNum; - char readBuf[BUFSIZ]; + char *readBuf; + size_t readBufLen; const char * readPtr; struct OpenFileInfo * next; } OFI_t; @@ -60,6 +64,16 @@ static const struct PartRec { { PART_TRIGGERIN, LEN_AND_STR("%trigger")}, { PART_VERIFYSCRIPT, LEN_AND_STR("%verifyscript")}, { PART_POLICIES, LEN_AND_STR("%sepolicy")}, + { PART_FILETRIGGERIN, LEN_AND_STR("%filetriggerin")}, + { PART_FILETRIGGERIN, LEN_AND_STR("%filetrigger")}, + { PART_FILETRIGGERUN, LEN_AND_STR("%filetriggerun")}, + { PART_FILETRIGGERPOSTUN, LEN_AND_STR("%filetriggerpostun")}, + { PART_TRANSFILETRIGGERIN, LEN_AND_STR("%transfiletriggerin")}, + { PART_TRANSFILETRIGGERIN, LEN_AND_STR("%transfiletrigger")}, + { PART_TRANSFILETRIGGERUN, LEN_AND_STR("%transfiletriggerun")}, + { PART_TRANSFILETRIGGERUN, LEN_AND_STR("%transfiletriggerun")}, + { PART_TRANSFILETRIGGERPOSTUN, LEN_AND_STR("%transfiletriggerpostun")}, + { PART_EMPTY, LEN_AND_STR("%end")}, {0, 0, 0} }; @@ -102,11 +116,14 @@ static int matchTok(const char *token, const char *line) return rc; } -void handleComments(char *s) +int handleComments(char *s) { SKIPSPACE(s); - if (*s == '#') + if (*s == '#') { *s = '\0'; + return 1; + } + return 0; } /* Push a file to spec's file stack, return the newly pushed entry */ @@ -117,6 +134,8 @@ static OFI_t * pushOFI(rpmSpec spec, const char *fn) ofi->fp = NULL; ofi->fileName = xstrdup(fn); ofi->lineNum = 0; + ofi->readBufLen = BUFSIZ; + ofi->readBuf = xmalloc(ofi->readBufLen); ofi->readBuf[0] = '\0'; ofi->readPtr = NULL; ofi->next = spec->fileStack; @@ -135,6 +154,7 @@ static OFI_t * popOFI(rpmSpec spec) if (ofi->fp) fclose(ofi->fp); free(ofi->fileName); + free(ofi->readBuf); free(ofi); } return spec->fileStack; @@ -151,8 +171,57 @@ static int restoreFirstChar(rpmSpec spec) return 0; } +static int expandMacrosInSpecBuf(rpmSpec spec, int strip) +{ + char *lbuf = NULL; + int isComment = 0; + + /* Don't expand macros (eg. %define) in false branch of %if clause */ + if (!spec->readStack->reading) + return 0; + + lbuf = spec->lbuf; + SKIPSPACE(lbuf); + if (lbuf[0] == '#') + isComment = 1; + + + if (rpmExpandMacros(spec->macros, spec->lbuf, &lbuf, 0) < 0) { + rpmlog(RPMLOG_ERR, _("line %d: %s\n"), + spec->lineNum, spec->lbuf); + return 1; + } + + if (strip & STRIP_COMMENTS && isComment) { + char *bufA = spec->lbuf; + char *bufB = lbuf; + + while (*bufA != '\0' && *bufB != '\0') { + if (*bufA == '%' && *(bufA + 1) == '%') + bufA++; + + if (*bufA != *bufB) + break; + + bufA++; + bufB++; + } + + if (*bufA != '\0' || *bufB != '\0') + rpmlog(RPMLOG_WARNING, + _("Macro expanded in comment on line %d: %s\n"), + spec->lineNum, bufA); + } + + free(spec->lbuf); + spec->lbuf = lbuf; + spec->lbufSize = strlen(spec->lbuf) + 1; + + return 0; +} + /* Return zero on success, 1 if we need to read more and -1 on errors. */ -static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) +static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi, int strip) { /* Expand next line from file into line buffer */ if (!(spec->nextline && *spec->nextline)) { @@ -203,13 +272,9 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) } spec->lbufOff = 0; - /* Don't expand macros (eg. %define) in false branch of %if clause */ - if (spec->readStack->reading && - expandMacros(spec, spec->macros, spec->lbuf, spec->lbufSize)) { - rpmlog(RPMLOG_ERR, _("line %d: %s\n"), - spec->lineNum, spec->lbuf); - return -1; - } + if (expandMacrosInSpecBuf(spec, strip)) + return -1; + spec->nextline = spec->lbuf; } return 0; @@ -258,7 +323,7 @@ retry: /* Make sure we have something in the read buffer */ if (!(ofi->readPtr && *(ofi->readPtr))) { - if (!fgets(ofi->readBuf, BUFSIZ, ofi->fp)) { + if (getline(&ofi->readBuf, &ofi->readBufLen, ofi->fp) <= 0) { /* EOF, remove this file from the stack */ ofi = popOFI(spec); @@ -280,8 +345,8 @@ retry: do { \ char *os = s; \ char *exp = rpmExpand(token, NULL); \ - while(*s && !risblank(*s)) s++; \ - while(*s && risblank(*s)) s++; \ + while (*s && !risblank(*s)) s++; \ + while (*s && risblank(*s)) s++; \ if (!*s) { \ rpmlog(RPMLOG_ERR, _("%s:%d: Argument expected for %s\n"), ofi->fileName, ofi->lineNum, os); \ free(exp); \ @@ -319,7 +384,7 @@ int readLine(rpmSpec spec, int strip) ofi = spec->fileStack; /* Copy next file line into the spec line buffer */ - rc = copyNextLineFromOFI(spec, ofi); + rc = copyNextLineFromOFI(spec, ofi, strip); if (rc > 0) { if (startLine == 0) startLine = spec->lineNum; @@ -349,7 +414,7 @@ int readLine(rpmSpec spec, int strip) match = !match; } else if (ISMACROWITHARG(s, "%if")) { s += 3; - match = parseExpressionBoolean(spec, s); + match = parseExpressionBoolean(s); if (match < 0) { rpmlog(RPMLOG_ERR, _("%s:%d: bad %%if condition\n"), @@ -385,10 +450,13 @@ int readLine(rpmSpec spec, int strip) fileName = s+8; SKIPSPACE(fileName); endFileName = fileName; - SKIPNONSPACE(endFileName); - p = endFileName; - SKIPSPACE(p); - if (*fileName == '\0' || *p != '\0') { + do { + SKIPNONSPACE(endFileName); + p = endFileName; + SKIPSPACE(p); + if (*p != '\0') endFileName = p; + } while (*p != '\0'); + if (*fileName == '\0') { rpmlog(RPMLOG_ERR, _("%s:%d: malformed %%include statement\n"), ofi->fileName, ofi->lineNum); return PART_ERROR; @@ -453,22 +521,26 @@ static const rpmTagVal sourceTags[] = { static void initSourceHeader(rpmSpec spec) { + Package sourcePkg = spec->sourcePackage; struct Source *srcPtr; - if (spec->sourceHeader) + if (headerIsEntry(sourcePkg->header, RPMTAG_NAME)) return; - spec->sourceHeader = headerNew(); /* Only specific tags are added to the source package header */ - headerCopyTags(spec->packages->header, spec->sourceHeader, sourceTags); + headerCopyTags(spec->packages->header, sourcePkg->header, sourceTags); /* Add the build restrictions */ + for (int i=0; idependencies[i], sourcePkg->header); + } + { HeaderIterator hi = headerInitIterator(spec->buildRestrictions); struct rpmtd_s td; while (headerNext(hi, &td)) { if (rpmtdCount(&td) > 0) { - (void) headerPut(spec->sourceHeader, &td, HEADERPUT_DEFAULT); + (void) headerPut(sourcePkg->header, &td, HEADERPUT_DEFAULT); } rpmtdFreeData(&td); } @@ -476,23 +548,23 @@ static void initSourceHeader(rpmSpec spec) } if (spec->BANames && spec->BACount > 0) { - headerPutStringArray(spec->sourceHeader, RPMTAG_BUILDARCHS, + headerPutStringArray(sourcePkg->header, RPMTAG_BUILDARCHS, spec->BANames, spec->BACount); } /* Add tags for sources and patches */ for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { if (srcPtr->flags & RPMBUILD_ISSOURCE) { - headerPutString(spec->sourceHeader, RPMTAG_SOURCE, srcPtr->source); + headerPutString(sourcePkg->header, RPMTAG_SOURCE, srcPtr->source); if (srcPtr->flags & RPMBUILD_ISNO) { - headerPutUint32(spec->sourceHeader, RPMTAG_NOSOURCE, + headerPutUint32(sourcePkg->header, RPMTAG_NOSOURCE, &srcPtr->num, 1); } } if (srcPtr->flags & RPMBUILD_ISPATCH) { - headerPutString(spec->sourceHeader, RPMTAG_PATCH, srcPtr->source); + headerPutString(sourcePkg->header, RPMTAG_PATCH, srcPtr->source); if (srcPtr->flags & RPMBUILD_ISNO) { - headerPutUint32(spec->sourceHeader, RPMTAG_NOPATCH, + headerPutUint32(sourcePkg->header, RPMTAG_NOPATCH, &srcPtr->num, 1); } } @@ -500,19 +572,17 @@ static void initSourceHeader(rpmSpec spec) } /* Add extra provides to package. */ -static void addPackageProvides(Header h) +void addPackageProvides(Package pkg) { const char *arch, *name; char *evr, *isaprov; rpmsenseFlags pflags = RPMSENSE_EQUAL; /* = provide */ - name = headerGetString(h, RPMTAG_NAME); - arch = headerGetString(h, RPMTAG_ARCH); - evr = headerGetAsString(h, RPMTAG_EVR); - headerPutString(h, RPMTAG_PROVIDENAME, name); - headerPutString(h, RPMTAG_PROVIDEVERSION, evr); - headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); + name = headerGetString(pkg->header, RPMTAG_NAME); + arch = headerGetString(pkg->header, RPMTAG_ARCH); + evr = headerGetAsString(pkg->header, RPMTAG_EVR); + addReqProv(pkg, RPMTAG_PROVIDENAME, name, evr, pflags, 0); /* * () = provide @@ -521,9 +591,7 @@ static void addPackageProvides(Header h) */ isaprov = rpmExpand(name, "%{?_isa}", NULL); if (!rstreq(arch, "noarch") && !rstreq(name, isaprov)) { - headerPutString(h, RPMTAG_PROVIDENAME, isaprov); - headerPutString(h, RPMTAG_PROVIDEVERSION, evr); - headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pflags, 1); + addReqProv(pkg, RPMTAG_PROVIDENAME, isaprov, evr, pflags, 0); } free(isaprov); free(evr); @@ -545,8 +613,13 @@ static void addTargets(Package Pkgs) headerPutString(pkg->header, RPMTAG_PLATFORM, platform); headerPutString(pkg->header, RPMTAG_OPTFLAGS, optflags); + /* Add manual dependencies early for rpmspec etc to look at */ + addPackageProvides(pkg); + for (int i=0; idependencies[i], pkg->header); + } + pkg->ds = rpmdsThis(pkg->header, RPMTAG_REQUIRENAME, RPMSENSE_EQUAL); - addPackageProvides(pkg->header); } free(platform); free(arch); @@ -554,10 +627,134 @@ static void addTargets(Package Pkgs) free(optflags); } +rpmRC checkForEncoding(Header h, int addtag) +{ + rpmRC rc = RPMRC_OK; +#if HAVE_ICONV + const char *encoding = "utf-8"; + rpmTagVal tag; + iconv_t ic; + char *dest = NULL; + size_t destlen = 0; + int strict = rpmExpandNumeric("%{_invalid_encoding_terminates_build}"); + HeaderIterator hi = headerInitIterator(h); + + ic = iconv_open(encoding, encoding); + if (ic == (iconv_t) -1) { + rpmlog(RPMLOG_WARNING, + _("encoding %s not supported by system\n"), encoding); + goto exit; + } + + while ((tag = headerNextTag(hi)) != RPMTAG_NOT_FOUND) { + struct rpmtd_s td; + const char *src = NULL; + + if (rpmTagGetClass(tag) != RPM_STRING_CLASS) + continue; + + headerGet(h, tag, &td, (HEADERGET_RAW|HEADERGET_MINMEM)); + while ((src = rpmtdNextString(&td)) != NULL) { + size_t srclen = strlen(src); + size_t outlen, inlen = srclen; + char *out, *in = (char *) src; + + if (destlen < srclen) { + destlen = srclen * 2; + dest = xrealloc(dest, destlen); + } + out = dest; + outlen = destlen; + + /* reset conversion state */ + iconv(ic, NULL, &inlen, &out, &outlen); + + if (iconv(ic, &in, &inlen, &out, &outlen) == (size_t) -1) { + rpmlog(strict ? RPMLOG_ERR : RPMLOG_WARNING, + _("Package %s: invalid %s encoding in %s: %s - %s\n"), + headerGetString(h, RPMTAG_NAME), + encoding, rpmTagGetName(tag), src, strerror(errno)); + rc = RPMRC_FAIL; + } + + } + rpmtdFreeData(&td); + } + + /* Stomp "known good utf" mark in header if requested */ + if (rc == RPMRC_OK && addtag) + headerPutString(h, RPMTAG_ENCODING, encoding); + if (!strict) + rc = RPMRC_OK; + +exit: + if (ic != (iconv_t) -1) + iconv_close(ic); + headerFreeIterator(hi); + free(dest); +#endif /* HAVE_ICONV */ + + return rc; +} + +static int parseEmpty(rpmSpec spec, int prevParsePart) +{ + int res = PART_ERROR; + int nextPart, rc; + char *line; + + line = spec->line + sizeof("%end") - 1; + SKIPSPACE(line); + if (line[0] != '\0') { + rpmlog(RPMLOG_ERR, + _("line %d: %%end doesn't take any arguments: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + + if (prevParsePart == PART_EMPTY) { + rpmlog(RPMLOG_ERR, + _("line %d: %%end not expected here, no section to close: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + + if ((rc = readLine(spec, STRIP_TRAILINGSPACE|STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + } else if (rc < 0) { + goto exit; + } else { + while (! (nextPart = isPart(spec->line))) { + line = spec->line; + SKIPSPACE(line); + + if (line[0] != '\0') { + rpmlog(RPMLOG_ERR, + _("line %d doesn't belong to any section: %s\n"), + spec->lineNum, spec->line); + goto exit; + } + if ((rc = readLine(spec, STRIP_TRAILINGSPACE|STRIP_COMMENTS)) > 0) { + nextPart = PART_NONE; + break; + } else if (rc < 0) { + goto exit; + } + } + } + + res = nextPart; + +exit: + return res; +} + static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, const char *buildRoot, int recursing) { int parsePart = PART_PREAMBLE; + int prevParsePart = PART_EMPTY; + int storedParsePart; int initialPackage = 1; rpmSpec spec; @@ -572,8 +769,8 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, } else { spec->buildRoot = rpmGetPath("%{?buildroot:%{buildroot}}", NULL); } - addMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC); - addMacro(NULL, "_licensedir", NULL, "%{_defaultlicensedir}", RMIL_SPEC); + rpmPushMacro(NULL, "_docdir", NULL, "%{_defaultdocdir}", RMIL_SPEC); + rpmPushMacro(NULL, "_licensedir", NULL, "%{_defaultlicensedir}", RMIL_SPEC); spec->recursing = recursing; spec->flags = flags; @@ -583,11 +780,15 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, while (parsePart != PART_NONE) { int goterror = 0; + storedParsePart = parsePart; switch (parsePart) { case PART_ERROR: /* fallthrough */ default: goterror = 1; break; + case PART_EMPTY: + parsePart = parseEmpty(spec, prevParsePart); + break; case PART_PREAMBLE: parsePart = parsePreamble(spec, initialPackage); initialPackage = 0; @@ -619,6 +820,12 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, case PART_TRIGGERIN: case PART_TRIGGERUN: case PART_TRIGGERPOSTUN: + case PART_FILETRIGGERIN: + case PART_FILETRIGGERUN: + case PART_FILETRIGGERPOSTUN: + case PART_TRANSFILETRIGGERIN: + case PART_TRANSFILETRIGGERUN: + case PART_TRANSFILETRIGGERPOSTUN: parsePart = parseScript(spec, parsePart); break; @@ -635,6 +842,7 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, case PART_BUILDARCHITECTURES: break; } + prevParsePart = storedParsePart; if (goterror || parsePart >= PART_LAST) { goto errxit; @@ -654,13 +862,13 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, /* Skip if not arch is not compatible. */ if (!rpmMachineScore(RPM_MACHTABLE_BUILDARCH, spec->BANames[x])) continue; - addMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC); + rpmPushMacro(NULL, "_target_cpu", NULL, spec->BANames[x], RMIL_RPMRC); spec->BASpecs[index] = parseSpec(specFile, flags, buildRoot, 1); if (spec->BASpecs[index] == NULL) { spec->BACount = index; goto errxit; } - delMacro(NULL, "_target_cpu"); + rpmPopMacro(NULL, "_target_cpu"); index++; } @@ -710,6 +918,18 @@ static rpmSpec parseSpec(const char *specFile, rpmSpecFlags flags, /* Add arch, os and platform, self-provides etc for each package */ addTargets(spec->packages); + /* Check for encoding in each package unless disabled */ + if (!(spec->flags & RPMSPEC_NOUTF8)) { + int badenc = 0; + for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) { + if (checkForEncoding(pkg->header, 0) != RPMRC_OK) { + badenc = 1; + } + } + if (badenc) + goto errxit; + } + closeSpec(spec); exit: /* Assemble source header from parsed components */ diff --git a/build/reqprov.c b/build/reqprov.c index bc2f7ea..5fa0a1c 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -7,124 +7,49 @@ #include #include -#include "build/rpmbuild_misc.h" +#include +#include "build/rpmbuild_internal.h" #include "debug.h" -static int isNewDep(Header h, rpmTagVal nametag, - const char *N, const char *EVR, rpmsenseFlags Flags, - rpmTagVal indextag, uint32_t index) -{ - int isnew = 1; - struct rpmtd_s idx; - rpmds ads = rpmdsNew(h, nametag, 0); - rpmds bds = rpmdsSingle(nametag, N, EVR, Flags); - - if (indextag) { - headerGet(h, indextag, &idx, HEADERGET_MINMEM); - } - - /* XXX there's no guarantee the ds is sorted here so rpmdsFind() wont do */ - rpmdsInit(ads); - while (isnew && rpmdsNext(ads) >= 0) { - if (!rstreq(rpmdsN(ads), rpmdsN(bds))) continue; - if (!rstreq(rpmdsEVR(ads), rpmdsEVR(bds))) continue; - if (rpmdsFlags(ads) != rpmdsFlags(bds)) continue; - if (indextag && rpmtdSetIndex(&idx, rpmdsIx(ads)) >= 0 && - rpmtdGetNumber(&idx) != index) continue; - isnew = 0; - } - - if (indextag) { - rpmtdFreeData(&idx); - } - rpmdsFree(ads); - rpmdsFree(bds); - return isnew; -} - -int addReqProv(Header h, rpmTagVal tagN, +int addReqProv(Package pkg, rpmTagVal tagN, const char * N, const char * EVR, rpmsenseFlags Flags, uint32_t index) { - rpmTagVal versiontag = 0; - rpmTagVal flagtag = 0; - rpmTagVal indextag = 0; - rpmsenseFlags extra = RPMSENSE_ANY; + rpmds newds, *dsp = NULL; - switch (tagN) { - case RPMTAG_PROVIDENAME: - versiontag = RPMTAG_PROVIDEVERSION; - flagtag = RPMTAG_PROVIDEFLAGS; - extra = Flags & RPMSENSE_FIND_PROVIDES; - break; - case RPMTAG_OBSOLETENAME: - versiontag = RPMTAG_OBSOLETEVERSION; - flagtag = RPMTAG_OBSOLETEFLAGS; - break; - case RPMTAG_CONFLICTNAME: - versiontag = RPMTAG_CONFLICTVERSION; - flagtag = RPMTAG_CONFLICTFLAGS; - break; - case RPMTAG_ORDERNAME: - versiontag = RPMTAG_ORDERVERSION; - flagtag = RPMTAG_ORDERFLAGS; - break; - case RPMTAG_TRIGGERNAME: - versiontag = RPMTAG_TRIGGERVERSION; - flagtag = RPMTAG_TRIGGERFLAGS; - indextag = RPMTAG_TRIGGERINDEX; - extra = Flags & RPMSENSE_TRIGGER; - break; - case RPMTAG_SUGGESTSNAME: - versiontag = RPMTAG_SUGGESTSVERSION; - flagtag = RPMTAG_SUGGESTSFLAGS; - extra = Flags & _ALL_REQUIRES_MASK; - break; - case RPMTAG_ENHANCESNAME: - versiontag = RPMTAG_ENHANCESVERSION; - flagtag = RPMTAG_ENHANCESFLAGS; - extra = Flags & _ALL_REQUIRES_MASK; - break; - case RPMTAG_REQUIRENAME: - default: - tagN = RPMTAG_REQUIRENAME; - versiontag = RPMTAG_REQUIREVERSION; - flagtag = RPMTAG_REQUIREFLAGS; - extra = Flags & _ALL_REQUIRES_MASK; - } + dsp = packageDependencies(pkg, tagN); /* rpmlib() dependency sanity: only requires permitted, ensure sense bit */ if (rstreqn(N, "rpmlib(", sizeof("rpmlib(")-1)) { if (tagN != RPMTAG_REQUIRENAME) return 1; - extra |= RPMSENSE_RPMLIB; + Flags |= RPMSENSE_RPMLIB; } - Flags = (Flags & RPMSENSE_SENSEMASK) | extra; + newds = rpmdsSinglePoolTix(pkg->pool, tagN, N, EVR, + rpmSanitizeDSFlags(tagN, Flags), index); - if (EVR == NULL) - EVR = ""; - - /* Avoid adding duplicate dependencies. */ - if (isNewDep(h, tagN, N, EVR, Flags, indextag, index)) { - headerPutString(h, tagN, N); - headerPutString(h, versiontag, EVR); - headerPutUint32(h, flagtag, &Flags, 1); - if (indextag) { - headerPutUint32(h, indextag, &index, 1); - } - } + rpmdsMerge(dsp, newds); + rpmdsFree(newds); return 0; } -int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR) +rpmRC addReqProvPkg(void *cbdata, rpmTagVal tagN, + const char * N, const char *EVR, rpmsenseFlags Flags, + int index) +{ + Package pkg = cbdata; + return addReqProv(pkg, tagN, N, EVR, Flags, index) ? RPMRC_FAIL : RPMRC_OK; +} + +int rpmlibNeedsFeature(Package pkg, const char * feature, const char * featureEVR) { char *reqname = NULL; int res; rasprintf(&reqname, "rpmlib(%s)", feature); - res = addReqProv(h, RPMTAG_REQUIRENAME, reqname, featureEVR, + res = addReqProv(pkg, RPMTAG_REQUIRENAME, reqname, featureEVR, RPMSENSE_RPMLIB|(RPMSENSE_LESS|RPMSENSE_EQUAL), 0); free(reqname); diff --git a/build/rpmbuild.h b/build/rpmbuild.h index 51a735d..4777f58 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -15,7 +15,8 @@ extern "C" { #endif /** \ingroup rpmbuild - * Bit(s) to control rpmSpecBuild() operation. + * Bit(s) to control rpmSpecBuild() operation. Also used as argument to + * rpmSpecGetSection and rpmSpecPkgGetSection. */ enum rpmBuildFlags_e { RPMBUILD_NONE = 0, @@ -31,6 +32,9 @@ enum rpmBuildFlags_e { RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */ RPMBUILD_STRINGBUF = (1 << 10), /*!< Internal use only */ RPMBUILD_RMSPEC = (1 << 11), /*!< Remove spec file. */ + RPMBUILD_FILE_FILE = (1 << 16), /*!< rpmSpecPkgGetSection: %files -f */ + RPMBUILD_FILE_LIST = (1 << 17), /*!< rpmSpecPkgGetSection: %files */ + RPMBUILD_POLICY = (1 << 18), /*!< rpmSpecPkgGetSection: %policy */ RPMBUILD_NOBUILD = (1 << 31) /*!< Don't execute or package. */ }; diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h index fb6198d..86a4f62 100644 --- a/build/rpmbuild_internal.h +++ b/build/rpmbuild_internal.h @@ -3,8 +3,22 @@ #include #include +#include #include "build/rpmbuild_misc.h" +#undef HASHTYPE +#undef HTKEYTYPE +#undef HTDATATYPE +#define HASHTYPE fileRenameHash +#define HTKEYTYPE const char * +#define HTDATATYPE const char * +#include "lib/rpmhash.H" +#undef HASHTYPE +#undef HTKEYTYPE +#undef HTDATATYPE + +#define WHITELIST_NAME ".-_+%{}" + struct TriggerFileEntry { int index; char * fileName; @@ -12,6 +26,7 @@ struct TriggerFileEntry { char * prog; uint32_t flags; struct TriggerFileEntry * next; + uint32_t priority; }; typedef struct ReadLevelEntry { @@ -36,6 +51,9 @@ typedef struct Package_s * Package; * The structure used to store values parsed from a spec file. */ struct rpmSpec_s { + char * buildHost; + rpm_time_t buildTime; + char * specFile; /*!< Name of the spec file. */ char * buildRoot; char * buildSubdir; @@ -66,10 +84,10 @@ struct rpmSpec_s { char * sourceRpmName; unsigned char * sourcePkgId; - Header sourceHeader; - rpmfi sourceCpioList; + Package sourcePackage; rpmMacroContext macros; + rpmstrPool pool; StringBuf prep; /*!< %prep scriptlet. */ StringBuf build; /*!< %build scriptlet. */ @@ -82,13 +100,19 @@ struct rpmSpec_s { Package packages; /*!< Package list. */ }; +#define PACKAGE_NUM_DEPS 12 + /** \ingroup rpmbuild * The structure used to store values for a package. */ struct Package_s { + rpmsid name; + rpmstrPool pool; Header header; rpmds ds; /*!< Requires: N = EVR */ - rpmfi cpioList; + rpmds dependencies[PACKAGE_NUM_DEPS]; + rpmfiles cpioList; + ARGV_t dpaths; struct Source * icon; @@ -104,9 +128,14 @@ struct Package_s { char * verifyFile; /*!< %verifyscript scriptlet. */ struct TriggerFileEntry * triggerFiles; + struct TriggerFileEntry * fileTriggerFiles; + struct TriggerFileEntry * transFileTriggerFiles; ARGV_t fileFile; ARGV_t fileList; /* If NULL, package will not be written */ + ARGV_t fileExcludeList; + ARGV_t removePostfixes; + fileRenameHash fileRenameMap; ARGV_t policyList; Package next; @@ -114,6 +143,7 @@ struct Package_s { #define PART_SUBNAME 0 #define PART_NAME 1 +#define PART_QUIET 2 /** \ingroup rpmbuild * rpmSpec file parser states. @@ -145,7 +175,14 @@ typedef enum rpmParseState_e { PART_TRIGGERPOSTUN = 30+PART_BASE, /*!< */ PART_TRIGGERPREIN = 31+PART_BASE, /*!< */ PART_POLICIES = 32+PART_BASE, /*!< */ - PART_LAST = 33+PART_BASE /*!< */ + PART_FILETRIGGERIN = 33+PART_BASE, /*!< */ + PART_FILETRIGGERUN = 34+PART_BASE, /*!< */ + PART_FILETRIGGERPOSTUN = 35+PART_BASE, /*!< */ + PART_TRANSFILETRIGGERIN = 36+PART_BASE, /*!< */ + PART_TRANSFILETRIGGERUN = 37+PART_BASE, /*!< */ + PART_TRANSFILETRIGGERPOSTUN = 38+PART_BASE, /*!< */ + PART_EMPTY = 39+PART_BASE, /*!< */ + PART_LAST = 40+PART_BASE /*!< */ } rpmParseState; @@ -259,12 +296,15 @@ int parseScript(rpmSpec spec, int parsePart); * Check for inappropriate characters. All alphanums are considered sane. * @param spec spec * @param field string to check - * @param fsize size of string to check * @param whitelist string of permitted characters * @return RPMRC_OK if OK */ RPM_GNUC_INTERNAL -rpmRC rpmCharCheck(rpmSpec spec, const char *field, size_t fsize, const char *whitelist); +rpmRC rpmCharCheck(rpmSpec spec, const char *field, const char *whitelist); + +typedef rpmRC (*addReqProvFunction) (void *cbdata, rpmTagVal tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + int index); /** \ingroup rpmbuild * Parse dependency relations from spec file and/or autogenerated output buffer. @@ -274,20 +314,21 @@ rpmRC rpmCharCheck(rpmSpec spec, const char *field, size_t fsize, const char *wh * @param tagN tag, identifies type of dependency * @param index (0 always) * @param tagflags dependency flags already known from context + * @param cb Callback for adding dependency (nullable) + * @param cbdata Callback data (@pkg if NULL) * @return RPMRC_OK on success, RPMRC_FAIL on failure */ RPM_GNUC_INTERNAL rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char * field, rpmTagVal tagN, - int index, rpmsenseFlags tagflags); + int index, rpmsenseFlags tagflags, addReqProvFunction cb, void *cbdata); /** \ingroup rpmbuild * Evaluate boolean expression. - * @param spec spec file control structure * @param expr expression to parse * @return */ RPM_GNUC_INTERNAL -int parseExpressionBoolean(rpmSpec spec, const char * expr); +int parseExpressionBoolean(const char * expr); /** \ingroup rpmbuild * Run a build script, assembled from spec file scriptlet section. @@ -317,23 +358,35 @@ rpmRC lookupPackage(rpmSpec spec, const char * name, int flag, /** \ingroup rpmbuild * Create and initialize package control structure. - * @param spec spec file control structure + * @param name package name for sub-packages (or NULL) + * @param pool string pool + * @param pkglist package list pointer to append to (or NULL) * @return package control structure */ RPM_GNUC_INTERNAL -Package newPackage(rpmSpec spec); +Package newPackage(const char *name, rpmstrPool pool, Package * pkglist); + + +/** \ingroup rpmbuild + * Return rpmds containing the dependencies of a given type + * @param pkg package + * @param tag name tag denominating the dependency + * @return pointer to dependency set + */ +RPM_GNUC_INTERNAL +rpmds * packageDependencies(Package pkg, rpmTagVal tag); /** \ingroup rpmbuild * Post-build processing for binary package(s). * @param spec spec file control structure * @param pkgFlags bit(s) to control package generation - * @param installSpecialDoc + * @param didInstall was %install executed? * @param test don't execute scripts or package if testing * @return 0 on success */ RPM_GNUC_INTERNAL rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags, - int installSpecialDoc, int test); + int didInstall, int test); /** \ingroup rpmfc * Generate package dependencies. @@ -393,6 +446,59 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating); RPM_GNUC_INTERNAL rpmRC packageSources(rpmSpec spec, char **cookie); +RPM_GNUC_INTERNAL +int addLangTag(rpmSpec spec, Header h, rpmTagVal tag, + const char *field, const char *lang); + +/** \ingroup rpmbuild + * Add dependency to package, filtering duplicates. + * @param pkg package + * @param tagN tag, identifies type of dependency + * @param N (e.g. Requires: foo < 0:1.2-3, "foo") + * @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") + * @param Flags (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<") + * @param index (# trigger script for triggers, 0 for others) + * @return 0 on success, 1 on error + */ +RPM_GNUC_INTERNAL +int addReqProv(Package pkg, rpmTagVal tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + uint32_t index); + +RPM_GNUC_INTERNAL +rpmRC addReqProvPkg(void *cbdata, rpmTagVal tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + int index); + +/** \ingroup rpmbuild + * Add self-provides to package. + * @param pkg package + */ +RPM_GNUC_INTERNAL +void addPackageProvides(Package pkg); + +/** \ingroup rpmbuild + * Add rpmlib feature dependency. + * @param pkg package + * @param feature rpm feature name (i.e. "rpmlib(Foo)" for feature Foo) + * @param featureEVR rpm feature epoch/version/release + * @return 0 always + */ +RPM_GNUC_INTERNAL +int rpmlibNeedsFeature(Package pkg, const char * feature, const char * featureEVR); + +RPM_GNUC_INTERNAL +rpmRC checkForEncoding(Header h, int addtag); + + +/** \ingroup rpmbuild + * Copy tags inherited by subpackages from the source header to the target header + * @param h target header + * @param fromh source header + */ +RPM_GNUC_INTERNAL +void copyInheritedTags(Header h, Header fromh); + #ifdef __cplusplus } #endif diff --git a/build/rpmbuild_misc.h b/build/rpmbuild_misc.h index 9665c97..843dfea 100644 --- a/build/rpmbuild_misc.h +++ b/build/rpmbuild_misc.h @@ -12,9 +12,10 @@ extern "C" { /** \ingroup rpmbuild * Truncate comment lines. * @param s skip white space, truncate line at '#' + * @return 1 on comment lines, 0 otherwise */ RPM_GNUC_INTERNAL -void handleComments(char * s); +int handleComments(char * s); /** \ingroup rpmstring */ @@ -62,31 +63,6 @@ void appendStringBufAux(StringBuf sb, const char * s, int nl); RPM_GNUC_INTERNAL uint32_t parseUnsignedNum(const char * line, uint32_t * res); -/** \ingroup rpmbuild - * Add dependency to header, filtering duplicates. - * @param h header - * @param tagN tag, identifies type of dependency - * @param N (e.g. Requires: foo < 0:1.2-3, "foo") - * @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3") - * @param Flags (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<") - * @param index (0 always) - * @return 0 on success, 1 on error - */ -RPM_GNUC_INTERNAL -int addReqProv(Header h, rpmTagVal tagN, - const char * N, const char * EVR, rpmsenseFlags Flags, - uint32_t index); - -/** \ingroup rpmbuild - * Add rpmlib feature dependency. - * @param h header - * @param feature rpm feature name (i.e. "rpmlib(Foo)" for feature Foo) - * @param featureEVR rpm feature epoch/version/release - * @return 0 always - */ -RPM_GNUC_INTERNAL -int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR); - #ifdef __cplusplus } #endif diff --git a/build/rpmfc.c b/build/rpmfc.c index f8e3402..2fbfc69 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -1,6 +1,7 @@ #include "system.h" #include +#include #include #include #include @@ -16,6 +17,7 @@ #include #include +#include "lib/rpmfi_internal.h" /* rpmfiles stuff for now */ #include "build/rpmbuild_internal.h" #include "debug.h" @@ -32,13 +34,24 @@ typedef struct rpmfcAttr_s { struct matchRule excl; } * rpmfcAttr; +typedef struct { + int fileIx; + rpmds dep; +} rpmfcFileDep; + +typedef struct { + rpmfcFileDep *data; + int size; + int alloced; +} rpmfcFileDeps; + /** */ struct rpmfc_s { + Package pkg; int nfiles; /*!< no. of files */ int fknown; /*!< no. of classified files */ int fwhite; /*!< no. of "white" files */ - int ix; /*!< current file index */ int skipProv; /*!< Don't auto-generate Provides:? */ int skipReq; /*!< Don't auto-generate Requires:? */ char *buildRoot; /*!< (Build) root dir */ @@ -54,11 +67,9 @@ struct rpmfc_s { ARGI_t fddictn; /*!< (no. files) file depends dictionary no. entries */ ARGI_t ddictx; /*!< (no. dependencies) file->dependency mapping */ rpmstrPool cdict; /*!< file class dictionary */ - rpmstrPool ddict; /*!< file depends dictionary */ + rpmfcFileDeps fileDeps; /*!< file dependency mapping */ - rpmds provides; /*!< (no. provides) package provides */ - rpmds requires; /*!< (no. requires) package requires */ - rpmds supplements; /*!< (no. supplements) package supplements */ + rpmstrPool pool; /*!< general purpose string storage */ }; struct rpmfcTokens_s { @@ -87,22 +98,62 @@ static void ruleFree(struct matchRule *rule) argvFree(rule->flags); } -static char *rpmfcAttrMacro(const char *name, - const char *attr_prefix, const char *attr) +static char *rpmfcAttrMacroV(const char *arg, va_list args) { - char *ret; - if (attr_prefix && attr_prefix[0] != '\0') - ret = rpmExpand("%{?__", name, "_", attr_prefix, "_", attr, "}", NULL); - else - ret = rpmExpand("%{?__", name, "_", attr, "}", NULL); - return rstreq(ret, "") ? _free(ret) : ret; + const char *s; + int blen; + char *buf = NULL, *obuf; + char *pe; + va_list args2; + + if (arg == NULL || rstreq(arg, "")) + return NULL; + + va_copy(args2, args); + blen = sizeof("%{?_") - 1; + for (s = arg; s != NULL; s = va_arg(args, const char *)) { + blen += sizeof("_") - 1 + strlen(s); + } + blen += sizeof("}") - 1; + + buf = xmalloc(blen + 1); + + pe = buf; + pe = stpcpy(pe, "%{?_"); + for (s = arg; s != NULL; s = va_arg(args2, const char *)) { + *pe++ = '_'; + pe = stpcpy(pe, s); + } + va_end(args2); + *pe++ = '}'; + *pe = '\0'; + + obuf = rpmExpand(buf, NULL); + free(buf); + + return rstreq(obuf, "") ? _free(obuf) : obuf; } -static regex_t *rpmfcAttrReg(const char *name, - const char *attr_prefix, const char *attr) +static char *rpmfcAttrMacro(const char *arg, ...) +{ + va_list args; + char *s; + + va_start(args, arg); + s = rpmfcAttrMacroV(arg, args); + va_end(args); + return s; +} + +static regex_t *rpmfcAttrReg(const char *arg, ...) { regex_t *reg = NULL; - char *pattern = rpmfcAttrMacro(name, attr_prefix, attr); + char *pattern; + va_list args; + + va_start(args, arg); + pattern = rpmfcAttrMacroV(arg, args); + va_end(args); if (pattern) { reg = xcalloc(1, sizeof(*reg)); if (regcomp(reg, pattern, REG_EXTENDED) != 0) { @@ -122,10 +173,19 @@ static rpmfcAttr rpmfcAttrNew(const char *name) attr->name = xstrdup(name); for (struct matchRule **rule = rules; rule && *rule; rule++) { const char *prefix = (*rule == &attr->incl) ? NULL : "exclude"; - char *flags = rpmfcAttrMacro(name, prefix, "flags"); + char *flags; + + if (prefix) { + flags = rpmfcAttrMacro(name, prefix, "flags", NULL); - (*rule)->path = rpmfcAttrReg(name, prefix, "path"); - (*rule)->magic = rpmfcAttrReg(name, prefix, "magic"); + (*rule)->path = rpmfcAttrReg(name, prefix, "path", NULL); + (*rule)->magic = rpmfcAttrReg(name, prefix, "magic", NULL); + } else { + flags = rpmfcAttrMacro(name, "flags", NULL); + + (*rule)->path = rpmfcAttrReg(name, "path", NULL); + (*rule)->magic = rpmfcAttrReg(name, "magic", NULL); + } (*rule)->flags = argvSplitString(flags, ",", ARGV_SKIPEMPTY); argvSort((*rule)->flags, NULL); @@ -163,16 +223,17 @@ static int rpmfcExpandAppend(ARGV_t * argvp, ARGV_const_t av) return 0; } -static rpmds rpmdsSingleNS(rpmTagVal tagN, const char *namespace, +static rpmds rpmdsSingleNS(rpmstrPool pool, + rpmTagVal tagN, const char *namespace, const char * N, const char * EVR, rpmsenseFlags Flags) { rpmds ds = NULL; if (namespace) { char *NSN = rpmExpand(namespace, "(", N, ")", NULL); - ds = rpmdsSingle(tagN, NSN, EVR, Flags); + ds = rpmdsSinglePool(pool, tagN, NSN, EVR, Flags); free(NSN); } else { - ds = rpmdsSingle(tagN, N, EVR, Flags); + ds = rpmdsSinglePool(pool, tagN, N, EVR, Flags); } return ds; } @@ -208,8 +269,6 @@ static StringBuf getOutputFrom(ARGV_t argv, child = fork(); if (child == 0) { - /* NSPR messes with SIGPIPE, reset to default for the kids */ - signal(SIGPIPE, SIG_DFL); close(toProg[1]); close(fromProg[0]); @@ -369,6 +428,12 @@ int rpmfcExec(ARGV_const_t av, StringBuf sb_stdin, StringBuf * sb_stdoutp, buf_stdin_len = strlen(buf_stdin); } + if (_rpmfc_debug) { + char *cmd = argvJoin(xav, " "); + rpmlog(RPMLOG_DEBUG, "Executing %s on %s\n", cmd, buf_stdin); + free(cmd); + } + /* Read output from exec'd helper. */ sb = getOutputFrom(xav, buf_stdin, buf_stdin_len, failnonzero, buildRoot); @@ -397,15 +462,15 @@ static void argvAddUniq(ARGV_t * argvp, const char * key) #define hasAttr(_a, _n) (argvSearch((_a), (_n), NULL) != NULL) -static void rpmfcAddFileDep(rpmstrPool ddict, int ix, rpmds ds, char deptype) +static void rpmfcAddFileDep(rpmfcFileDeps *fileDeps, rpmds ds, int ix) { - if (ds) { - char *key = NULL; - rasprintf(&key, "%08d%c %s %s 0x%08x", ix, deptype, - rpmdsN(ds), rpmdsEVR(ds), rpmdsFlags(ds)); - rpmstrPoolId(ddict, key, 1); - free(key); + if (fileDeps->size == fileDeps->alloced) { + fileDeps->alloced <<= 2; + fileDeps->data = xrealloc(fileDeps->data, + fileDeps->alloced * sizeof(fileDeps->data[0])); } + fileDeps->data[fileDeps->size].fileIx = ix; + fileDeps->data[fileDeps->size++].dep = ds; } static ARGV_t runCmd(const char *nsdep, const char *depname, @@ -424,7 +489,7 @@ static ARGV_t runCmd(const char *nsdep, const char *depname, appendLineStringBuf(sb_stdin, fn); if (rpmfcExec(av, sb_stdin, &sb_stdout, 0, buildRoot) == 0) { - argvSplit(&output, getStringBuf(sb_stdout), " \t\n\r"); + argvSplit(&output, getStringBuf(sb_stdout), "\n\r"); } argvFree(av); @@ -436,74 +501,77 @@ static ARGV_t runCmd(const char *nsdep, const char *depname, return output; } +struct addReqProvDataFc { + rpmfc fc; + const char *namespace; + regex_t *exclude; +}; + +static rpmRC addReqProvFc(void *cbdata, rpmTagVal tagN, + const char * N, const char * EVR, rpmsenseFlags Flags, + int index) +{ + struct addReqProvDataFc *data = cbdata; + rpmfc fc = data->fc; + const char *namespace = data->namespace; + regex_t *exclude = data->exclude; + + rpmds ds = rpmdsSingleNS(fc->pool, tagN, namespace, N, EVR, Flags); + /* Add to package and file dependencies unless filtered */ + if (regMatch(exclude, rpmdsDNEVR(ds)+2) == 0) + rpmfcAddFileDep(&fc->fileDeps, ds, index); + + return RPMRC_OK; +} + /** * Run per-interpreter dependency helper. * @param fc file classifier + * @param ix file index * @param nsdep class name for interpreter (e.g. "perl") * @param depname "provides" or "requires" - * @param depsp fc->provides or fc->requires * @param dsContext RPMSENSE_FIND_PROVIDES or RPMSENSE_FIND_REQUIRES * @param tagN RPMTAG_PROVIDENAME or RPMTAG_REQUIRENAME - * @return 0 + * @return 0 on success */ -static int rpmfcHelper(rpmfc fc, const char *nsdep, const char *depname, - rpmds *depsp, rpmsenseFlags dsContext, rpmTagVal tagN) +static int rpmfcHelper(rpmfc fc, int ix, + const char *nsdep, const char *depname, + rpmsenseFlags dsContext, rpmTagVal tagN) { ARGV_t pav = NULL; - const char * fn = fc->fn[fc->ix]; + const char * fn = fc->fn[ix]; char *namespace = NULL; int pac; + int rc = 0; regex_t *exclude = NULL; regex_t *exclude_from = NULL; + regex_t *global_exclude_from = NULL; /* If the entire path is filtered out, there's nothing more to do */ - exclude_from = rpmfcAttrReg(depname, "exclude", "from"); + exclude_from = rpmfcAttrReg(depname, "exclude", "from", NULL); if (regMatch(exclude_from, fn+fc->brlen)) goto exit; + global_exclude_from = rpmfcAttrReg("global", depname, "exclude", "from", NULL); + if (regMatch(global_exclude_from, fn+fc->brlen)) + goto exit; + pav = runCmd(nsdep, depname, fc->buildRoot, fn); if (pav == NULL) goto exit; pac = argvCount(pav); - namespace = rpmfcAttrMacro(nsdep, NULL, "namespace"); - exclude = rpmfcAttrReg(depname, NULL, "exclude"); - - for (int i = 0; i < pac; i++) { - rpmds ds = NULL; - const char *N = pav[i]; - const char *EVR = ""; - rpmsenseFlags Flags = dsContext; - if (pav[i+1] && strchr("=<>", *pav[i+1])) { - i++; - for (const char *s = pav[i]; *s; s++) { - switch(*s) { - default: - break; - case '=': - Flags |= RPMSENSE_EQUAL; - break; - case '<': - Flags |= RPMSENSE_LESS; - break; - case '>': - Flags |= RPMSENSE_GREATER; - break; - } - } - i++; - EVR = pav[i]; - } - - ds = rpmdsSingleNS(tagN, namespace, N, EVR, Flags); + namespace = rpmfcAttrMacro(nsdep, "namespace", NULL); + exclude = rpmfcAttrReg(depname, "exclude", NULL); - /* Add to package and file dependencies unless filtered */ - if (regMatch(exclude, rpmdsDNEVR(ds)+2) == 0) { - (void) rpmdsMerge(depsp, ds); - rpmfcAddFileDep(fc->ddict, fc->ix, ds, tagN == RPMTAG_PROVIDENAME ? 'P' : 'R'); - } + struct addReqProvDataFc data; + data.fc = fc; + data.namespace = namespace; + data.exclude = exclude; - rpmdsFree(ds); + for (int i = 0; i < pac; i++) { + if (parseRCPOT(NULL, fc->pkg, pav[i], tagN, ix, dsContext, addReqProvFc, &data)) + rc++; } argvFree(pav); @@ -512,55 +580,8 @@ static int rpmfcHelper(rpmfc fc, const char *nsdep, const char *depname, exit: regFree(exclude_from); - return 0; -} - -/** - * Run per-interpreter Provides: dependency helper. - * @param fc file classifier - * @param nsdep class name for interpreter (e.g. "perl") - * @return 0 - */ -static int rpmfcHelperProvides(rpmfc fc, const char * nsdep) -{ - if (fc->skipProv) - return 0; - - rpmfcHelper(fc, nsdep, "provides", &fc->provides, RPMSENSE_FIND_PROVIDES, RPMTAG_PROVIDENAME); - - return 0; -} - -/** - * Run per-interpreter Requires: dependency helper. - * @param fc file classifier - * @param nsdep class name for interpreter (e.g. "perl") - * @return 0 - */ -static int rpmfcHelperRequires(rpmfc fc, const char * nsdep) -{ - if (fc->skipReq) - return 0; - - rpmfcHelper(fc, nsdep, "requires", &fc->requires, RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME); - - return 0; -} - -/** - * Run per-interpreter Supplements: dependency helper. - * @param fc file classifier - * @param nsdep class name for interpreter (e.g. "perl") - * @return 0 - */ -static int rpmfcHelperSupplements(rpmfc fc, const char * nsdep) -{ - if (fc->skipReq) - return 0; - - rpmfcHelper(fc, nsdep, "supplements", &fc->supplements, RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK, RPMTAG_ENHANCESNAME); - - return 0; + regFree(global_exclude_from); + return rc; } /* Only used for elf coloring and controlling RPMTAG_FILECLASS inclusion now */ @@ -635,7 +656,7 @@ static int matches(const struct matchRule *rule, } } -static void rpmfcAttributes(rpmfc fc, const char *ftype, const char *fullpath) +static void rpmfcAttributes(rpmfc fc, int ix, const char *ftype, const char *fullpath) { const char *path = fullpath + fc->brlen; int is_executable = 0; @@ -652,7 +673,7 @@ static void rpmfcAttributes(rpmfc fc, const char *ftype, const char *fullpath) /* Add attributes on libmagic type & path pattern matches */ if (matches(&(*attr)->incl, ftype, path, is_executable)) - argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name); + argvAddTokens(&fc->fattrs[ix], (*attr)->name); } } @@ -676,39 +697,34 @@ static rpm_color_t rpmfcColor(const char * fmstr) void rpmfcPrint(const char * msg, rpmfc fc, FILE * fp) { - rpm_color_t fcolor; int ndx; int dx; int fx; -int nprovides; -int nrequires; - if (fp == NULL) fp = stderr; if (msg) fprintf(fp, "===================================== %s\n", msg); -nprovides = rpmdsCount(fc->provides); -nrequires = rpmdsCount(fc->requires); - if (fc) for (fx = 0; fx < fc->nfiles; fx++) { - rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ - fcolor = fc->fcolor[fx]; - ARGV_t fattrs = fc->fattrs[fx]; - fprintf(fp, "%3d %s", fx, fc->fn[fx]); - if (fcolor != RPMFC_BLACK) + if (_rpmfc_debug) { + rpmsid cx = fc->fcdictx[fx] + 1; /* id's are one off */ + rpm_color_t fcolor = fc->fcolor[fx]; + ARGV_t fattrs = fc->fattrs[fx]; + + if (fcolor != RPMFC_BLACK) fprintf(fp, "\t0x%x", fc->fcolor[fx]); - else + else fprintf(fp, "\t%s", rpmstrPoolStr(fc->cdict, cx)); - if (fattrs) { - char *attrs = argvJoin(fattrs, ","); - fprintf(fp, " [%s]", attrs); - free(attrs); - } else { - fprintf(fp, " [none]"); + if (fattrs) { + char *attrs = argvJoin(fattrs, ","); + fprintf(fp, " [%s]", attrs); + free(attrs); + } else { + fprintf(fp, " [none]"); + } } fprintf(fp, "\n"); @@ -724,32 +740,16 @@ assert(fx < fc->fddictn->nvals); const char * depval; unsigned char deptype; unsigned ix; + rpmds ds; ix = fc->ddictx->vals[dx++]; deptype = ((ix >> 24) & 0xff); ix &= 0x00ffffff; depval = NULL; - switch (deptype) { - default: -assert(depval != NULL); - break; - case 'P': - if (nprovides > 0) { -assert(ix < nprovides); - (void) rpmdsSetIx(fc->provides, ix-1); - if (rpmdsNext(fc->provides) >= 0) - depval = rpmdsDNEVR(fc->provides); - } - break; - case 'R': - if (nrequires > 0) { -assert(ix < nrequires); - (void) rpmdsSetIx(fc->requires, ix-1); - if (rpmdsNext(fc->requires) >= 0) - depval = rpmdsDNEVR(fc->requires); - } - break; - } + ds = rpmfcDependencies(fc, rpmdsDToTagN(deptype)); + (void) rpmdsSetIx(ds, ix-1); + if (rpmdsNext(ds) >= 0) + depval = rpmdsDNEVR(ds); if (depval) fprintf(fp, "\t%s\n", depval); } @@ -771,16 +771,19 @@ rpmfc rpmfcFree(rpmfc fc) free(fc->fattrs); free(fc->fcolor); free(fc->fcdictx); + free(fc->pkg); argiFree(fc->fddictx); argiFree(fc->fddictn); argiFree(fc->ddictx); - rpmstrPoolFree(fc->ddict); + for (int i = 0; i < fc->fileDeps.size; i++) { + rpmdsFree(fc->fileDeps.data[i].dep); + } + free(fc->fileDeps.data); + rpmstrPoolFree(fc->cdict); - rpmdsFree(fc->provides); - rpmdsFree(fc->requires); - rpmdsFree(fc->supplements); + rpmstrPoolFree(fc->pool); memset(fc, 0, sizeof(*fc)); /* trash and burn */ free(fc); } @@ -794,6 +797,11 @@ rpmfc rpmfcCreate(const char *buildRoot, rpmFlags flags) fc->buildRoot = xstrdup(buildRoot); fc->brlen = strlen(buildRoot); } + fc->pool = rpmstrPoolCreate(); + fc->pkg = xcalloc(1, sizeof(*fc->pkg)); + fc->fileDeps.alloced = 10; + fc->fileDeps.data = xmalloc(fc->fileDeps.alloced * + sizeof(fc->fileDeps.data[0])); return fc; } @@ -802,97 +810,183 @@ rpmfc rpmfcNew(void) return rpmfcCreate(NULL, 0); } +rpmds rpmfcDependencies(rpmfc fc, rpmTagVal tag) +{ + if (fc) { + return *packageDependencies(fc->pkg, tag); + } + return NULL; +} + rpmds rpmfcProvides(rpmfc fc) { - return (fc != NULL ? fc->provides : NULL); + return rpmfcDependencies(fc, RPMTAG_PROVIDENAME); } rpmds rpmfcRequires(rpmfc fc) { - return (fc != NULL ? fc->requires : NULL); + return rpmfcDependencies(fc, RPMTAG_REQUIRENAME); +} + +rpmds rpmfcRecommends(rpmfc fc) +{ + return rpmfcDependencies(fc, RPMTAG_RECOMMENDNAME); +} + +rpmds rpmfcSuggests(rpmfc fc) +{ + return rpmfcDependencies(fc, RPMTAG_SUGGESTNAME); } rpmds rpmfcSupplements(rpmfc fc) { - return (fc != NULL ? fc->supplements : NULL); + return rpmfcDependencies(fc, RPMTAG_SUPPLEMENTNAME); } -rpmRC rpmfcApply(rpmfc fc) +rpmds rpmfcEnhances(rpmfc fc) { - const char * s; - char * se; - rpmds ds; - const char * N; - const char * EVR; - rpmsenseFlags Flags; - unsigned char deptype; - int nddict; + return rpmfcDependencies(fc, RPMTAG_ENHANCENAME); +} + +rpmds rpmfcConflicts(rpmfc fc) +{ + return rpmfcDependencies(fc, RPMTAG_CONFLICTNAME); +} + +rpmds rpmfcObsoletes(rpmfc fc) +{ + return rpmfcDependencies(fc, RPMTAG_OBSOLETENAME); +} + + +/* Versioned deps are less than unversioned deps */ +static int cmpVerDeps(const void *a, const void *b) +{ + rpmfcFileDep *fDepA = (rpmfcFileDep *) a; + rpmfcFileDep *fDepB = (rpmfcFileDep *) b; + + int aIsVersioned = rpmdsFlags(fDepA->dep) & RPMSENSE_SENSEMASK ? 1 : 0; + int bIsVersioned = rpmdsFlags(fDepB->dep) & RPMSENSE_SENSEMASK ? 1 : 0; + + return bIsVersioned - aIsVersioned; +} + +/* Sort by index */ +static int cmpIndexDeps(const void *a, const void *b) +{ + rpmfcFileDep *fDepA = (rpmfcFileDep *) a; + rpmfcFileDep *fDepB = (rpmfcFileDep *) b; + + return fDepA->fileIx - fDepB->fileIx; +} + +/* + * Remove unversioned deps if corresponding versioned deps exist but only + * if the versioned dependency has the same type and the same color as the versioned. + */ +static void rpmfcNormalizeFDeps(rpmfc fc) +{ + rpmstrPool versionedDeps = rpmstrPoolCreate(); + rpmfcFileDep *normalizedFDeps = xmalloc(fc->fileDeps.size * + sizeof(normalizedFDeps[0])); + int ix = 0; + char *depStr; + + /* Sort. Versioned dependencies first */ + qsort(fc->fileDeps.data, fc->fileDeps.size, sizeof(fc->fileDeps.data[0]), + cmpVerDeps); + + for (int i = 0; i < fc->fileDeps.size; i++) { + switch (rpmdsTagN(fc->fileDeps.data[i].dep)) { + case RPMTAG_REQUIRENAME: + case RPMTAG_RECOMMENDNAME: + case RPMTAG_SUGGESTNAME: + rasprintf(&depStr, "%08x_%c_%s", + fc->fcolor[fc->fileDeps.data[i].fileIx], + rpmdsD(fc->fileDeps.data[i].dep), + rpmdsN(fc->fileDeps.data[i].dep)); + + if (rpmdsFlags(fc->fileDeps.data[i].dep) & RPMSENSE_SENSEMASK) { + /* preserve versioned require dependency */ + normalizedFDeps[ix++] = fc->fileDeps.data[i]; + rpmstrPoolId(versionedDeps, depStr, 1); + } else if (!rpmstrPoolId(versionedDeps, depStr, 0)) { + /* preserve unversioned require dep only if versioned dep doesn't exist */ + normalizedFDeps[ix++] =fc-> fileDeps.data[i]; + } else { + rpmdsFree(fc->fileDeps.data[i].dep); + } + free(depStr); + break; + default: + /* Preserve all non-require dependencies */ + normalizedFDeps[ix++] = fc->fileDeps.data[i]; + break; + } + } + rpmstrPoolFree(versionedDeps); + + free(fc->fileDeps.data); + fc->fileDeps.data = normalizedFDeps; + fc->fileDeps.size = ix; +} + +static rpmRC rpmfcApplyInternal(rpmfc fc) +{ + rpmds ds, * dsp; int previx; unsigned int val; int dix; int ix; /* Generate package and per-file dependencies. */ - for (fc->ix = 0; fc->ix < fc->nfiles && fc->fn[fc->ix] != NULL; fc->ix++) { - for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) { - rpmfcHelperProvides(fc, *fattr); - rpmfcHelperRequires(fc, *fattr); - rpmfcHelperSupplements(fc, *fattr); + for (ix = 0; ix < fc->nfiles && fc->fn[ix] != NULL; ix++) { + for (ARGV_t fattr = fc->fattrs[ix]; fattr && *fattr; fattr++) { + if (!fc->skipProv) { + rpmfcHelper(fc, ix, *fattr, "provides", + RPMSENSE_FIND_PROVIDES, RPMTAG_PROVIDENAME); + } + if (!fc->skipReq) { + rpmfcHelper(fc, ix, *fattr, "requires", + RPMSENSE_FIND_REQUIRES, RPMTAG_REQUIRENAME); + rpmfcHelper(fc, ix, *fattr, "recommends", + RPMSENSE_FIND_REQUIRES, RPMTAG_RECOMMENDNAME); + rpmfcHelper(fc, ix, *fattr, "suggests", + RPMSENSE_FIND_REQUIRES, RPMTAG_SUGGESTNAME); + rpmfcHelper(fc, ix, *fattr, "supplements", + RPMSENSE_FIND_REQUIRES, RPMTAG_SUPPLEMENTNAME); + rpmfcHelper(fc, ix, *fattr, "enhances", + RPMSENSE_FIND_REQUIRES, RPMTAG_ENHANCENAME); + rpmfcHelper(fc, ix, *fattr, "conflicts", + RPMSENSE_FIND_REQUIRES, RPMTAG_CONFLICTNAME); + rpmfcHelper(fc, ix, *fattr, "obsoletes", + RPMSENSE_FIND_REQUIRES, RPMTAG_OBSOLETENAME); + } } } /* No more additions after this, freeze pool to minimize memory use */ - rpmstrPoolFreeze(fc->ddict, 0); + + rpmfcNormalizeFDeps(fc); + for (int i = 0; i < fc->fileDeps.size; i++) { + ds = fc->fileDeps.data[i].dep; + rpmdsMerge(packageDependencies(fc->pkg, rpmdsTagN(ds)), ds); + } + + /* Sort by index */ + qsort(fc->fileDeps.data, fc->fileDeps.size, + sizeof(fc->fileDeps.data[0]), cmpIndexDeps); /* Generate per-file indices into package dependencies. */ - nddict = rpmstrPoolNumStr(fc->ddict); previx = -1; - for (rpmsid id = 1; id <= nddict; id++) { - s = rpmstrPoolStr(fc->ddict, id); - - /* Parse out (file#,deptype,N,EVR,Flags) */ - ix = strtol(s, &se, 10); - if ( se == NULL ) { - rpmlog(RPMLOG_ERR, _("Conversion of %s to long integer failed.\n"), s); - return RPMRC_FAIL; - } - - deptype = *se++; - se++; - N = se; - while (*se && *se != ' ') - se++; - *se++ = '\0'; - EVR = se; - while (*se && *se != ' ') - se++; - *se++ = '\0'; - Flags = strtol(se, NULL, 16); - - dix = -1; - switch (deptype) { - default: - break; - case 'P': - ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags); - dix = rpmdsFind(fc->provides, ds); - rpmdsFree(ds); - break; - case 'R': - ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags); - dix = rpmdsFind(fc->requires, ds); - rpmdsFree(ds); - break; - case 'S': - ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags); - dix = rpmdsFind(fc->supplements, ds); - ds = rpmdsFree(ds); - break; - } - + for (int i = 0; i < fc->fileDeps.size; i++) { + ds = fc->fileDeps.data[i].dep; + ix = fc->fileDeps.data[i].fileIx; + dsp = packageDependencies(fc->pkg, rpmdsTagN(ds)); + dix = rpmdsFind(*dsp, ds); if (dix < 0) continue; - val = (deptype << 24) | (dix & 0x00ffffff); + val = (rpmdsD(ds) << 24) | (dix & 0x00ffffff); argiAdd(&fc->ddictx, -1, val); if (previx != ix) { @@ -901,8 +995,8 @@ rpmRC rpmfcApply(rpmfc fc) } if (fc->fddictn && fc->fddictn->vals) fc->fddictn->vals[ix]++; - } + } return RPMRC_OK; } @@ -960,7 +1054,6 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) /* Build (sorted) file class dictionary. */ fc->cdict = rpmstrPoolCreate(); - fc->ddict = rpmstrPoolCreate(); ms = magic_open(msflags); if (ms == NULL) { @@ -974,13 +1067,13 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) goto exit; } - for (fc->ix = 0; fc->ix < fc->nfiles; fc->ix++) { + for (int ix = 0; ix < fc->nfiles; ix++) { rpmsid ftypeId; const char * ftype; - const char * s = argv[fc->ix]; + const char * s = argv[ix]; size_t slen = strlen(s); int fcolor = RPMFC_BLACK; - rpm_mode_t mode = (fmode ? fmode[fc->ix] : 0); + rpm_mode_t mode = (fmode ? fmode[ix] : 0); int is_executable = (mode & (S_IXUSR|S_IXGRP|S_IXOTH)); switch (mode & S_IFMT) { @@ -1026,15 +1119,15 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) rpmlog(RPMLOG_DEBUG, "%s: %s\n", s, ftype); /* Save the path. */ - fc->fn[fc->ix] = xstrdup(s); + fc->fn[ix] = xstrdup(s); /* Add (filtered) file coloring */ fcolor |= rpmfcColor(ftype); /* Add attributes based on file type and/or path */ - rpmfcAttributes(fc, ftype, s); + rpmfcAttributes(fc, ix, ftype, s); - fc->fcolor[fc->ix] = fcolor; + fc->fcolor[ix] = fcolor; /* Add to file class dictionary and index array */ if (fcolor != RPMFC_WHITE && (fcolor & RPMFC_INCLUDE)) { @@ -1045,7 +1138,7 @@ rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode) fc->fwhite++; } /* Pool id's start from 1, for headers we want it from 0 */ - fc->fcdictx[fc->ix] = ftypeId - 1; + fc->fcdictx[ix] = ftypeId - 1; } rc = RPMRC_OK; @@ -1101,6 +1194,12 @@ static struct DepMsg_s depMsgs[] = { { "Requires(postun)", { NULL, "postun", NULL, NULL }, -1, -1, RPMTAG_REQUIREFLAGS, RPMSENSE_SCRIPT_POSTUN, 0 }, + { "Requires(pretrans)", { NULL, "pretrans", NULL, NULL }, + -1, -1, RPMTAG_REQUIREFLAGS, + RPMSENSE_PRETRANS, 0 }, + { "Requires(posttrans)", { NULL, "posttrans", NULL, NULL }, + -1, -1, RPMTAG_REQUIREFLAGS, + RPMSENSE_POSTTRANS, 0 }, { "Requires", { "%{?__find_requires}", NULL, NULL, NULL }, -1, -1, RPMTAG_REQUIREFLAGS, /* XXX inherit name/version arrays */ RPMSENSE_FIND_REQUIRES|RPMSENSE_TRIGGERIN|RPMSENSE_TRIGGERUN|RPMSENSE_TRIGGERPOSTUN|RPMSENSE_TRIGGERPREIN, 0 }, @@ -1110,12 +1209,18 @@ static struct DepMsg_s depMsgs[] = { { "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL }, RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS, 0, -1 }, - { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL }, - RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS, - RPMSENSE_STRONG, RPMSENSE_STRONG }, + { "Recommends", { "%{?__find_recommends}", NULL, NULL, NULL }, + RPMTAG_RECOMMENDNAME, RPMTAG_RECOMMENDVERSION, RPMTAG_RECOMMENDFLAGS, + 0, -1 }, + { "Suggests", { "%{?__find_suggests}", NULL, NULL, NULL }, + RPMTAG_SUGGESTNAME, RPMTAG_SUGGESTVERSION, RPMTAG_SUGGESTFLAGS, + 0, -1 }, { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL }, - RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS, - RPMSENSE_STRONG, 0 }, + RPMTAG_SUPPLEMENTNAME, RPMTAG_SUPPLEMENTVERSION, RPMTAG_SUPPLEMENTFLAGS, + 0, -1 }, + { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL }, + RPMTAG_ENHANCENAME, RPMTAG_ENHANCEVERSION, RPMTAG_ENHANCEFLAGS, + 0, -1 }, { NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 } }; @@ -1123,7 +1228,7 @@ static DepMsg_t DepMsgs = depMsgs; /** */ -static void printDeps(Header h) +static void printDeps(rpmfc fc) { DepMsg_t dm; rpmds ds = NULL; @@ -1133,8 +1238,7 @@ static void printDeps(Header h) for (dm = DepMsgs; dm->msg != NULL; dm++) { if (dm->ntag != -1) { - rpmdsFree(ds); - ds = rpmdsNew(h, dm->ntag, 0); + ds = rpmfcDependencies(fc, dm->ntag); } if (dm->ftag == 0) continue; @@ -1161,18 +1265,16 @@ static void printDeps(Header h) if (bingo) rpmlog(RPMLOG_NOTICE, "\n"); } - rpmdsFree(ds); } -static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi fi) +static rpmRC rpmfcApplyExternal(rpmfc fc) { StringBuf sb_stdin = newStringBuf(); rpmRC rc = RPMRC_OK; /* Create file manifest buffer to deliver to dependency finder. */ - fi = rpmfiInit(fi, 0); - while (rpmfiNext(fi) >= 0) - appendLineStringBuf(sb_stdin, rpmfiFN(fi)); + for (int i = 0; i < fc->nfiles; i++) + appendLineStringBuf(sb_stdin, fc->fn[i]); for (DepMsg_t dm = DepMsgs; dm->msg != NULL; dm++) { rpmTagVal tag = (dm->ftag > 0) ? dm->ftag : dm->ntag; @@ -1181,25 +1283,23 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f StringBuf sb_stdout = NULL; int failnonzero = (tag == RPMTAG_PROVIDEFLAGS); - switch(tag) { + switch (tag) { case RPMTAG_PROVIDEFLAGS: - if (!pkg->autoProv) + if (fc->skipProv) continue; tagflags = RPMSENSE_FIND_PROVIDES; break; case RPMTAG_REQUIREFLAGS: - if (!pkg->autoReq) + case RPMTAG_RECOMMENDFLAGS: + case RPMTAG_SUGGESTFLAGS: + case RPMTAG_SUPPLEMENTFLAGS: + case RPMTAG_ENHANCEFLAGS: + case RPMTAG_CONFLICTFLAGS: + case RPMTAG_OBSOLETEFLAGS: + if (fc->skipReq) continue; tagflags = RPMSENSE_FIND_REQUIRES; break; - case RPMTAG_ENHANCESFLAGS: - if (!pkg->autoProv) - continue; - failnonzero = 0; - tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK; - if (strcmp(dm->msg, "Supplements") == 0) - tagflags |= RPMSENSE_STRONG; - break; default: continue; break; @@ -1210,7 +1310,7 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f free(s); if (rpmfcExec(dm->argv, sb_stdin, &sb_stdout, - failnonzero, spec->buildRoot) == -1) + failnonzero, fc->buildRoot) == -1) continue; if (sb_stdout == NULL) { @@ -1220,7 +1320,7 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f } /* Parse dependencies into header */ - rc = parseRCPOT(spec, pkg, getStringBuf(sb_stdout), tag, 0, tagflags); + rc = parseRCPOT(NULL, fc->pkg, getStringBuf(sb_stdout), dm->ntag != -1 ? dm->ntag : RPMTAG_REQUIRENAME, 0, tagflags, addReqProvPkg, NULL); freeStringBuf(sb_stdout); if (rc) { @@ -1234,11 +1334,26 @@ static rpmRC rpmfcGenerateDependsHelper(const rpmSpec spec, Package pkg, rpmfi f return rc; } +rpmRC rpmfcApply(rpmfc fc) +{ + rpmRC rc; + /* If new-fangled dependency generation is disabled ... */ + if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) { + /* ... then generate dependencies using %{__find_requires} et al. */ + rpmlog(RPMLOG_WARNING, + _("Deprecated external dependency generator is used!\n")); + rc = rpmfcApplyExternal(fc); + } else { + /* ... otherwise generate per-file dependencies */ + rc = rpmfcApplyInternal(fc); + } + return rc; +} + rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg) { - rpmfi fi = pkg->cpioList; + rpmfi fi = rpmfilesIter(pkg->cpioList, RPMFI_ITER_FWD); rpmfc fc = NULL; - ARGV_t av = NULL; rpm_mode_t * fmode = NULL; int ac = rpmfiFC(fi); int genConfigDeps = 0; @@ -1250,82 +1365,46 @@ rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg) if (ac <= 0) goto exit; - /* Skip packages that have dependency generation disabled. */ - if (! (pkg->autoReq || pkg->autoProv)) - goto exit; - - /* If new-fangled dependency generation is disabled ... */ - if (!rpmExpandNumeric("%{?_use_internal_dependency_generator}")) { - /* ... then generate dependencies using %{__find_requires} et al. */ - rc = rpmfcGenerateDependsHelper(spec, pkg, fi); - goto exit; - } - /* Extract absolute file paths in argv format. */ - av = xcalloc(ac+1, sizeof(*av)); fmode = xcalloc(ac+1, sizeof(*fmode)); fi = rpmfiInit(fi, 0); while ((idx = rpmfiNext(fi)) >= 0) { /* Does package have any %config files? */ genConfigDeps |= (rpmfiFFlags(fi) & RPMFILE_CONFIG); - - av[idx] = xstrdup(rpmfiFN(fi)); fmode[idx] = rpmfiFMode(fi); } - av[ac] = NULL; fc = rpmfcCreate(spec->buildRoot, 0); + free(fc->pkg); + fc->pkg = pkg; fc->skipProv = !pkg->autoProv; fc->skipReq = !pkg->autoReq; - /* Copy (and delete) manually generated dependencies to dictionary. */ - if (!fc->skipProv) { - rpmds ds = rpmdsNew(pkg->header, RPMTAG_PROVIDENAME, 0); - rpmdsMerge(&fc->provides, ds); - rpmdsFree(ds); - - headerDel(pkg->header, RPMTAG_PROVIDENAME); - headerDel(pkg->header, RPMTAG_PROVIDEVERSION); - headerDel(pkg->header, RPMTAG_PROVIDEFLAGS); - + if (!fc->skipProv && genConfigDeps) { /* Add config dependency, Provides: config(N) = EVR */ - if (genConfigDeps) { - ds = rpmdsSingleNS(RPMTAG_PROVIDENAME, "config", - rpmdsN(pkg->ds), rpmdsEVR(pkg->ds), - (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); - rpmdsMerge(&fc->provides, ds); - rpmdsFree(ds); - } + rpmds ds = rpmdsSingleNS(fc->pool, RPMTAG_PROVIDENAME, "config", + rpmdsN(pkg->ds), rpmdsEVR(pkg->ds), + (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); + rpmdsMerge(packageDependencies(pkg, RPMTAG_PROVIDENAME), ds); + rpmdsFree(ds); } - - if (!fc->skipReq) { - rpmds ds = rpmdsNew(pkg->header, RPMTAG_REQUIRENAME, 0); - rpmdsMerge(&fc->requires, ds); + if (!fc->skipReq && genConfigDeps) { + rpmds ds = rpmdsSingleNS(fc->pool, RPMTAG_REQUIRENAME, "config", + rpmdsN(pkg->ds), rpmdsEVR(pkg->ds), + (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); + rpmdsMerge(packageDependencies(pkg, RPMTAG_REQUIRENAME), ds); rpmdsFree(ds); - - headerDel(pkg->header, RPMTAG_REQUIRENAME); - headerDel(pkg->header, RPMTAG_REQUIREVERSION); - headerDel(pkg->header, RPMTAG_REQUIREFLAGS); - - /* Add config dependency, Requires: config(N) = EVR */ - if (genConfigDeps) { - ds = rpmdsSingleNS(RPMTAG_REQUIRENAME, "config", - rpmdsN(pkg->ds), rpmdsEVR(pkg->ds), - (RPMSENSE_EQUAL|RPMSENSE_CONFIG)); - rpmdsMerge(&fc->requires, ds); - rpmdsFree(ds); - } } /* Build file class dictionary. */ - rc = rpmfcClassify(fc, av, fmode); + rc = rpmfcClassify(fc, pkg->dpaths, fmode); if ( rc != RPMRC_OK ) goto exit; /* Build file/package dependency dictionary. */ rc = rpmfcApply(fc); - if ( rc != RPMRC_OK ) + if (rc != RPMRC_OK) goto exit; /* Add per-file colors(#files) */ @@ -1343,54 +1422,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg) /* Add per-file classes(#files) */ headerPutUint32(pkg->header, RPMTAG_FILECLASS, fc->fcdictx, fc->nfiles); - /* Add Provides: */ - if (!fc->skipProv) { - rpmds pi = rpmdsInit(fc->provides); - while (rpmdsNext(pi) >= 0) { - rpmsenseFlags flags = rpmdsFlags(pi); - - headerPutString(pkg->header, RPMTAG_PROVIDENAME, rpmdsN(pi)); - headerPutString(pkg->header, RPMTAG_PROVIDEVERSION, rpmdsEVR(pi)); - headerPutUint32(pkg->header, RPMTAG_PROVIDEFLAGS, &flags, 1); - } - } - - /* Add Requires: */ - if (!fc->skipReq) { - rpmds pi = rpmdsInit(fc->requires); - while (rpmdsNext(pi) >= 0) { - rpmsenseFlags flags = rpmdsFlags(pi); - - headerPutString(pkg->header, RPMTAG_REQUIRENAME, rpmdsN(pi)); - headerPutString(pkg->header, RPMTAG_REQUIREVERSION, rpmdsEVR(pi)); - headerPutUint32(pkg->header, RPMTAG_REQUIREFLAGS, &flags, 1); - } - } - - /* Add Supplements: */ - if (!fc->skipReq) { - rpmds pi = rpmdsInit(fc->supplements); - while (rpmdsNext(pi) >= 0) { - rpmsenseFlags flags = rpmdsFlags(pi); - - headerPutString(pkg->header, RPMTAG_ENHANCESNAME, rpmdsN(pi)); - headerPutString(pkg->header, RPMTAG_ENHANCESVERSION, rpmdsEVR(pi)); - headerPutUint32(pkg->header, RPMTAG_ENHANCESFLAGS, &flags, 1); - } - } - /* Add dependency dictionary(#dependencies) */ if (rpmtdFromArgi(&td, RPMTAG_DEPENDSDICT, fc->ddictx)) { headerPut(pkg->header, &td, HEADERPUT_DEFAULT); - } - /* Add per-file dependency (start,number) pairs (#files) */ - if (rpmtdFromArgi(&td, RPMTAG_FILEDEPENDSX, fc->fddictx)) { - headerPut(pkg->header, &td, HEADERPUT_DEFAULT); - } + /* Add per-file dependency (start,number) pairs (#files) */ + if (rpmtdFromArgi(&td, RPMTAG_FILEDEPENDSX, fc->fddictx)) { + headerPut(pkg->header, &td, HEADERPUT_DEFAULT); + } - if (rpmtdFromArgi(&td, RPMTAG_FILEDEPENDSN, fc->fddictn)) { - headerPut(pkg->header, &td, HEADERPUT_DEFAULT); + if (rpmtdFromArgi(&td, RPMTAG_FILEDEPENDSN, fc->fddictn)) { + headerPut(pkg->header, &td, HEADERPUT_DEFAULT); + } } @@ -1403,12 +1446,14 @@ rpmRC rpmfcGenerateDepends(const rpmSpec spec, Package pkg) free(msg); } exit: - printDeps(pkg->header); + printDeps(fc); /* Clean up. */ + if (fc) + fc->pkg = NULL; free(fmode); rpmfcFree(fc); - argvFree(av); + rpmfiFree(fi); return rc; } diff --git a/build/rpmfc.h b/build/rpmfc.h index a05fd0e..3d87b31 100644 --- a/build/rpmfc.h +++ b/build/rpmfc.h @@ -45,7 +45,6 @@ typedef const struct rpmfcTokens_s * rpmfcToken; /** \ingroup rpmfc * Print results of file classification. - * @todo Remove debugging routine. * @param msg message prefix (NULL for none) * @param fc file classifier * @param fp output file handle (NULL for stderr) @@ -107,12 +106,55 @@ rpmds rpmfcProvides(rpmfc fc); rpmds rpmfcRequires(rpmfc fc); /** \ingroup rpmfc + * Retrieve file classification recommends + * @param fc file classifier + * @return rpmds dependency set of fc recommends + */ +rpmds rpmfcRecommends(rpmfc fc); + +/** \ingroup rpmfc + * Retrieve file classification suggests + * @param fc file classifier + * @return rpmds dependency set of fc suggests + */ +rpmds rpmfcSuggests(rpmfc fc); + +/** \ingroup rpmfc * Retrieve file classification supplements * @param fc file classifier - * @return rpmds dependency set of fc requires + * @return rpmds dependency set of fc supplements */ rpmds rpmfcSupplements(rpmfc fc); +/** \ingroup rpmfc + * Retrieve file classification enhances + * @param fc file classifier + * @return rpmds dependency set of fc enhances + */ +rpmds rpmfcEnhances(rpmfc fc); + +/** \ingroup rpmfc + * Retrieve file classification conflicts + * @param fc file classifier + * @return rpmds dependency set of fc conflicts + */ +rpmds rpmfcConflicts(rpmfc fc); + +/** \ingroup rpmfc + * Retrieve file classification obsoletes + * @param fc file classifier + * @return rpmds dependency set of fc obsoletes + */ +rpmds rpmfcObsoletes(rpmfc fc); + +/** \ingroup rpmfc + * Retrieve file classification dependencies + * @param fc file classifier + * @param tagN name tag of the wanted dependency + * @return rpmds dependency set of fc requires + */ +rpmds rpmfcDependencies(rpmfc fc, rpmTagVal tagN); + #ifdef __cplusplus } #endif diff --git a/build/rpmspec.h b/build/rpmspec.h index 195fc72..164c9b6 100644 --- a/build/rpmspec.h +++ b/build/rpmspec.h @@ -36,6 +36,7 @@ enum rpmSpecFlags_e { RPMSPEC_ANYARCH = (1 << 0), RPMSPEC_FORCE = (1 << 1), RPMSPEC_NOLANG = (1 << 2), + RPMSPEC_NOUTF8 = (1 << 3), }; typedef rpmFlags rpmSpecFlags; @@ -55,6 +56,13 @@ rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter); /* Getters for spec package attributes */ Header rpmSpecPkgHeader(rpmSpecPkg pkg); +/* + * Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST, + * RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string. + */ +char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section); + + /* Iterator for spec sources */ rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec); rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter); diff --git a/build/spec.c b/build/spec.c index 4b6b680..39599e2 100644 --- a/build/spec.c +++ b/build/spec.c @@ -13,6 +13,7 @@ #include #include "rpmio/rpmlua.h" +#include "lib/rpmfi_internal.h" /* rpmfiles stuff */ #include "build/rpmbuild_internal.h" #include "debug.h" @@ -60,8 +61,8 @@ struct Source * freeSources(struct Source * s) rpmRC lookupPackage(rpmSpec spec, const char *name, int flag,Package *pkg) { - const char *pname; char *fullName = NULL; + rpmsid nameid = 0; Package p; /* "main" package */ @@ -71,46 +72,66 @@ rpmRC lookupPackage(rpmSpec spec, const char *name, int flag,Package *pkg) return RPMRC_OK; } - /* Construct package name */ - if (flag == PART_SUBNAME) { - pname = headerGetString(spec->packages->header, RPMTAG_NAME); - rasprintf(&fullName, "%s-%s", pname, name); - } else { - fullName = xstrdup(name); + /* Construct partial package name */ + if (!(flag & PART_NAME)) { + rasprintf(&fullName, "%s-%s", + headerGetString(spec->packages->header, RPMTAG_NAME), name); + name = fullName; } + nameid = rpmstrPoolId(spec->pool, name, 1); - /* Locate package with fullName */ + /* Locate package the name */ for (p = spec->packages; p != NULL; p = p->next) { - pname = headerGetString(p->header, RPMTAG_NAME); - if (pname && (rstreq(fullName, pname))) { + if (p->name && p->name == nameid) { break; } } - free(fullName); + + if (!(flag & PART_QUIET)) { + if (p == NULL && pkg != NULL) { + rpmlog(RPMLOG_ERR, _("line %d: %s: package %s does not exist\n"), + spec->lineNum, spec->line, name); + } else if (p != NULL && pkg == NULL) { + rpmlog(RPMLOG_ERR, _("line %d: %s: package %s already exists\n"), + spec->lineNum, spec->line, name); + } + } + + if (fullName == name) + free(fullName); if (pkg) *pkg = p; return ((p == NULL) ? RPMRC_FAIL : RPMRC_OK); } -Package newPackage(rpmSpec spec) +Package newPackage(const char *name, rpmstrPool pool, Package *pkglist) { Package p = xcalloc(1, sizeof(*p)); p->header = headerNew(); p->autoProv = 1; p->autoReq = 1; p->fileList = NULL; + p->fileExcludeList = NULL; p->fileFile = NULL; p->policyList = NULL; - - if (spec->packages == NULL) { - spec->packages = p; - } else { - Package pp; - /* Always add package to end of list */ - for (pp = spec->packages; pp->next != NULL; pp = pp->next) - {}; - pp->next = p; + p->fileRenameMap = NULL; + p->pool = rpmstrPoolLink(pool); + p->dpaths = NULL; + + if (name) + p->name = rpmstrPoolId(p->pool, name, 1); + + if (pkglist) { + if (*pkglist == NULL) { + *pkglist = p; + } else { + Package pp; + /* Always add package to end of list */ + for (pp = *pkglist; pp->next != NULL; pp = pp->next) + {}; + pp->next = p; + } } p->next = NULL; @@ -129,13 +150,25 @@ static Package freePackage(Package pkg) pkg->header = headerFree(pkg->header); pkg->ds = rpmdsFree(pkg->ds); + + for (int i=0; idependencies[i] = rpmdsFree(pkg->dependencies[i]); + } + pkg->fileList = argvFree(pkg->fileList); + pkg->fileExcludeList = argvFree(pkg->fileExcludeList); pkg->fileFile = argvFree(pkg->fileFile); pkg->policyList = argvFree(pkg->policyList); - pkg->cpioList = rpmfiFree(pkg->cpioList); + pkg->removePostfixes = argvFree(pkg->removePostfixes); + pkg->fileRenameMap = fileRenameHashFree(pkg->fileRenameMap); + pkg->cpioList = rpmfilesFree(pkg->cpioList); + pkg->dpaths = argvFree(pkg->dpaths); pkg->icon = freeSources(pkg->icon); pkg->triggerFiles = freeTriggerFiles(pkg->triggerFiles); + pkg->fileTriggerFiles = freeTriggerFiles(pkg->fileTriggerFiles); + pkg->transFileTriggerFiles = freeTriggerFiles(pkg->transFileTriggerFiles); + pkg->pool = rpmstrPoolFree(pkg->pool); free(pkg); return NULL; @@ -153,6 +186,21 @@ static Package freePackages(Package packages) return NULL; } +rpmds * packageDependencies(Package pkg, rpmTagVal tag) +{ + for (int i=0; idependencies[i] == NULL) { + return &pkg->dependencies[i]; + } + rpmTagVal tagN = rpmdsTagN(pkg->dependencies[i]); + if (tagN == tag || tagN == 0) { + return &pkg->dependencies[i]; + } + } + return NULL; +} + + rpmSpec newSpec(void) { rpmSpec spec = xcalloc(1, sizeof(*spec)); @@ -186,8 +234,7 @@ rpmSpec newSpec(void) spec->sourceRpmName = NULL; spec->sourcePkgId = NULL; - spec->sourceHeader = NULL; - spec->sourceCpioList = NULL; + spec->sourcePackage = NULL; spec->buildRoot = NULL; spec->buildSubdir = NULL; @@ -201,11 +248,14 @@ rpmSpec newSpec(void) spec->flags = RPMSPEC_NONE; spec->macros = rpmGlobalMacroContext; + spec->pool = rpmstrPoolCreate(); #ifdef WITH_LUA { /* make sure patches and sources tables always exist */ rpmlua lua = NULL; /* global state */ + rpmluaDelVar(lua, "patches"); + rpmluaDelVar(lua, "sources"); rpmluaPushTable(lua, "patches"); rpmluaPushTable(lua, "sources"); rpmluaPop(lua); @@ -243,8 +293,7 @@ rpmSpec rpmSpecFree(rpmSpec spec) spec->sourceRpmName = _free(spec->sourceRpmName); spec->sourcePkgId = _free(spec->sourcePkgId); - spec->sourceHeader = headerFree(spec->sourceHeader); - spec->sourceCpioList = rpmfiFree(spec->sourceCpioList); + spec->sourcePackage = freePackage(spec->sourcePackage); spec->buildRestrictions = headerFree(spec->buildRestrictions); @@ -266,6 +315,7 @@ rpmSpec rpmSpecFree(rpmSpec spec) spec->sources = freeSources(spec->sources); spec->packages = freePackages(spec->packages); + spec->pool = rpmstrPoolFree(spec->pool); spec = _free(spec); @@ -274,12 +324,12 @@ rpmSpec rpmSpecFree(rpmSpec spec) Header rpmSpecSourceHeader(rpmSpec spec) { - return spec->sourceHeader; + return (spec && spec->sourcePackage) ? spec->sourcePackage->header : NULL; } rpmds rpmSpecDS(rpmSpec spec, rpmTagVal tag) { - return (spec != NULL) ? rpmdsNew(spec->buildRestrictions, tag, 0) : NULL; + return (spec != NULL) ? rpmdsNew(spec->sourcePackage->header, tag, 0) : NULL; } rpmps rpmSpecCheckDeps(rpmts ts, rpmSpec spec) @@ -341,6 +391,18 @@ Header rpmSpecPkgHeader(rpmSpecPkg pkg) return (pkg != NULL) ? pkg->header : NULL; } +char* rpmSpecPkgGetSection(rpmSpecPkg pkg, int section) +{ + if (pkg) { + switch (section) { + case RPMBUILD_FILE_FILE: return argvJoin(pkg->fileFile, ""); + case RPMBUILD_FILE_LIST: return argvJoin(pkg->fileList, ""); + case RPMBUILD_POLICY: return argvJoin(pkg->policyList, ""); + } + } + return NULL; +} + rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec) { SPEC_LISTITER_INIT(rpmSpecSrcIter, sources); @@ -405,21 +467,20 @@ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) goto exit; } - if (qva->qva_source == RPMQV_SPECRPMS) { + if (qva->qva_source == RPMQV_SPECRPMS || + qva->qva_source == RPMQV_SPECBUILTRPMS) { + res = 0; for (Package pkg = spec->packages; pkg != NULL; pkg = pkg->next) { -#if 0 - /* - * XXX FIXME: whether to show all or just the packages that - * would be built needs to be made caller specifiable, for now - * revert to "traditional" behavior as existing tools rely on this. - */ - if (pkg->fileList == NULL) continue; -#endif + + if (qva->qva_source == RPMQV_SPECBUILTRPMS && pkg->fileList == NULL) + continue; + res += qva->qva_showPackage(qva, ts, pkg->header); } } else { - res = qva->qva_showPackage(qva, ts, spec->sourceHeader); + Package sourcePkg = spec->sourcePackage; + res = qva->qva_showPackage(qva, ts, sourcePkg->header); } exit: diff --git a/cliutils.c b/cliutils.c index 5edecc5..772a105 100644 --- a/cliutils.c +++ b/cliutils.c @@ -18,7 +18,7 @@ static pid_t pipeChild = 0; RPM_GNUC_NORETURN void argerror(const char * desc) { - fprintf(stderr, _("%s: %s\n"), __progname, desc); + fprintf(stderr, _("%s: %s\n"), xgetprogname(), desc); exit(EXIT_FAILURE); } @@ -55,7 +55,6 @@ int initPipe(void) } if (!(pipeChild = fork())) { - (void) signal(SIGPIPE, SIG_DFL); (void) close(p[1]); (void) dup2(p[0], STDIN_FILENO); (void) close(p[0]); diff --git a/cliutils.h b/cliutils.h index 35aa252..b5deee1 100644 --- a/cliutils.h +++ b/cliutils.h @@ -1,6 +1,11 @@ #ifndef _CLIUTIL_H #define _CLIUTIL_H +/** \file cliutils.h + * + * Misc helpers for RPM CLI tools + */ + #include #include #include diff --git a/compile b/compile new file mode 100755 index 0000000..a85b723 --- /dev/null +++ b/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2014 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/configure.ac b/configure.ac index 4199413..0c29311 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ AC_PREREQ(2.61) -AC_INIT(rpm, 4.11.0.1, rpm-maint@lists.rpm.org) +AC_INIT(rpm, 4.14.1, rpm-maint@lists.rpm.org) AC_CONFIG_SRCDIR([rpmqv.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.10 foreign tar-ustar dist-bzip2 subdir-objects nostdinc]) +AM_INIT_AUTOMAKE([1.10 foreign tar-pax dist-bzip2 subdir-objects nostdinc]) dnl Allow silent build on automake versions that support it m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) @@ -37,21 +37,24 @@ fi AS=${AS-as} AC_SUBST(AS) if test "$GCC" = yes; then - cflags_to_try="-fno-strict-aliasing -fstack-protector -Wempty-body" + cflags_to_try="-fno-strict-aliasing -fstack-protector-strong -Wempty-body" AC_MSG_CHECKING([supported compiler flags]) old_cflags=$CFLAGS echo for flag in $cflags_to_try; do CFLAGS="$CFLAGS $flag -Werror" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[return 0;]])],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[#include + alloca(100);]])],[ echo " $flag" RPMCFLAGS="$RPMCFLAGS $flag" ],[]) CFLAGS=$old_cflags done - CFLAGS="$CFLAGS -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes $RPMCFLAGS" + RPMCFLAGS="-fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes $RPMCFLAGS" + CFLAGS="$RPMCFLAGS" fi export CFLAGS +AC_SUBST(RPMCFLAGS) AC_SYS_LARGEFILE @@ -90,7 +93,7 @@ fi dnl dnl Find some common programs dnl -AC_PATH_PROG(__7ZIP, 7zip, /usr/bin/7za, $MYPATH) +AC_PATH_PROGS(__7ZIP, [7zip 7za 7z], /usr/bin/7za, $MYPATH) AC_PATH_PROG(__BZIP2, bzip2, /usr/bin/bzip2, $MYPATH) AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH) AC_PATH_PROG(__CHGRP, chgrp, /bin/chgrp, $MYPATH) @@ -100,7 +103,7 @@ AC_PATH_PROG(__CP, cp, /bin/cp, $MYPATH) AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH) AC_PATH_PROG(__CURL, curl, /usr/bin/curl, $MYPATH) AC_PATH_PROG(__FILE, file, /usr/bin/file, $MYPATH) -AC_PATH_PROG(__GPG, gpg, /usr/bin/gpg, $MYPATH) +AC_PATH_PROGS(__GPG, gpg2 gpg, /usr/bin/gpg2, $MYPATH) AC_PATH_PROG(__GREP, grep, /bin/grep, $MYPATH) AC_PATH_PROG(__GZIP, gzip, /bin/gzip, $MYPATH) AC_PATH_PROG(__UNZIP, unzip, /usr/bin/unzip, $MYPATH) @@ -109,6 +112,7 @@ AC_PATH_PROG(__INSTALL, install, /usr/bin/install, $MYPATH) AC_PATH_PROG(__LRZIP, lrzip, /usr/bin/lrzip, $MYPATH) AC_PATH_PROG(__LZIP, lzip, /usr/bin/lzip, $MYPATH) AC_PATH_PROG(__XZ, xz, /usr/bin/xz, $MYPATH) +AC_PATH_PROG(__GEM, gem, /usr/bin/gem, $MYPATH) AC_PATH_PROG(__MAKE, make, /usr/bin/make, $MYPATH) AC_PATH_PROG(__MKDIR, mkdir, /bin/mkdir, $MYPATH) AC_PATH_PROG(__MV, mv, /bin/mv, $MYPATH) @@ -134,6 +138,7 @@ AC_PATH_PROG(__SED, sed, /bin/sed, $MYPATH) AC_PATH_PROG(__SEMODULE, semodule, /usr/bin/semodule, $MYPATH) AC_PATH_PROG(__SSH, ssh, /usr/bin/ssh, $MYPATH) AC_PATH_PROG(__TAR, tar, /bin/tar, $MYPATH) +AC_PATH_PROG(__ZSTD, zstd, /usr/bin/zstd, $MYPATH) AC_PATH_PROG(__LD, ld, /usr/bin/ld, $MYPATH) AC_PATH_PROG(__NM, nm, /usr/bin/nm, $MYPATH) @@ -201,6 +206,31 @@ AC_CHECK_HEADERS([lzma.h],[ AC_SUBST(WITH_LZMA_LIB) #================= +# Check for zstd. + +AC_ARG_ENABLE([zstd], + [AS_HELP_STRING([--enable-zstd=@<:@yes/no/auto@:>@], + [build without zstd support (default=auto)])], + [enable_zstd="$enableval"], + [enable_zstd=auto]) + +AS_IF([test "x$enable_zstd" != "xno"], [ + PKG_CHECK_MODULES([ZSTD], [libzstd], [have_zstd=yes], [have_zstd=no]) + AS_IF([test "$enable_zstd" = "yes"], [ + if test "$have_zstd" = "no"; then + AC_MSG_ERROR([--enable-zstd specified, but not available]) + fi + ]) +]) + +if test "x$have_zstd" = "xyes"; then + AC_DEFINE([HAVE_ZSTD], [1], [Define if libzstd is available]) + ZSTD_REQUIRES=libzstd + AC_SUBST(ZSTD_REQUIRES) +fi +AM_CONDITIONAL([HAVE_ZSTD], [test "x$have_zstd" = "xyes"]) + +#================= dnl dnl Check for features @@ -243,18 +273,30 @@ AC_CHECK_HEADERS([dwarf.h], [ AM_CONDITIONAL(LIBDWARF,[test "$WITH_LIBDWARF" = yes]) #================= +# Select crypto library +AC_ARG_WITH(crypto, + [AC_HELP_STRING([--with-crypto=CRYPTO_LIB], + [The cryptographic library to use (nss|beecrypt|openssl). The default is nss.]) + ],[], + [with_crypto=nss]) + +# Refuse to proceed if someone specified --with-beecrypt (removed) +AC_ARG_WITH(beecrypt, + [AC_HELP_STRING([--with-beecrypt (OBSOLETE)], [Obsolete argument. Use --with-crypto=beecrypt]) + ],[AC_MSG_ERROR([--with-beecrypt no longer supported. Use --with-crypto=beecrypt])], + []) + # Check for beecrypt library if requested. -AC_ARG_WITH(beecrypt, [ --with-beecrypt build with beecrypt support ],,[with_beecrypt=no]) AC_ARG_WITH(internal_beecrypt, [ --with-internal-beecrypt build with internal beecrypt library ],,[with_internal_beecrypt=no]) AM_CONDITIONAL([WITH_INTERNAL_BEECRYPT],[test "$with_internal_beecrypt" = yes]) if test "$with_internal_beecrypt" = yes ; then - with_beecrypt=yes + with_crypto=beecrypt fi -AM_CONDITIONAL([WITH_BEECRYPT],[test "$with_beecrypt" = yes]) +AM_CONDITIONAL([WITH_BEECRYPT],[test "$with_crypto" = beecrypt]) WITH_BEECRYPT_INCLUDE= WITH_BEECRYPT_LIB= -if test "$with_beecrypt" = yes ; then +if test "$with_crypto" = beecrypt ; then AC_DEFINE(WITH_BEECRYPT, 1, [Build with beecrypt instead of nss3 support?]) if test "$with_internal_beecrypt" = yes ; then WITH_BEECRYPT_INCLUDE="-I\$(top_srcdir)/beecrypt" @@ -263,7 +305,7 @@ if test "$with_beecrypt" = yes ; then AC_CHECK_LIB(beecrypt, mpfprintln, [ WITH_BEECRYPT_LIB="-lbeecrypt" ],[ - AC_MSG_ERROR([missing required library 'beecrypt']) + AC_MSG_ERROR([missing required library 'beecrypt']) ]) AC_CHECK_HEADER([beecrypt/api.h], [AC_DEFINE(HAVE_BEECRYPT_API_H, 1, [Define to 1 if you have the header file.]) ]) @@ -273,13 +315,100 @@ AC_SUBST(WITH_BEECRYPT_LIB) AC_SUBST(WITH_BEECRYPT_INCLUDE) #================= +# Check for OpenSSL library. +# We need evp.h from OpenSSL. + +WITH_OPENSSL_INCLUDE= +WITH_OPENSSL_LIB= +if test "$with_crypto" = openssl; then +# If we have pkgconfig make sure CPPFLAGS are setup correctly for the OpenSSL +# -I include path. +AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], [$PATH:/usr/bin:/usr/local/bin]) +if test "x$PKGCONFIG" != "xno"; then + CPPFLAGS="$CPPFLAGS $($PKGCONFIG --cflags libcrypto)" + WITH_OPENSSL_LIB=$($PKGCONFIG --libs libcrypto) +else + WITH_OPENSSL_LIB=-lcrypto +fi + +AC_CHECK_HEADERS([openssl/evp.h], [], [ + AC_MSG_ERROR([missing required OpenSSL header]) +]) +AC_CHECK_HEADERS([openssl/rsa.h], [], [ + AC_MSG_ERROR([missing required OpenSSL header]) +]) +AC_CHECK_HEADERS([openssl/dsa.h], [], [ + AC_MSG_ERROR([missing required OpenSSL header]) +]) + +AC_CHECK_LIB(crypto, EVP_DigestInit_ex, [], [ + AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old]) +]) + +AC_CHECK_LIB(crypto, EVP_MD_CTX_new, [ + AC_DEFINE(HAVE_EVP_MD_CTX_NEW, 1, [Define to 1 if OpenSSL has EVP_MD_CTX_new]) + AC_SUBST(HAVE_EVP_MD_CTX_NEW, [1]) + ], [ + AC_CHECK_LIB(crypto, EVP_MD_CTX_create, [], [ + AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old]) + ]) +]) + +AC_CHECK_LIB(crypto, EVP_PKEY_CTX_new, [], [ + AC_MSG_ERROR([required OpenSSL library 'libcrypto' missing or too old]) +]) + +AC_CHECK_LIB(crypto, DSA_set0_key, [ + AC_DEFINE(HAVE_DSA_SET0_KEY, 1, [Define to 1 if OpenSSL has DSA_set0_key]) + AC_SUBST(HAVE_DSA_SET0_KEY, [1]) + ], [] +) + +AC_CHECK_LIB(crypto, DSA_set0_pqg, [ + AC_DEFINE(HAVE_DSA_SET0_PQG, 1, [Define to 1 if OpenSSL has DSA_set0_pqg]) + AC_SUBST(HAVE_DSA_SET0_PQG, [1]) + ], [] +) + +AC_CHECK_LIB(crypto, DSA_SIG_set0, [ + AC_DEFINE(HAVE_DSA_SIG_SET0, 1, [Define to 1 if OpenSSL has DSA_SIG_set0]) + AC_SUBST(HAVE_DSA_SIG_SET0, [1]) + ], [] +) + +AC_CHECK_LIB(crypto, RSA_set0_key, [ + AC_DEFINE(HAVE_RSA_SET0_KEY, 1, [Define to 1 if OpenSSL has RSA_set0_key]) + AC_SUBST(HAVE_RSA_SET0_KEY, [1]) + ], [] +) + +AC_CHECK_LIB(crypto, BN_bn2binpad, [ + AC_DEFINE(HAVE_BN2BINPAD, 1, [Define to 1 if OpenSSL has BN_bn2binpad]) + AC_SUBST(HAVE_BN2BINPAD, [1]) + ], [] +) + +fi + +AM_CONDITIONAL([WITH_OPENSSL],[test "$with_crypto" = openssl]) +AC_SUBST(WITH_OPENSSL_INCLUDE) +AC_SUBST(WITH_OPENSSL_LIB) + +#================= # Check for NSS library. -# We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS -# have a header named nss.h... so make extra check for NSS's sechash.h +# We need nss.h from NSS which needs nspr.h. Unfortunately both glibc and NSS +# have a header named nss.h... so make extra check for NSS's sechash.h # which we use too and hopefully is slightly more unique to NSS. WITH_NSS_INCLUDE= WITH_NSS_LIB= -if test "$with_beecrypt" != yes ; then +if test "$with_crypto" = nss; then +# If we have pkgconfig make sure CPPFLAGS are setup correctly for the nss +# -I include path. Otherwise the below checks will fail because nspr.h +# cannot be found. +AC_PATH_TOOL([PKGCONFIG], [pkg-config], [no], [$PATH:/usr/bin:/usr/local/bin]) +if test "x$PKGCONFIG" != "xno"; then + CPPFLAGS="$CPPFLAGS $($PKGCONFIG --cflags nss)" +fi AC_CHECK_HEADERS([nspr.h nss.h sechash.h], [], [ AC_MSG_ERROR([missing required NSPR / NSS header]) ]) @@ -335,6 +464,53 @@ AC_SUBST(WITH_POPT_INCLUDE) AC_SUBST(WITH_POPT_LIB) #================= +# Check for libarchive library. +AC_ARG_WITH([archive], [AS_HELP_STRING([--with-archive], [build rpm2archive - requires libarchive])], + [], + [with_archive=yes]) + +WITH_ARCHIVE_INCLUDE= +WITH_ARCHIVE_LIB= +AS_IF([test "$with_archive" != no],[ + AC_CHECK_HEADER([archive.h], [ + AC_CHECK_LIB(archive, archive_write_open_filename, [ + WITH_ARCHIVE_INCLUDE= + WITH_ARCHIVE_LIB="-larchive" + ],[ + AC_MSG_ERROR([missing required library 'libarchive']) + ]) +],[ + AC_MSG_ERROR([missing required header archive.h]) + ]) +]) + +AC_SUBST(WITH_ARCHIVE_INCLUDE) +AC_SUBST(WITH_ARCHIVE_LIB) +AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes]) + +#================= +# Check for elfutils libdw library with dwelf_elf_gnu_build_id. +WITH_LIBDW_LIB= +HAVE_LIBDW_STRTAB= +AS_IF([test "$WITH_LIBELF" = yes],[ + AC_CHECK_HEADERS([elfutils/libdwelf.h],[ + # dwelf_elf_gnu_build_id was introduced in elfutils 0.159 + AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [ + AC_DEFINE(HAVE_LIBDW, 1, + [Define to 1 if you have elfutils libdw library]) + WITH_LIBDW_LIB="-ldw" + WITH_LIBDW=yes + # If possible we also want the strtab functions from elfutils 0.167. + # But we can fall back on the (unsupported) ebl alternatives if not. + AC_CHECK_LIB(dw, dwelf_strtab_init, [HAVE_LIBDW_STRTAB=yes]) + ]) + ]) +]) +AC_SUBST(WITH_LIBDW_LIB) +AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes]) +AM_CONDITIONAL(HAVE_LIBDW_STRTAB,[test "$HAVE_LIBDW_STRTAB" = yes]) + +#================= # Process --with/without-external-db AC_ARG_WITH(external_db, [AS_HELP_STRING([--with-external-db],[build against an external Berkeley db])], [case "$with_external_db" in @@ -360,23 +536,95 @@ yes ) AC_MSG_ERROR([missing required header db.h]) ]) ;; -* ) # Fall back to internal db if available +no|maybe ) + # Try internal database first, then fall back to external + # unless --without-external-db (no) was explicitly given. if [ test -x db/dist/configure ]; then AC_DEFINE(HAVE_DB_H, 1, [Define if you have the header file]) else - AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL]) + case "$with_external_db" in + maybe) + AC_CHECK_HEADERS([db.h],[ + AC_PREPROC_IFELSE([ + AC_LANG_SOURCE([ + #include + #if ((DB_VERSION_MAJOR < 4) || (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR < 5)) + #error Berkeley DB too old + #endif + ]) + ],[ WITH_DB_LIB=-ldb ], + [ AC_MSG_ERROR([Berkeley DB version >= 4.5 required]) + ]) + ],[ + AC_MSG_ERROR([missing required header db.h]) + ]) + ;; + no) + AC_MSG_ERROR([internal Berkeley DB directory not present, see INSTALL]) + ;; + esac fi ;; esac AC_SUBST([WITH_DB_LIB]) +#================= +# Process --enable-ndb +AC_ARG_ENABLE([ndb], [AS_HELP_STRING([--enable-ndb (EXPERIMENTAL)],[enable the new rpm database format])], +[case "$enable_ndb" in +yes|no) ;; +*) AC_MSG_ERROR([invalid argument to --enable-ndb]) + ;; +esac], +[enable_ndb=no]) +AS_IF([test "$enable_ndb" = yes],[ + AC_CHECK_FUNCS([mremap], + [AC_DEFINE(ENABLE_NDB, 1, [Enable new rpm database format?])], + [AC_MSG_ERROR([mremap function required by ndb])], + [#include ]) +]) +AM_CONDITIONAL([NDB], [test "$enable_ndb" = yes]) + +#================= +# Check for LMDB support +AC_ARG_ENABLE([lmdb], + [AS_HELP_STRING([--enable-lmdb=@<:@yes/no/auto@:>@ (EXPERIMENTAL)], + [build with LMDB rpm database format support (default=auto)])], + [enable_lmdb="$enableval"], + [enable_lmdb=auto]) + +AS_IF([test "x$enable_lmdb" != "xno"], [ + PKG_CHECK_MODULES([LMDB], [lmdb], [have_lmdb=yes], [have_lmdb=no]) + AS_IF([test "$enable_lmdb" = "yes"], [ + if test "$have_lmdb" = "no"; then + AC_MSG_ERROR([--enable-lmdb specified, but not available]) + fi + ]) +]) + +if test "x$have_lmdb" = "xyes"; then + AC_DEFINE([WITH_LMDB], [1], [Define if LMDB is available]) + LMDB_REQUIRES=lmdb + AC_SUBST(LMDB_REQUIRES) +fi +AM_CONDITIONAL([LMDB], [test "x$have_lmdb" = "xyes"]) + AM_GNU_GETTEXT_VERSION([0.16.1]) AM_GNU_GETTEXT([external]) +AM_ICONV dnl Checks for header files we can live without. AC_HEADER_STDC +dnl glibc and autoconf don't really play well together. +dnl glibc will produce a warning when including the wrong header. +dnl but still define major and minor. Causing us to include the header +dnl that produces a giant warning for each major/minor use. +dnl Use -Werror to work around that. +old_CFLAGS=$CFLAGS +CFLAGS="$CFLAGS -Werror" AC_HEADER_MAJOR +CFLAGS=$old_CFLAGS AC_STRUCT_DIRENT_D_TYPE AC_CHECK_HEADERS(limits.h) @@ -386,6 +634,7 @@ AC_CHECK_HEADERS(sys/utsname.h) AC_CHECK_HEADERS(sys/systemcfg.h) AC_CHECK_HEADERS(sys/param.h) +AC_CHECK_HEADERS(sys/auxv.h) dnl statfs portability fiddles. dnl @@ -400,25 +649,25 @@ dnl found_struct_statfs=no if test X$found_struct_statfs = Xno ; then -dnl first try including sys/vfs.h +dnl Solaris 2.6+ wants to use statvfs AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif -#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) - AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)]) +#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) + AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, + [statfs in (for solaris 2.6+ systems)]) found_struct_statfs=yes],[]) fi if test X$found_struct_statfs = Xno ; then -dnl Solaris 2.6+ wants to use statvfs +dnl first try including sys/vfs.h AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef HAVE_SYS_TYPES_H #include #endif -#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h) - AC_DEFINE(STATFS_IN_SYS_STATVFS, 1, - [statfs in (for solaris 2.6+ systems)]) +#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h) + AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)]) found_struct_statfs=yes],[]) fi @@ -518,13 +767,26 @@ 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) +AC_CHECK_FUNCS(setprogname, [], [], [#include ]) + +AC_MSG_CHECKING([whether __progname is defined]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([extern const char *__progname;], + [if (*__progname == 0) return 0;])], + AC_DEFINE([HAVE___PROGNAME], [1], [Define if __progname is defined]) + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no])) AC_REPLACE_FUNCS(stpcpy stpncpy) AC_CHECK_FUNCS([secure_getenv __secure_getenv]) AC_CHECK_FUNCS( - [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown], + [mkstemp getcwd basename dirname realpath setenv unsetenv regcomp lchown \ + utimes getline], [], [AC_MSG_ERROR([function required by rpm])]) AC_LIBOBJ(fnmatch) @@ -538,32 +800,15 @@ yes|no) ;; esac], [enable_python=no]) +WITH_PYTHON_SUBPACKAGE=0 AS_IF([test "$enable_python" = yes],[ AM_PATH_PYTHON([2.6],[ - WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'` - WITH_PYTHON_SUBPACKAGE=1 - save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE" - AC_CHECK_HEADER([Python.h],[], - [AC_MSG_ERROR([missing Python.h]) - ]) - CPPFLAGS="$save_CPPFLAGS" - save_LIBS="$LIBS" - AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[ - WITH_PYTHON_LIB="$ac_res" - ],[AC_MSG_ERROR([missing python library]) - ]) - LIBS="$save_LIBS" + PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}], [WITH_PYTHON_SUBPACKAGE=1]) + AC_SUBST(PYTHON_CFLAGS) + AC_SUBST(PYTHON_LIB) ]) -],[ - WITH_PYTHON_INCLUDE= - WITH_PYTHON_LIB= - WITH_PYTHON_SUBPACKAGE=0 ]) -AC_SUBST(WITH_PYTHON_INCLUDE) -AC_SUBST(WITH_PYTHON_LIB) - AM_CONDITIONAL(ENABLE_PYTHON,[test "$WITH_PYTHON_SUBPACKAGE" = 1]) AC_PATH_PROG(DOXYGEN, doxygen, no) @@ -601,6 +846,8 @@ AS_IF([test "$with_selinux" = yes],[ AC_MSG_ERROR([--with-selinux given, but selinux_getpolicytype not found in libselinux])]) AC_CHECK_LIB([selinux],[selinux_reset_config],[],[ AC_MSG_ERROR([--with-selinux given, but selinux_reset_config not found in libselinux])]) + AC_CHECK_LIB([selinux],[setexecfilecon],[ + AC_DEFINE([HAVE_SETEXECFILECON],[1],[Define to 1 if SELinux setexecfilecon is present])]) LIBS="$save_LIBS" ],[ AC_MSG_ERROR([--with-selinux given, but selinux/selinux.h not found]) @@ -618,48 +865,11 @@ AS_IF([test "$with_selinux" = yes],[ ],[ AC_MSG_ERROR([--with-selinux given, but selinux/label.h not found]) ]) - - dnl FIXME: semanage is only needed for the sepolicy plugin - AC_CHECK_HEADER([semanage/semanage.h],[ - save_LIBS="$LIBS" - AC_CHECK_LIB([semanage],[semanage_begin_transaction],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_begin_transaction missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_commit],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_commit missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_connect],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_connect missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_disconnect],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_disconnect missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_handle_create],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_handle_create missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_handle_destroy],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_handle_destroy missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_is_connected],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_is_connected missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_module_install_base_file],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_module_install_base_file missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_module_install_file],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_module_install_file missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_module_remove],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_module_remove missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_select_store],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_select_store missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_set_check_contexts],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_set_check_contexts missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_set_create_store],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_set_create_store missing in libsemanage])]) - AC_CHECK_LIB([semanage],[semanage_set_reload],[],[ - AC_MSG_ERROR([--with-selinux given, but semanage_set_reload missing in libsemanage])]) - LIBS="$save_LIBS" - ],[ - AC_MSG_ERROR([--with-selinux given, but semanage/semanage.h not found]) - ]) ]) AS_IF([test "$with_selinux" = yes],[ AC_DEFINE(WITH_SELINUX, 1, [Build with selinux support?]) WITH_SELINUX_LIB="-lselinux" - WITH_SEMANAGE_LIB="-lsemanage" ]) AC_SUBST(WITH_SELINUX_LIB) AC_SUBST(WITH_SEMANAGE_LIB) @@ -729,6 +939,27 @@ AC_SUBST(WITH_MSM_LIB) AC_SUBST(WITH_MSM_INCLUDE) AM_CONDITIONAL(MSM,[test "$with_msm" = yes]) + +# libimaevm +with_iamevm=no +AC_ARG_WITH(imaevm, [AS_HELP_STRING([--with-imaevm],[build with imaevm support])]) +if test "$with_imaevm" = yes ; then + AC_MSG_CHECKING([libimaevm >= 1.0]) + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[return sign_hash(NULL, NULL, 0, NULL, NULL, NULL);]] + )], + [AC_MSG_RESULT(yes) + AC_DEFINE(WITH_IMAEVM, 1, [Build with imaevm support?]) + WITH_IMAEVM_LIB="-limaevm" + ], + [AC_MSG_ERROR([libimaevm not present or too old (< 1.0)])] + ) +fi +AM_CONDITIONAL(WITH_IMAEVM,[test "$with_imaevm" = yes]) +AC_SUBST(WITH_IMAEVM_LIB) + # libcap WITH_CAP_LIB= AC_ARG_WITH(cap, [AS_HELP_STRING([--with-cap],[build with capability support])], @@ -808,6 +1039,21 @@ AS_IF([test "$enable_plugins" = yes],[ ]) AM_CONDITIONAL(ENABLE_PLUGINS,[test "$enable_plugins" = yes]) +with_dbus=no +AS_IF([test "$enable_plugins" != no],[ + PKG_CHECK_MODULES([DBUS], + [dbus-1 >= 1.3], + [AC_DEFINE(DBUS, 1, [Build with dbus support?]) with_dbus=yes], + [with_dbus=no]) + AC_SUBST(DBUS_CFLAGS) + AC_SUBST(DBUS_LIBS) +]) +AM_CONDITIONAL(DBUS, [test "$with_dbus" = yes]) + +AS_IF([test "$enable_plugins" != no],[ + AC_CHECK_FUNCS(lsetxattr, [], [], [#include ]) +]) +AM_CONDITIONAL(IMA, [test "x$ac_cv_func_lsetxattr" = xyes]) with_dmalloc=no AC_ARG_WITH(dmalloc, [AS_HELP_STRING([--with-dmalloc],[build with dmalloc debugging support])]) @@ -816,7 +1062,10 @@ if test "$with_dmalloc" = yes ; then LIBS="$LIBS -ldmalloc" fi -AC_CHECK_FUNCS(getpassphrase) +user_with_uid0=$(awk -F: '$3==0 {print $1;exit}' /etc/passwd) +group_with_gid0=$(awk -F: '$3==0 {print $1;exit}' /etc/group) +AC_DEFINE_UNQUOTED([UID_0_USER],["$user_with_uid0"],[Get the user name having userid 0]) +AC_DEFINE_UNQUOTED([GID_0_GROUP],["$group_with_gid0"],[Get the group name having groupid 0]) # # get rid of the 4-th tuple, if config.guess returned "linux-gnu" for host_os @@ -884,6 +1133,13 @@ AC_SUBST(RPMCANONVENDOR) AC_SUBST(RPMCANONOS) AC_SUBST(RPMCANONGNU) +RUNDIR="/run" +AC_ARG_WITH([rundir], + AS_HELP_STRING([--with-rundir=RUNDIR], [specify run-time variable directory]), + [RUNDIR=$withval]) +AC_DEFINE_UNQUOTED([RUNDIR],["${RUNDIR}"],[run-time variable directory]) +AC_SUBST(RUNDIR) + if test X"$prefix" = XNONE ; then usrprefix="$ac_default_prefix" else diff --git a/doc/Makefile.am b/doc/Makefile.am index 3921f24..d2f520d 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,8 +7,9 @@ man_man1_DATA = gendiff.1 EXTRA_DIST += $(man_man1_DATA) man_man8dir = $(mandir)/man8 -man_man8_DATA = rpm.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 -man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmqpack.8 +man_man8_DATA = rpm.8 rpm-misc.8 rpmbuild.8 rpmdeps.8 rpmgraph.8 rpm2cpio.8 +man_man8_DATA += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 +man_man8_DATA += rpm-plugin-systemd-inhibit.8 EXTRA_DIST += $(man_man8_DATA) man_fr_man8dir = $(mandir)/fr/man8 diff --git a/doc/hacking.doxy.in b/doc/hacking.doxy.in index 257aae6..728415a 100644 --- a/doc/hacking.doxy.in +++ b/doc/hacking.doxy.in @@ -1,463 +1,759 @@ -# Doxyfile 1.5.2 +# Doxyfile 1.8.8 # This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project +# doxygen (www.doxygen.org) for a project. # -# All text after a hash (#) is considered a comment and will be ignored +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. # The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file that -# follow. The default is UTF-8 which is also the encoding used for all text before -# the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into -# libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of -# possible encodings. +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. PROJECT_NAME = @PACKAGE@ -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. PROJECT_NUMBER = @VERSION@ -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. OUTPUT_DIRECTORY = doc/hacking -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. CREATE_SUBDIRS = NO -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, -# Italian, Japanese, Japanese-en (Japanese with English messages), Korean, -# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, -# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. +# The default value is: YES. REPEAT_BRIEF = YES -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief # description. +# The default value is: NO. ALWAYS_DETAILED_SEC = NO -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. +# The default value is: NO. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. FULL_PATH_NAMES = YES -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = @top_srcdir@/ -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. JAVADOC_AUTOBRIEF = YES -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. -ALIASES = +TCL_SUBST = -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to -# include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. +# The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. +# The default value is: NO. CPP_CLI_SUPPORT = NO -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. +# The default value is: NO. DISTRIBUTE_GROUP_DOC = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. SUBGROUPING = YES +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. EXTRACT_ALL = YES -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. EXTRACT_LOCAL_METHODS = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. INTERNAL_DOCS = YES -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. +# The default value is: system dependent. CASE_SENSE_NAMES = YES -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. HIDE_SCOPE_NAMES = NO -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. SHOW_INCLUDE_FILES = YES -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. SORT_MEMBER_DOCS = YES -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. SORT_BRIEF_DOCS = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. SORT_BY_SCOPE_NAME = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. GENERATE_TESTLIST = YES -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. SHOW_USED_FILES = YES -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES -SHOW_DIRECTORIES = NO +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from the -# version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. +SHOW_NAMESPACES = YES -FILE_VERSION_FILTER = +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. QUIET = NO -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. WARN_IF_DOC_ERROR = YES -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. WARN_NO_PARAMDOC = NO -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). -WARN_LOGFILE = +WARN_LOGFILE = #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. -INPUT = @top_srcdir@/doc/hacking/Doxyheader \ - @top_srcdir@/build.c \ - @top_srcdir@/build.h \ +INPUT = @top_srcdir@/doc/hacking/Doxyheader.h \ @top_srcdir@/config.h \ @top_srcdir@/debug.h \ @top_srcdir@/macros \ @@ -465,6 +761,12 @@ INPUT = @top_srcdir@/doc/hacking/Doxyheader \ @top_srcdir@/rpmpopt-@VERSION@ \ @top_srcdir@/rpmrc \ @top_srcdir@/rpm2cpio.c \ + @top_srcdir@/rpm2archive.c \ + @top_srcdir@/rpmbuild.c \ + @top_srcdir@/rpmdb.c \ + @top_srcdir@/rpmkeys.c \ + @top_srcdir@/rpmsign.c \ + @top_srcdir@/rpmspec.c \ @top_srcdir@/system.h \ @top_srcdir@/build/ \ @top_srcdir@/doc/manual/builddependencies \ @@ -483,800 +785,1583 @@ INPUT = @top_srcdir@/doc/hacking/Doxyheader \ @top_srcdir@/doc/manual/tsort \ @top_srcdir@/lib/ \ @top_srcdir@/lua/ \ - @top_srcdir@/rpmdb/ \ @top_srcdir@/rpmio/ \ @top_srcdir@/python/ \ @top_srcdir@/tools/ -# This tag can be used to specify the character encoding of the source files that -# doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default -# input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. -# See http://www.gnu.org/software/libiconv for the list of possible encodings. +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. INPUT_ENCODING = UTF-8 -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. FILE_PATTERNS = *.c \ *.h -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. RECURSIVE = NO -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. -EXCLUDE = @top_srcdir@/db @top_srcdir@/db.h +EXCLUDE = @top_srcdir@/db \ + @top_srcdir@/db.h -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded # from the input. +# The default value is: NO. EXCLUDE_SYMLINKS = NO -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* -EXCLUDE_PATTERNS = +EXCLUDE_PATTERNS = -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the output. -# The symbol name can be a fully qualified name, a word, or if the wildcard * is used, -# a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). EXAMPLE_PATH = @top_srcdir@/doc/manual -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). -IMAGE_PATH = +IMAGE_PATH = -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. -INPUT_FILTER = +INPUT_FILTER = -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. -FILTER_PATTERNS = +FILTER_PATTERNS = -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. FILTER_SOURCE_FILES = NO +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. REFERENCED_BY_RELATION = YES -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. REFERENCES_RELATION = YES -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentstion. +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. REFERENCES_LINK_SOURCE = YES -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. ALPHABETICAL_INDEX = NO -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -IGNORE_PREFIX = +IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: NO. GENERATE_HTML = YES -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a # standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +GENERATE_HTMLHELP = NO -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HTML_FOOTER = +CHM_FILE = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HTML_STYLESHEET = +HHC_LOCATION = -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HTML_ALIGN_MEMBERS = YES +GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -GENERATE_HTMLHELP = NO +CHM_INDEX_ENCODING = -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_FILE = +BINARY_TOC = NO -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +TOC_EXPAND = NO -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_CHI = NO +DISABLE_INDEX = NO -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. -BINARY_TOC = NO +GENERATE_TREEVIEW = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. -TOC_EXPAND = NO +ENUM_VALUES_PER_LINE = 4 -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. -DISABLE_INDEX = NO +TREEVIEW_WIDTH = 250 -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. -ENUM_VALUES_PER_LINE = 4 +EXT_LINKS_IN_WINDOW = NO -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. -GENERATE_TREEVIEW = NO +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /