Commit 2b8c3ad6 authored by Michal Čihař's avatar Michal Čihař

Imported Upstream version 4.11.1

parent 40417e64
......@@ -508,7 +508,7 @@
- use rpmfiFClass() underneath --fileclass.
- use rpmfiFDepends() underneath --fileprovide and --filerequire.
- python: add fi.FColor() and fi.FClass() methods.
- calculate dependency color and refernces.
- calculate dependency color and references.
- python: add ds.Color() and ds.Refs() methods.
- fix: typo in assertion.
- add rpmts/rpmte/rpmfi/rpmds element colors.
......@@ -656,7 +656,7 @@
- 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.
- rework most of rpmdb.c preparatory to implementing duplicates.
- fix: 2 memory leaks in headerSprintf.
- fix: db mire's access out-of-bounds memory.
- plug install mode leaks.
......@@ -958,7 +958,7 @@
- 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: i18n strings need 1 on success 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.
......@@ -1054,7 +1054,7 @@
- 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.
- package version now configurable, 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.
......@@ -1095,7 +1095,7 @@
- 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.
- fix: diddle dbenv path to accommodate 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.
......@@ -1521,7 +1521,7 @@
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).
- fix: don't remove file until last occurrence 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).
......@@ -1987,7 +1987,7 @@
- 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
- fixed memory leak in install code which occurred when net shared paths
were used
- don't pass net shared path to rpmInstallPackage() -- it looks
directly in the rpmrc entries
......@@ -2314,7 +2314,7 @@
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 <file> and %doc
- fix anomaly with %files -f <file> 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
......@@ -2392,7 +2392,7 @@
- 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)
(in preparation 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
......@@ -2403,7 +2403,7 @@
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
we never used it and it just wasted room
- convert uid/gid lists in v1 headers to symbolic names
2.3.3 -> 2.3.4:
......
This diff is collapsed.
......@@ -77,7 +77,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/
......@@ -164,7 +164,7 @@ and then install with:
Rpm comes with an automated self-test suite. The test-suite relies heavily
on fakechroot (https://github.com/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 +186,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 +208,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 +231,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
......
......@@ -184,13 +184,13 @@ 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
noinst_DATA += platform
platform: $(top_srcdir)/platform.in
@$(SED) \
-e "s,[@]RPMCONFIGDIR[@],$(rpmconfigdir),g" \
......@@ -232,7 +232,7 @@ install-exec-hook:
install-data-local:
DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
$(SHELL) $(top_srcdir)/installplatform \
rpmrc platform \
rpmrc platform macros \
$(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU)
@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
......@@ -241,6 +241,7 @@ uninstall-local:
@rm -f $(DESTDIR)$(bindir)/rpmquery
@rm -f $(DESTDIR)$(bindir)/rpmverify
@rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
@rm -f $(DESTDIR)$(rpmconfigdir)/macros
MAINTAINERCLEANFILES = ChangeLog
......
......@@ -641,8 +641,8 @@ rpmdeps_LDADD = lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_
rpmgraph_SOURCES = tools/rpmgraph.c
rpmgraph_LDADD = lib/librpm.la rpmio/librpmio.la @WITH_POPT_LIB@
dist_bin_SCRIPTS = scripts/gendiff
rpmconfig_DATA = rpmrc macros rpmpopt-$(VERSION)
noinst_DATA = platform $(am__append_8) $(am__append_9)
rpmconfig_DATA = rpmrc rpmpopt-$(VERSION)
noinst_DATA = macros platform $(am__append_8) $(am__append_9)
pkgconfig_DATA = rpm.pc
usrsrcdir = $(prefix)/src
rpmvardir = $(localstatedir)/lib/rpm
......@@ -1742,7 +1742,7 @@ install-exec-hook:
install-data-local:
DESTDIR="$(DESTDIR)" pkglibdir="$(rpmconfigdir)" \
$(SHELL) $(top_srcdir)/installplatform \
rpmrc platform \
rpmrc platform macros \
$(RPMCANONVENDOR) $(RPMCANONOS) $(RPMCANONGNU)
@$(MKDIR_P) $(DESTDIR)$(localstatedir)/tmp
......@@ -1751,6 +1751,7 @@ uninstall-local:
@rm -f $(DESTDIR)$(bindir)/rpmquery
@rm -f $(DESTDIR)$(bindir)/rpmverify
@rm -rf $(DESTDIR)$(rpmconfigdir)/platform/
@rm -f $(DESTDIR)$(rpmconfigdir)/macros
# Build hacking docs only on request
@DOXYGEN_TRUE@@HACKINGDOCS_TRUE@doc/hacking.doxy: doc/hacking.doxy.in doc/hacking/Doxyheader Makefile.am
......
#!/bin/sh
# note this works for both a.out and ELF executables
# it also auto-generates requirment lines for shell scripts
# it also auto-generates requirement lines for shell scripts
ulimit -c 0
......
......@@ -70,7 +70,7 @@ do
FS = " ";
RS = "\n";
# This flag signfies that we have seen the internal name:
# This flag signifies 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
......
......@@ -55,7 +55,7 @@ while read f
do
#
# Uncomment the next line for addtional debugging:
# Uncomment the next line for additional debugging:
# echo "read ->$f<-"
#
......
......@@ -16,7 +16,7 @@ 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 5:0:2
librpmbuild_la_LIBADD = \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
......
......@@ -400,7 +400,7 @@ 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 5:0:2
librpmbuild_la_LIBADD = \
$(top_builddir)/lib/librpm.la \
$(top_builddir)/rpmio/librpmio.la \
......
......@@ -142,6 +142,7 @@ typedef struct FileRecords_s {
typedef struct FileList_s {
/* global filelist state */
char * buildRoot;
size_t buildRootLen;
int processingFailed;
int haveCaps;
int largeFiles;
......@@ -945,8 +946,7 @@ static int seenHardLink(FileRecords files, FileListRec flp, rpm_ino_t *fileid)
* @param h
* @param isSrc
*/
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;
......@@ -957,6 +957,7 @@ static void genCpioListAndHeader(FileList fl,
int i;
uint32_t defaultalgo = PGPHASHALGO_MD5, digestalgo;
rpm_loff_t totalFileSize = 0;
Header h = pkg->header; /* just a shortcut */
/*
* See if non-md5 file digest algorithm is requested. If not
......@@ -1126,7 +1127,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);
......@@ -1163,15 +1164,15 @@ 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");
(void) rpmlibNeedsFeature(pkg, "PayloadFilesHavePrefix", "4.0-1");
{
struct rpmtd_s filenames;
......@@ -1217,7 +1218,7 @@ static void genCpioListAndHeader(FileList fl,
a++; /* skip apath NUL */
}
fi->apath = apath;
*fip = fi;
pkg->cpioList = fi;
rpmtdFreeData(&filenames);
}
......@@ -1225,7 +1226,7 @@ static void genCpioListAndHeader(FileList fl,
if (!(fl->pkgFlags & RPMBUILD_PKG_NODIRTOKENS)) {
headerConvert(h, HEADERCONV_COMPRESSFILELIST);
/* 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");
}
}
......@@ -1305,6 +1306,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. */
/*
......@@ -1318,7 +1323,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')
......@@ -1353,6 +1358,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);
......@@ -1364,8 +1375,14 @@ static rpmRC addFile(FileList fl, const char * diskPath,
/* Explicit %attr() always wins */
if (fl->cur.ar.ar_fmodestr != NULL) {
fileMode &= S_IFMT;
fileMode |= fl->cur.ar.ar_fmode;
if (S_ISLNK(fileMode)) {
rpmlog(RPMLOG_WARNING,
"Explicit %%attr() mode not applicaple 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)) {
......@@ -1373,7 +1390,7 @@ 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;
}
......@@ -1813,6 +1830,7 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
/* XXX spec->buildRoot == NULL, then xstrdup("") is returned */
fl.buildRoot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
fl.buildRootLen = strlen(fl.buildRoot);
dupAttrRec(&root_ar, &fl.def.ar); /* XXX assume %defattr(-,root,root) */
fl.def.verifyFlags = RPMVERIFY_ALL;
......@@ -1914,10 +1932,9 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
/* 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);
......@@ -1942,6 +1959,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;
......@@ -1972,7 +1990,7 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
}
}
spec->sourceCpioList = NULL;
sourcePkg->cpioList = NULL;
/* Init the file list structure */
memset(&fl, 0, sizeof(fl));
......@@ -2045,9 +2063,8 @@ rpmRC processSourceFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags)
argvFree(files);
if (! fl.processingFailed) {
if (spec->sourceHeader != NULL) {
genCpioListAndHeader(&fl, &spec->sourceCpioList,
spec->sourceHeader, 1);
if (sourcePkg->header != NULL) {
genCpioListAndHeader(&fl, sourcePkg, 1);
}
}
......
......@@ -23,15 +23,10 @@
#include "debug.h"
typedef struct cpioSourceArchive_s {
rpm_loff_t cpioArchiveSize;
rpmfi cpioList;
} * CSA_t;
/**
* @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)
{
char *failedFile = NULL;
FD_t cfd;
......@@ -42,8 +37,8 @@ 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,