From 5523e9798354224e6d62de36760359a44881b21e Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 31 2019 14:53:43 +0000 Subject: import rpm-4.11.3-43.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..878f733 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/rpm-4.11.3.tar.bz2 diff --git a/.rpm.metadata b/.rpm.metadata new file mode 100644 index 0000000..0894cbd --- /dev/null +++ b/.rpm.metadata @@ -0,0 +1 @@ +ae9ff06718e877d897ed47e3795b0e56727d752c SOURCES/rpm-4.11.3.tar.bz2 diff --git a/SOURCES/libsymlink.attr b/SOURCES/libsymlink.attr new file mode 100644 index 0000000..8bb6404 --- /dev/null +++ b/SOURCES/libsymlink.attr @@ -0,0 +1,4 @@ +# Make libfoo.so symlinks require the soname-provide of the target library +%__libsymlink_requires %{_rpmconfigdir}/elfdeps --provides --soname-only +%__libsymlink_magic ^symbolic link to `.*lib.*\.so\..*'$ +%__libsymlink_exclude_path ^.*[[:digit:]]$ diff --git a/SOURCES/rpm b/SOURCES/rpm new file mode 100644 index 0000000..a66534a --- /dev/null +++ b/SOURCES/rpm @@ -0,0 +1,303 @@ +# bash completion for rpm -*- shell-script -*- + +# helper functions + +_rpm_installed_packages() +{ + if [[ -r /var/log/rpmpkgs && \ + /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then + # using RHL 7.2 or later - this is quicker than querying the DB + COMPREPLY=( $( compgen -W "$( sed -ne \ + 's|^\([^[:space:]]\{1,\}\)-[^[:space:]-]\{1,\}-[^[:space:]-]\{1,\}\.rpm$|\1|p' \ + /var/log/rpmpkgs )" -- "$cur" ) ) + elif type rpmqpack &>/dev/null ; then + # SUSE's rpmqpack is faster than rpm -qa + COMPREPLY=( $( compgen -W '$( rpmqpack )' -- "$cur" ) ) + else + COMPREPLY=( $( ${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{NAME} ' "$cur*" 2>/dev/null ) ) + fi +} + +_rpm_groups() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$( ${1:-rpm} -qa --nodigest --nosignature \ + --queryformat='%{GROUP}\n' 2>/dev/null )" -- "$cur" ) ) +} + +_rpm_macros() +{ + # get a list of macros + COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | sed -ne \ + 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p' )" \ + -- "$cur" ) ) +} + +_rpm_buildarchs() +{ + COMPREPLY=( $( compgen -W "$( ${1:-rpm} --showrc | sed -ne \ + 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p' )" \ + -- "$cur" ) ) +} + +# rpm(8) completion +# +_rpm() +{ + local cur prev words cword split + _init_completion -s || return + + if [[ $cword -eq 1 ]]; then + # first parameter on line + case $cur in + --*) + COMPREPLY=( $( compgen -W '--help --version --initdb + --checksig --addsign --delsign --rebuilddb --showrc + --setperms --setugids --eval --install --upgrade --query + --freshen --erase --verify --querytags --import' \ + -- "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W '-e -E -F -i -q -t -U -V' \ + -- "$cur" ) ) + ;; + esac + return 0 + fi + + case $prev in + --dbpath|--excludepath|--prefix|--relocate|--root|-r) + _filedir -d + return 0 + ;; + --eval|-E) + _rpm_macros $1 + return 0 + ;; + --pipe) + compopt -o filenames + COMPREPLY=( $( compgen -c -- "$cur" ) ) + return 0 + ;; + --rcfile) + _filedir + return 0 + ;; + --specfile) + # complete on .spec files + _filedir spec + return 0 + ;; + --whatprovides) + if [[ "$cur" == */* ]]; then + _filedir + else + # complete on capabilities + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \ + --queryformat='%{PROVIDENAME}\n' 2>/dev/null )" \ + -- "$cur" ) ) + fi + return 0 + ;; + --whatrequires) + if [[ "$cur" == */* ]]; then + _filedir + else + # complete on capabilities + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \ + --queryformat='%{REQUIRENAME}\n' 2>/dev/null )" \ + -- "$cur" ) ) + fi + return 0 + ;; + --define|-D|--fileid|--hdrid|--pkgid) + # argument required but no completions available + return 0 + ;; + esac + + $split && return 0 + + # options common to all modes + local opts="--define= --eval= --macros= --nodigest --nosignature --rcfile= + --quiet --pipe --verbose" + + case ${words[1]} in + -[iFU]*|--install|--freshen|--upgrade) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --percent --force --test + --replacepkgs --replacefiles --root --excludedocs --includedocs + --noscripts --ignorearch --dbpath --prefix= --ignoreos --nodeps + --allfiles --ftpproxy --ftpport --justdb --httpproxy --httpport + --noorder --relocate= --badreloc --notriggers --excludepath= + --ignoresize --oldpackage --queryformat --repackage + --nosuggests" -- "$cur" ) ) + else + _filedir '[rs]pm' + fi + ;; + -e|--erase) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --allmatches --noscripts + --notriggers --nodeps --test --repackage" -- "$cur" ) ) + else + _rpm_installed_packages $1 + fi + ;; + -q*|--query) + # options common to all query types + opts+=" --changelog --configfiles --conflicts --docfiles --dump + --enhances --filesbypkg --filecaps --fileclass --filecolor + --fileprovide --filerequire --filesbypkg --info --list + --obsoletes --pipe --provides --queryformat= --requires + --scripts --suggests --triggers --xml" + + if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + # -qf completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext + --last --root --state" -- "$cur" ) ) + else + _filedir + fi + elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + # -qg completion + _rpm_groups $1 + elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + # -qp; uninstalled package completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy + --httpport --httpproxy --nomanifest" -- "$cur" ) ) + else + _filedir '[rs]pm' + fi + else + # -q; installed package completion + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --all --file --fileid + --dbpath --fscontext --ftswalk --group --hdrid --last + --package --pkgid --root= --specfile --state + --triggeredby --whatprovides --whatrequires" \ + -- "$cur" ) ) + elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then + _rpm_installed_packages $1 + fi + fi + ;; + -K*|--checksig) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \ + -- "$cur" ) ) + else + _filedir '[rs]pm' + fi + ;; + -[Vy]*|--verify) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps + --nogroup --nolinkto --nomode --nomtime --nordev --nouser + --nofiles --noscripts --nomd5 --querytags --specfile + --whatrequires --whatprovides" -- "$cur" ) ) + # check whether we're doing file completion + elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then + _filedir + elif [[ ${words[@]} == *\ -@(*([^ -])g|-group )* ]]; then + _rpm_groups $1 + elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then + _filedir '[rs]pm' + else + _rpm_installed_packages $1 + fi + ;; + --resign|--addsign|--delsign) + _filedir '[rs]pm' + ;; + --setperms|--setgids) + _rpm_installed_packages $1 + ;; + --import|--dbpath|--root) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--import --dbpath --root=' \ + -- "$cur" ) ) + else + _filedir + fi + ;; + esac + [[ $COMPREPLY == *= ]] && compopt -o nospace + + return 0 +} && +complete -F _rpm rpm + +_rpmbuild() +{ + local cur prev words cword split + _init_completion -s || return + + local rpm="${1%build*}" + [[ $rpm == $1 ]] || ! type $rpm &>/dev/null && rpm= + + case $prev in + --buildroot|--root|-r|--dbpath) + _filedir -d + return 0 + ;; + --target) + _rpm_buildarchs + return 0 + ;; + --eval|-E) + _rpm_macros $rpm + return 0 + ;; + --macros|--rcfile) + _filedir + return 0 + ;; + --buildpolicy) + local cfgdir=$( $rpm --eval '%{_rpmconfigdir}' 2>/dev/null ) + if [[ $cfgdir ]]; then + COMPREPLY=( $( compgen -W "$( command ls $cfgdir 2>/dev/null \ + | sed -ne 's/^brp-//p' )" -- "$cur" ) ) + fi + ;; + --define|-D|--with|--without) + return 0 + ;; + esac + + $split && return 0 + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return 0 + fi + + # Figure out file extensions to complete + local word ext + for word in ${words[@]}; do + case $word in + -b?) + ext=spec + break + ;; + -t?|--tarbuild) + ext='@(t?(ar.)@([gx]z|bz?(2))|tar?(.@(lzma|Z)))' + break + ;; + --rebuild|--recompile) + ext='@(?(no)src.r|s)pm' + break + ;; + esac + done + [[ -n $ext ]] && _filedir $ext +} && +complete -F _rpmbuild rpmbuild rpmbuild-md5 + +# ex: ts=4 sw=4 et filetype=sh diff --git a/SOURCES/rpm-4.10.0-dwz-debuginfo.patch b/SOURCES/rpm-4.10.0-dwz-debuginfo.patch new file mode 100644 index 0000000..41d783b --- /dev/null +++ b/SOURCES/rpm-4.10.0-dwz-debuginfo.patch @@ -0,0 +1,101 @@ +--- rpm-4.10.0/scripts/find-debuginfo.sh 2012-03-20 09:07:25.000000000 +0100 ++++ rpm-4.10.0/scripts/find-debuginfo.sh.jj 2012-06-19 12:32:33.147503858 +0200 +@@ -4,6 +4,8 @@ + # + # Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] + # [-o debugfiles.list] ++# [--run-dwz] [--dwz-low-mem-die-limit N] ++# [--dwz-max-die-limit N] + # [[-l filelist]... [-p 'pattern'] -o debuginfo.list] + # [builddir] + # +@@ -20,6 +22,10 @@ + # The -p argument is an grep -E -style regexp matching the a file name, + # and must not use anchors (^ or $). + # ++# The --run-dwz flag instructs find-debuginfo.sh to run the dwz utility ++# if available, and --dwz-low-mem-die-limit and --dwz-max-die-limit ++# provide detailed limits. See dwz(1) -l and -L option for details. ++# + # All file names in switches are relative to builddir (. if not given). + # + +@@ -32,6 +38,11 @@ strip_r=false + # Barf on missing build IDs. + strict=false + ++# DWZ parameters. ++run_dwz=false ++dwz_low_mem_die_limit= ++dwz_max_die_limit= ++ + BUILDDIR=. + out=debugfiles.list + nout=0 +@@ -40,6 +51,17 @@ while [ $# -gt 0 ]; do + --strict-build-id) + strict=true + ;; ++ --run-dwz) ++ run_dwz=true ++ ;; ++ --dwz-low-mem-die-limit) ++ dwz_low_mem_die_limit=$2 ++ shift ++ ;; ++ --dwz-max-die-limit) ++ dwz_max_die_limit=$2 ++ shift ++ ;; + -g) + strip_g=true + ;; +@@ -266,6 +288,37 @@ while read nlinks inum f; do + fi + done || exit + ++# Invoke the DWARF Compressor utility. ++if $run_dwz && type dwz >/dev/null 2>&1 \ ++ && [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then ++ dwz_files="`cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug`" ++ if [ -n "${dwz_files}" ]; then ++ dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}" ++ dwz_multifile_suffix= ++ dwz_multifile_idx=0 ++ while [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}${dwz_multifile_suffix}" ]; do ++ let ++dwz_multifile_idx ++ dwz_multifile_suffix=".${dwz_multifile_idx}" ++ done ++ dwz_multfile_name="${dwz_multifile_name}${dwz_multifile_suffix}" ++ dwz_opts="-h -q -r -m .dwz/${dwz_multifile_name}" ++ mkdir -p "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" ++ [ -n "${dwz_low_mem_die_limit}" ] \ ++ && dwz_opts="${dwz_opts} -l ${dwz_low_mem_die_limit}" ++ [ -n "${dwz_max_die_limit}" ] \ ++ && dwz_opts="${dwz_opts} -L ${dwz_max_die_limit}" ++ ( cd "${RPM_BUILD_ROOT}/usr/lib/debug" && dwz $dwz_opts $dwz_files ) ++ # Remove .dwz directory if empty ++ rmdir "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz" 2>/dev/null ++ if [ -f "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" ]; then ++ id="`readelf -Wn "${RPM_BUILD_ROOT}/usr/lib/debug/.dwz/${dwz_multifile_name}" \ ++ 2>/dev/null | sed -n 's/^ Build ID: \([0-9a-f]\+\)/\1/p'`" ++ [ -n "$id" ] \ ++ && make_id_link "$id" "/usr/lib/debug/.dwz/${dwz_multifile_name}" .debug ++ fi ++ fi ++fi ++ + # For each symlink whose target has a .debug file, + # make a .debug symlink to that file. + find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print | +--- rpm-4.10.0/macros.in 2012-03-20 09:07:25.000000000 +0100 ++++ rpm-4.10.0/macros.in.jj 2012-06-19 12:32:33.147503858 +0200 +@@ -176,7 +176,7 @@ + # the script. See the script for details. + # + %__debug_install_post \ +- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ ++ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ + %{nil} + + # Template for debug information sub-package. diff --git a/SOURCES/rpm-4.10.0-minidebuginfo.patch b/SOURCES/rpm-4.10.0-minidebuginfo.patch new file mode 100644 index 0000000..54c0e32 --- /dev/null +++ b/SOURCES/rpm-4.10.0-minidebuginfo.patch @@ -0,0 +1,98 @@ +--- rpm-4.10.0/macros.in 2012-06-11 11:16:21.216952339 +0200 ++++ rpm-4.10.0/macros.in.minidebug 2012-06-11 11:16:23.686912455 +0200 +@@ -175,7 +175,7 @@ + # the script. See the script for details. + # + %__debug_install_post \ +- %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ ++ %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_include_minidebuginfo:-m} %{?_find_debuginfo_dwz_opts} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\ + %{nil} + + # Template for debug information sub-package. +@@ -418,6 +418,12 @@ package or when debugging this package.\ + #%_missing_build_ids_terminate_build 1 + + # ++# Include minimal debug information in build binaries. ++# Requires _enable_debug_packages. ++# ++#%_include_minidebuginfo 1 ++ ++# + # Use internal dependency generator rather than external helpers? + %_use_internal_dependency_generator 1 + +--- rpm-4.10.0/scripts/find-debuginfo.sh 2012-06-11 11:16:09.698138273 +0200 ++++ rpm-4.10.0/scripts/find-debuginfo.sh.minidebug 2012-06-11 11:16:13.399078526 +0200 +@@ -2,7 +2,7 @@ + #find-debuginfo.sh - automagically generate debug info and file list + #for inclusion in an rpm spec file. + # +-# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] ++# Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m] + # [-o debugfiles.list] + # [--run-dwz] [--dwz-low-mem-die-limit N] + # [--dwz-max-die-limit N] +@@ -29,6 +29,9 @@ strip_g=false + # with -r arg, pass --reloc-debug-sections to eu-strip. + strip_r=false + ++# with -m arg, add minimal debuginfo to binary. ++include_minidebug=false ++ + # Barf on missing build IDs. + strict=false + +@@ -43,6 +46,9 @@ while [ $# -gt 0 ]; do + -g) + strip_g=true + ;; ++ -m) ++ include_minidebug=true ++ ;; + -o) + if [ -z "${lists[$nout]}" -a -z "${ptns[$nout]}" ]; then + out=$2 +@@ -105,6 +111,32 @@ strip_to_debug() + chmod 444 "$1" || exit + } + ++add_minidebug() ++{ ++ local debuginfo="$1" ++ local binary="$2" ++ ++ local dynsyms=`mktemp` ++ local funcsyms=`mktemp` ++ local keep_symbols=`mktemp` ++ local mini_debuginfo=`mktemp` ++ ++ # Extract the dynamic symbols from the main binary, there is no need to also have these ++ # in the normal symbol table ++ nm -D "$binary" --format=posix --defined-only | awk '{ print $1 }' | sort > "$dynsyms" ++ # Extract all the text (i.e. function) symbols from the debuginfo ++ nm "$debuginfo" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > "$funcsyms" ++ # Keep all the function symbols not already in the dynamic symbol table ++ comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols" ++ # Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections ++ objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols="$keep_symbols" "$debuginfo" "$mini_debuginfo" &> /dev/null ++ #Inject the compressed data into the .gnu_debugdata section of the original binary ++ xz "$mini_debuginfo" ++ mini_debuginfo="${mini_debuginfo}.xz" ++ objcopy --add-section .gnu_debugdata="$mini_debuginfo" "$binary" ++ rm -f "$dynsyms" "$funcsyms" "$keep_symbols" "$mini_debuginfo" ++} ++ + # Make a relative symlink to $1 called $3$2 + shopt -s extglob + link_relative() +@@ -260,6 +292,9 @@ while read nlinks inum f; do + chmod u-w "$f" + fi + ++ $include_minidebug && add_minidebug "${debugfn}" "$f" ++ ++ + if [ -n "$id" ]; then + make_id_link "$id" "$dn/$(basename $f)" + make_id_link "$id" "/usr/lib/debug$dn/$bn" .debug diff --git a/SOURCES/rpm-4.10.90-rpmlib-filesystem-check.patch b/SOURCES/rpm-4.10.90-rpmlib-filesystem-check.patch new file mode 100644 index 0000000..ec4324c --- /dev/null +++ b/SOURCES/rpm-4.10.90-rpmlib-filesystem-check.patch @@ -0,0 +1,125 @@ +diff -up rpm-4.10.90.git11978/lib/depends.c.rpmlib-filesystem-check rpm-4.10.90.git11978/lib/depends.c +--- rpm-4.10.90.git11978/lib/depends.c.rpmlib-filesystem-check 2012-11-01 09:40:26.000000000 +0200 ++++ rpm-4.10.90.git11978/lib/depends.c 2012-11-05 10:53:42.294733695 +0200 +@@ -537,6 +537,109 @@ static int rpmdbProvides(rpmts ts, depCa + return rc; + } + ++/* ++ * Temporary support for live-conversion of the filesystem hierarchy ++ * mailto: kay@redhat.com, harald@redhat.com ++ * https://fedoraproject.org/wiki/Features/UsrMove ++ * ++ * X-CheckUnifiedSystemdir: ++ * /bin, /sbin, /lib, /lib64 --> /usr ++ * ++ * X-CheckUnifiedBindir: ++ * /usr/sbin -> /usr/bin ++ * ++ * X-CheckMultiArchLibdir: ++ * /usr/lib64 /usr/lib/ (e.g. x86_64-linux-gnu) ++ * ++ * This code is not needed for new installations, it can be removed after ++ * updates from older systems are no longer supported: Fedora 19 / RHEL 8. ++ */ ++ ++static int CheckLink(const char *dir, const char *root) ++{ ++ char *d = NULL; ++ struct stat sbuf; ++ int rc = 0; ++ ++ if (!root) ++ root = "/"; ++ ++ rasprintf(&d, "%s%s", root, dir); ++ if (!d) { ++ rc = -1; ++ goto exit; ++ } ++ ++ /* directory or symlink does not exist, all is fine */ ++ if (lstat(d, &sbuf) < 0) { ++ rc = 1; ++ goto exit; ++ } ++ ++ /* if it is a symlink, all is fine */ ++ if (S_ISLNK(sbuf.st_mode)) ++ rc = 1; ++ ++exit: ++ free(d); ++ return rc; ++} ++ ++static int CheckFilesystemHierarchy(rpmds * dsp, const char *root) ++{ ++ static const char *dirs[] = { "bin", "sbin", "lib", "lib64" }; ++ int check; ++ int i; ++ rpmds ds; ++ rpmstrPool pool = rpmdsPool(*dsp); ++ int rc = 0; ++ ++ for (i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) { ++ check = CheckLink(dirs[i], root); ++ if (check < 0) { ++ rc = -1; ++ goto exit; ++ } ++ ++ if (check == 0) ++ goto exit; ++ } ++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, ++ "rpmlib(X-CheckUnifiedSystemdir)", "1", ++ RPMSENSE_EQUAL); ++ rpmdsMerge(dsp, ds); ++ rpmdsFree(ds); ++ ++ check = CheckLink("usr/lib64", root); ++ if (check < 0) { ++ rc = -1; ++ goto exit; ++ } ++ if (check > 0) { ++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, ++ "rpmlib(X-CheckMultiArchLibdir)", "1", ++ RPMSENSE_EQUAL); ++ rpmdsMerge(dsp, ds); ++ rpmdsFree(ds); ++ } ++ ++ check = CheckLink("usr/sbin", root); ++ if (check < 0) { ++ rc = -1; ++ goto exit; ++ } ++ if (check > 0) { ++ ds = rpmdsSinglePool(pool, RPMTAG_PROVIDENAME, ++ "rpmlib(X-CheckUnifiedBindir)", "1", ++ RPMSENSE_EQUAL); ++ rpmdsMerge(dsp, ds); ++ rpmdsFree(ds); ++ } ++ ++exit: ++ return rc; ++} ++ + /** + * Check dep for an unsatisfied dependency. + * @param ts transaction set +@@ -560,8 +663,10 @@ retry: + * Check those dependencies now. + */ + if (dsflags & RPMSENSE_RPMLIB) { +- if (tsmem->rpmlib == NULL) ++ if (tsmem->rpmlib == NULL) { + rpmdsRpmlibPool(rpmtsPool(ts), &(tsmem->rpmlib), NULL); ++ CheckFilesystemHierarchy(&(tsmem->rpmlib), rpmtsRootDir(ts)); ++ } + + if (tsmem->rpmlib != NULL && rpmdsSearch(tsmem->rpmlib, dep) >= 0) { + rpmdsNotify(dep, "(rpmlib provides)", rc); diff --git a/SOURCES/rpm-4.11.1-libtool-ppc64le.patch b/SOURCES/rpm-4.11.1-libtool-ppc64le.patch new file mode 100644 index 0000000..efe9fc3 --- /dev/null +++ b/SOURCES/rpm-4.11.1-libtool-ppc64le.patch @@ -0,0 +1,70 @@ +--- ./rpm-4.11.1/configure.aa 2014-04-25 08:59:19.704797276 -0700 ++++ ./rpm-4.11.1/configure 2014-04-25 09:08:29.701167788 -0700 +@@ -8433,7 +8433,7 @@ + rm -rf conftest* + ;; + +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext +@@ -8451,7 +8451,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; +- ppc64-*linux*|powerpc64-*linux*) ++ powerpc64le-*linux*) ++ LD="${LD-ld} -m elf32lppclinux" ++ ;; ++ powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) +@@ -8470,7 +8472,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; +- ppc*-*linux*|powerpc*-*linux*) ++ powerpcle-*linux*) ++ LD="${LD-ld} -m elf64lppc" ++ ;; ++ powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) +--- ./rpm-4.11.1/m4/libtool.m4.aa 2014-04-25 09:11:55.512115764 -0700 ++++ ./rpm-4.11.1/m4/libtool.m4 2014-04-25 09:12:08.932179982 -0700 +@@ -1312,7 +1312,7 @@ + rm -rf conftest* + ;; + +-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ ++x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ + s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext +@@ -1326,7 +1326,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; +- ppc64-*linux*|powerpc64-*linux*) ++ powerpc64le-*linux*) ++ LD="${LD-ld} -m elf32lppclinux" ++ ;; ++ powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) +@@ -1345,7 +1347,10 @@ + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; +- ppc*-*linux*|powerpc*-*linux*) ++ powerpcle-*linux*) ++ LD="${LD-ld} -m elf64lppc" ++ ;; ++ powerpc-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) diff --git a/SOURCES/rpm-4.11.1-sepdebugcrcfix.patch b/SOURCES/rpm-4.11.1-sepdebugcrcfix.patch new file mode 100644 index 0000000..d92ba6b --- /dev/null +++ b/SOURCES/rpm-4.11.1-sepdebugcrcfix.patch @@ -0,0 +1,472 @@ +--- rpm-4.11.1-rc1-orig/Makefile.am 2013-06-07 12:19:21.000000000 +0200 ++++ rpm-4.11.1-rc1/Makefile.am 2013-06-24 18:34:06.342894002 +0200 +@@ -162,6 +162,10 @@ rpmlibexec_PROGRAMS += elfdeps + elfdeps_SOURCES = tools/elfdeps.c + elfdeps_LDADD = rpmio/librpmio.la + elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@ ++ ++rpmlibexec_PROGRAMS += sepdebugcrcfix ++sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c ++sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@ + endif + endif + +--- rpm-4.11.1-rc1-orig/Makefile.in 2013-06-10 08:38:51.000000000 +0200 ++++ rpm-4.11.1-rc1/Makefile.in 2013-06-24 18:34:06.342894002 +0200 +@@ -74,7 +74,8 @@ bin_PROGRAMS = rpm2cpio$(EXEEXT) rpmbuil + rpmgraph$(EXEEXT) + rpmlibexec_PROGRAMS = $(am__EXEEXT_1) rpmdeps$(EXEEXT) + @LIBDWARF_TRUE@@LIBELF_TRUE@am__append_6 = scripts/find-debuginfo.sh +-@LIBDWARF_TRUE@@LIBELF_TRUE@am__append_7 = debugedit elfdeps ++@LIBDWARF_TRUE@@LIBELF_TRUE@am__append_7 = debugedit elfdeps \ ++@LIBDWARF_TRUE@@LIBELF_TRUE@ sepdebugcrcfix + @DOXYGEN_TRUE@@HACKINGDOCS_TRUE@am__append_8 = doc/hacking/html/index.html + @DOXYGEN_TRUE@am__append_9 = doc/librpm/html/index.html + @WITH_INTERNAL_DB_TRUE@am__append_10 = db.h +@@ -110,7 +111,8 @@ am__installdirs = "$(DESTDIR)$(bindir)" + "$(DESTDIR)$(rpmconfigdir)" "$(DESTDIR)$(rpmvardir)" \ + "$(DESTDIR)$(pkgincludedir)" "$(DESTDIR)$(pkgincludedir)" + @LIBDWARF_TRUE@@LIBELF_TRUE@am__EXEEXT_1 = debugedit$(EXEEXT) \ +-@LIBDWARF_TRUE@@LIBELF_TRUE@ elfdeps$(EXEEXT) ++@LIBDWARF_TRUE@@LIBELF_TRUE@ elfdeps$(EXEEXT) \ ++@LIBDWARF_TRUE@@LIBELF_TRUE@ sepdebugcrcfix$(EXEEXT) + PROGRAMS = $(bin_PROGRAMS) $(rpmbin_PROGRAMS) $(rpmlibexec_PROGRAMS) + am__debugedit_SOURCES_DIST = tools/debugedit.c tools/hashtab.c \ + tools/hashtab.h +@@ -157,6 +159,11 @@ am_rpmspec_OBJECTS = rpmspec-rpmspec.$(O + rpmspec_OBJECTS = $(am_rpmspec_OBJECTS) + rpmspec_DEPENDENCIES = libcliutils.la build/librpmbuild.la \ + lib/librpm.la rpmio/librpmio.la ++am__sepdebugcrcfix_SOURCES_DIST = tools/sepdebugcrcfix.c ++@LIBDWARF_TRUE@@LIBELF_TRUE@am_sepdebugcrcfix_OBJECTS = \ ++@LIBDWARF_TRUE@@LIBELF_TRUE@ tools/sepdebugcrcfix.$(OBJEXT) ++sepdebugcrcfix_OBJECTS = $(am_sepdebugcrcfix_OBJECTS) ++sepdebugcrcfix_DEPENDENCIES = + am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; + am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ +@@ -223,12 +230,12 @@ SOURCES = $(libcliutils_la_SOURCES) $(de + $(elfdeps_SOURCES) $(rpm_SOURCES) $(rpm2cpio_SOURCES) \ + $(rpmbuild_SOURCES) $(rpmdb_SOURCES) $(rpmdeps_SOURCES) \ + $(rpmgraph_SOURCES) $(rpmkeys_SOURCES) $(rpmsign_SOURCES) \ +- $(rpmspec_SOURCES) ++ $(rpmspec_SOURCES) $(sepdebugcrcfix_SOURCES) + DIST_SOURCES = $(libcliutils_la_SOURCES) $(am__debugedit_SOURCES_DIST) \ + $(am__elfdeps_SOURCES_DIST) $(rpm_SOURCES) $(rpm2cpio_SOURCES) \ + $(rpmbuild_SOURCES) $(rpmdb_SOURCES) $(rpmdeps_SOURCES) \ + $(rpmgraph_SOURCES) $(rpmkeys_SOURCES) $(rpmsign_SOURCES) \ +- $(rpmspec_SOURCES) ++ $(rpmspec_SOURCES) $(am__sepdebugcrcfix_SOURCES_DIST) + RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ +@@ -636,6 +643,8 @@ rpm2cpio_LDADD = lib/librpm.la rpmio/lib + @LIBDWARF_TRUE@@LIBELF_TRUE@elfdeps_LDADD = rpmio/librpmio.la \ + @LIBDWARF_TRUE@@LIBELF_TRUE@ @WITH_LIBELF_LIB@ @WITH_POPT_LIB@ \ + @LIBDWARF_TRUE@@LIBELF_TRUE@ $(am__empty) ++@LIBDWARF_TRUE@@LIBELF_TRUE@sepdebugcrcfix_SOURCES = tools/sepdebugcrcfix.c ++@LIBDWARF_TRUE@@LIBELF_TRUE@sepdebugcrcfix_LDADD = @WITH_LIBELF_LIB@ + rpmdeps_SOURCES = tools/rpmdeps.c + rpmdeps_LDADD = lib/librpm.la rpmio/librpmio.la build/librpmbuild.la @WITH_POPT_LIB@ + rpmgraph_SOURCES = tools/rpmgraph.c +@@ -903,6 +912,11 @@ rpmsign$(EXEEXT): $(rpmsign_OBJECTS) $(r + rpmspec$(EXEEXT): $(rpmspec_OBJECTS) $(rpmspec_DEPENDENCIES) $(EXTRA_rpmspec_DEPENDENCIES) + @rm -f rpmspec$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rpmspec_OBJECTS) $(rpmspec_LDADD) $(LIBS) ++tools/sepdebugcrcfix.$(OBJEXT): tools/$(am__dirstamp) \ ++ tools/$(DEPDIR)/$(am__dirstamp) ++sepdebugcrcfix$(EXEEXT): $(sepdebugcrcfix_OBJECTS) $(sepdebugcrcfix_DEPENDENCIES) $(EXTRA_sepdebugcrcfix_DEPENDENCIES) ++ @rm -f sepdebugcrcfix$(EXEEXT) ++ $(AM_V_CCLD)$(LINK) $(sepdebugcrcfix_OBJECTS) $(sepdebugcrcfix_LDADD) $(LIBS) + install-dist_binSCRIPTS: $(dist_bin_SCRIPTS) + @$(NORMAL_INSTALL) + @list='$(dist_bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ +@@ -994,6 +1008,7 @@ distclean-compile: + @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/hashtab.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rpmdeps.Po@am__quote@ + @AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/rpmgraph.Po@am__quote@ ++@AMDEP_TRUE@@am__include@ @am__quote@tools/$(DEPDIR)/sepdebugcrcfix.Po@am__quote@ + + .c.o: + @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +--- rpm-4.11.1-rc1-orig/scripts/find-debuginfo.sh 2013-06-24 17:20:55.407538301 +0200 ++++ rpm-4.11.1-rc1/scripts/find-debuginfo.sh 2013-06-24 18:34:41.270897302 +0200 +@@ -114,10 +114,12 @@ done + LISTFILE="$BUILDDIR/$out" + SOURCEFILE="$BUILDDIR/debugsources.list" + LINKSFILE="$BUILDDIR/debuglinks.list" ++ELFBINSFILE="$BUILDDIR/elfbins.list" + + > "$SOURCEFILE" + > "$LISTFILE" + > "$LINKSFILE" ++> "$ELFBINSFILE" + + debugdir="${RPM_BUILD_ROOT}/usr/lib/debug" + +@@ -316,6 +318,7 @@ while read nlinks inum f; do + + $include_minidebug && add_minidebug "${debugfn}" "$f" + ++ echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE" + + if [ -n "$id" ]; then + make_id_link "$id" "$dn/$(basename $f)" +@@ -354,6 +357,10 @@ if $run_dwz && type dwz >/dev/null 2>&1 + fi + fi + ++# dwz invalidates .gnu_debuglink CRC32 in the main files. ++cat "$ELFBINSFILE" | ++(cd "$RPM_BUILD_ROOT"; xargs -d '\n' /usr/lib/rpm/sepdebugcrcfix usr/lib/debug) ++ + # For each symlink whose target has a .debug file, + # make a .debug symlink to that file. + find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*" -type l -print | +--- rpm-4.11.1-rc1-orig/tools/sepdebugcrcfix.c 1970-01-01 01:00:00.000000000 +0100 ++++ rpm-4.11.1-rc1/tools/sepdebugcrcfix.c 2013-06-24 18:31:54.927881439 +0200 +@@ -0,0 +1,344 @@ ++/* Copyright (C) 2013 Free Software Foundation, Inc. ++ ++ 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 3 of the License, 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 . */ ++ ++/* Version 2013-06-24. */ ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define _(x) x ++#define static_assert(expr) \ ++ extern int never_defined_just_used_for_checking[(expr) ? 1 : -1] ++#ifndef min ++# define min(a, b) ((a) < (b) ? (a) : (b)) ++#endif ++ ++static_assert (sizeof (unsigned long) >= sizeof (uint32_t)); ++ ++typedef int bool; ++static const bool false = 0, true = 1; ++ ++/* This is bfd_calc_gnu_debuglink_crc32 from bfd/opncls.c. */ ++static unsigned long ++ calc_gnu_debuglink_crc32 (unsigned long crc, ++ const unsigned char *buf, ++ bfd_size_type len) ++{ ++ static const unsigned long crc32_table[256] = ++ { ++ 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, ++ 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, ++ 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, ++ 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, ++ 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, ++ 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, ++ 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, ++ 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, ++ 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, ++ 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, ++ 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, ++ 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, ++ 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, ++ 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, ++ 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, ++ 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, ++ 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, ++ 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, ++ 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, ++ 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, ++ 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, ++ 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, ++ 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, ++ 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, ++ 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, ++ 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, ++ 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, ++ 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, ++ 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, ++ 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, ++ 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, ++ 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, ++ 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, ++ 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, ++ 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, ++ 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, ++ 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, ++ 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, ++ 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, ++ 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, ++ 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, ++ 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, ++ 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, ++ 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, ++ 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, ++ 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, ++ 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, ++ 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, ++ 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, ++ 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, ++ 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, ++ 0x2d02ef8d ++ }; ++ const unsigned char *end; ++ ++ crc = ~crc & 0xffffffff; ++ for (end = buf + len; buf < end; ++ buf) ++ crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); ++ return ~crc & 0xffffffff; ++} ++ ++static size_t updated_count, matched_count, failed_count; ++ ++static const char *usr_lib_debug; ++ ++static bool ++crc32 (const char *fname, const char *base_fname, uint32_t *crcp) ++{ ++ char *reldir = strdup (base_fname); ++ if (reldir == NULL) ++ error (1, 0, _("out of memory")); ++ char *s = reldir + strlen (reldir); ++ while (s > reldir && s[-1] != '/') ++ *--s = '\0'; ++ char *debugname; ++ if (asprintf (&debugname, "%s/%s/%s", usr_lib_debug, reldir, fname) <= 0) ++ error (1, 0, _("out of memory")); ++ free (reldir); ++ int fd = open (debugname, O_RDONLY); ++ if (fd == -1) ++ { ++ error (0, errno, _("cannot open \"%s\""), debugname); ++ return false; ++ } ++ off64_t size = lseek64 (fd, 0, SEEK_END); ++ if (size == -1) ++ { ++ error (0, errno, _("cannot get size of \"%s\""), debugname); ++ return false; ++ } ++ off_t offset = 0; ++ uint32_t crc = 0; ++ void *buf = NULL; ++ while (offset < size) ++ { ++ const size_t maplen = min (0x10000, size - offset); ++ void *map = NULL; ++ if (buf == NULL) ++ { ++ map = mmap (NULL, maplen, PROT_READ, MAP_PRIVATE | MAP_POPULATE, ++ fd, offset); ++ if (map == MAP_FAILED) ++ { ++ error (0, errno, _("cannot map 0x%llx bytes at offset 0x%llx " ++ "of file \"%s\""), ++ (unsigned long long) maplen, (unsigned long long) offset, ++ debugname); ++ map = NULL; ++ } ++ } ++ if (map == NULL) ++ { ++ if (buf == NULL) ++ { ++ buf = malloc (maplen); ++ if (buf == NULL) ++ error (1, 0, _("out of memory")); ++ } ++ ssize_t got = pread (fd, buf, maplen, offset); ++ if (got != maplen) ++ { ++ error (0, errno, _("cannot read 0x%llx bytes at offset 0x%llx " ++ "of file \"%s\""), ++ (unsigned long long) maplen, (unsigned long long) offset, ++ debugname); ++ free (buf); ++ free (debugname); ++ return false; ++ } ++ } ++ crc = calc_gnu_debuglink_crc32 (crc, map ?: buf, maplen); ++ if (map && munmap (map, maplen) != 0) ++ error (1, errno, _("cannot unmap 0x%llx bytes at offset 0x%llx " ++ "of file \"%s\""), ++ (unsigned long long) maplen, (unsigned long long) offset, ++ debugname); ++ offset += maplen; ++ } ++ free (buf); ++ if (close (fd) != 0) ++ { ++ error (0, errno, _("cannot close \"%s\""), debugname); ++ free (debugname); ++ return false; ++ } ++ free (debugname); ++ *crcp = crc; ++ return true; ++} ++ ++static bool ++process (Elf *elf, int fd, const char *fname) ++{ ++ GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (elf, &ehdr_mem); ++ if (ehdr == NULL) ++ { ++ error (0, 0, _("cannot get ELF header of \"%s\""), fname); ++ return false; ++ } ++ if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB ++ && ehdr->e_ident[EI_DATA] != ELFDATA2MSB) ++ { ++ error (0, 0, _("invalid ELF endianity of \"%s\""), fname); ++ return false; ++ } ++ Elf_Scn *scn = NULL; ++ const char scnname[] = ".gnu_debuglink"; ++ while ((scn = elf_nextscn (elf, scn)) != NULL) ++ { ++ GElf_Shdr shdr_mem, *shdr = gelf_getshdr (scn, &shdr_mem); ++ if (shdr == NULL) ++ { ++ error (0, 0, _("cannot get section # %zu in \"%s\""), ++ elf_ndxscn (scn), fname); ++ continue; ++ } ++ const char *sname = elf_strptr (elf, ehdr->e_shstrndx, shdr->sh_name); ++ if (sname == NULL) ++ { ++ error (0, 0, _("cannot get name of section # %zu in \"%s\""), ++ elf_ndxscn (scn), fname); ++ continue; ++ } ++ if (strcmp (sname, scnname) != 0) ++ continue; ++ Elf_Data *data = elf_getdata (scn, NULL); ++ if (data == NULL) ++ { ++ error (0, 0, _("cannot get data of section \"%s\" # %zu in \"%s\""), ++ scnname, elf_ndxscn (scn), fname); ++ continue; ++ } ++ if ((data->d_size & 3) != 0) ++ { ++ error (0, 0, _("invalid size of section \"%s\" # %zu in \"%s\""), ++ scnname, elf_ndxscn (scn), fname); ++ continue; ++ } ++ const uint8_t *zerop = memchr (data->d_buf, '\0', data->d_size); ++ const uint8_t *crcp = (zerop == NULL ++ ? NULL ++ : (const uint8_t *) ((uintptr_t) (zerop + 1 + 3) ++ & -4)); ++ if (crcp + 4 != (uint8_t *) data->d_buf + data->d_size) ++ { ++ error (0, 0, _("invalid format of section \"%s\" # %zu in \"%s\""), ++ scnname, elf_ndxscn (scn), fname); ++ continue; ++ } ++ uint32_t had_crc_targetendian = *(const uint32_t *) crcp; ++ uint32_t had_crc = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB ++ ? le32toh (had_crc_targetendian) ++ : be32toh (had_crc_targetendian)); ++ uint32_t crc; ++ if (! crc32 (data->d_buf, fname, &crc)) ++ return false; ++ if (crc == had_crc) ++ { ++ matched_count++; ++ return true; ++ } ++ updated_count++; ++ off64_t seekto = (shdr->sh_offset + data->d_off ++ + (crcp - (const uint8_t *) data->d_buf)); ++ uint32_t crc_targetendian = (ehdr->e_ident[EI_DATA] == ELFDATA2LSB ++ ? htole32 (crc) : htobe32 (crc)); ++ ssize_t wrote = pwrite (fd, &crc_targetendian, sizeof (crc_targetendian), ++ seekto); ++ if (wrote != sizeof (crc_targetendian)) ++ { ++ error (0, 0, _("cannot write new CRC to 0x%llx " ++ "inside section \"%s\" # %zu in \"%s\""), ++ (unsigned long long) seekto, scnname, elf_ndxscn (scn), fname); ++ return false; ++ } ++ return true; ++ } ++ error (0, 0, _("cannot find section \"%s\" in \"%s\""), scnname, fname); ++ return false; ++} ++ ++int ++main (int argc, char **argv) ++{ ++ if (argc < 2) ++ error (1, 0, _("usr/lib/debug [...]")); ++ usr_lib_debug = argv[1]; ++ if (elf_version (EV_CURRENT) == EV_NONE) ++ error (1, 0, _("error initializing libelf: %s"), elf_errmsg (-1)); ++ for (int argi = 2; argi < argc; argi++) ++ { ++ const char *fname = argv[argi]; ++ int fd = open64 (fname, O_RDWR); ++ if (fd == -1) ++ { ++ error (0, errno, _("cannot open \"%s\""), fname); ++ failed_count++; ++ continue; ++ } ++ bool failed = false; ++ Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL); ++ if (elf == NULL) ++ { ++ error (0, 0, _("cannot open \"%s\" as ELF: %s"), fname, ++ elf_errmsg (-1)); ++ failed = true; ++ } ++ else ++ { ++ if (! process (elf, fd, fname)) ++ failed = true; ++ if (elf_end (elf) != 0) ++ { ++ error (0, 0, _("cannot close \"%s\" as ELF: %s"), fname, ++ elf_errmsg (-1)); ++ failed = true; ++ } ++ } ++ if (close (fd) != 0) ++ { ++ error (0, errno, _("cannot close \"%s\""), fname); ++ failed = true; ++ } ++ if (failed) ++ failed_count++; ++ } ++ printf ("%s: Updated %zu CRC32s, %zu CRC32s did match.\n", argv[0], ++ updated_count, matched_count); ++ if (failed_count) ++ printf ("%s: Failed for %zu files.\n", argv[0], failed_count); ++ return failed_count == 0 ? EXIT_SUCCESS : EXIT_FAILURE; ++} diff --git a/SOURCES/rpm-4.11.3-EVR-validity-check.patch b/SOURCES/rpm-4.11.3-EVR-validity-check.patch new file mode 100644 index 0000000..da09e08 --- /dev/null +++ b/SOURCES/rpm-4.11.3-EVR-validity-check.patch @@ -0,0 +1,30 @@ +--- rpm-4.11.3/build/parseReqs.c.orig 2015-08-19 16:24:55.343033682 +0200 ++++ rpm-4.11.3/build/parseReqs.c 2015-08-19 16:25:26.166111719 +0200 +@@ -35,16 +35,6 @@ + #define SKIPWHITE(_x) {while(*(_x) && (risspace(*_x) || *(_x) == ',')) (_x)++;} + #define SKIPNONWHITE(_x){while(*(_x) &&!(risspace(*_x) || *(_x) == ',')) (_x)++;} + +-static int 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 1; +- } +- return 0; +-} +- + rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN, + int index, rpmsenseFlags tagflags) + { +@@ -165,10 +155,6 @@ + rstrlcpy(EVR, v, (ve-v) + 1); + if (rpmCharCheck(spec, EVR, ve-v, ".-_+:%{}~")) goto exit; + +- /* While ':' and '-' are valid, only one of each is valid. */ +- if (checkSep(EVR, '-', &emsg) || checkSep(EVR, ':', &emsg)) +- goto exit; +- + re = ve; /* ==> next token after EVR string starts here */ + } else + EVR = NULL; diff --git a/SOURCES/rpm-4.11.3-Initialize-plugins-based-on-DSO-discovery.patch b/SOURCES/rpm-4.11.3-Initialize-plugins-based-on-DSO-discovery.patch new file mode 100644 index 0000000..b941cdc --- /dev/null +++ b/SOURCES/rpm-4.11.3-Initialize-plugins-based-on-DSO-discovery.patch @@ -0,0 +1,91 @@ +From b62a75b137bde84ec8bac92c0238502b422c56ce Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Tue, 24 Jun 2014 14:37:38 +0300 +Subject: [PATCH] Initialize plugins based on DSO discovery + +- %__transaction_plugins style configuration is problematic for plugins + because we want plugins to be, well, pluggable. As in drop-in to + enable, which is not achievable with a single macro entry. Look up + all DSO's from the plugin dir and enable if a matching + %__transaction_foo macro is defined. +- This isn't optimal but it'll buy us the drop-in capability, which + is what matters most right now. We'll want to have forcability as + well later on (ie it should be possible to require given plugins + to be present) + +Conflicts: + lib/transaction.c +--- + lib/rpmplugins.c | 3 ++- + lib/transaction.c | 34 +++++++++++++++++----------------- + 2 files changed, 19 insertions(+), 18 deletions(-) + +diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c +index 7285f54..4e600db 100644 +--- a/lib/rpmplugins.c ++++ b/lib/rpmplugins.c +@@ -84,8 +84,9 @@ rpmRC rpmpluginsAddPlugin(rpmPlugins plugins, const char *type, const char *name + + path = rpmExpand("%{?__", type, "_", name, "}", NULL); + if (!path || rstreq(path, "")) { +- rpmlog(RPMLOG_ERR, _("Failed to expand %%__%s_%s macro\n"), ++ rpmlog(RPMLOG_DEBUG, _("Plugin %%__%s_%s not configured\n"), + type, name); ++ rc = RPMRC_NOTFOUND; + goto exit; + } + +diff --git a/lib/transaction.c b/lib/transaction.c +index 08a5643..386f107 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -1440,29 +1440,29 @@ static int rpmtsProcess(rpmts ts) + static rpmRC rpmtsSetupTransactionPlugins(rpmts ts) + { + rpmRC rc = RPMRC_OK; +- char *plugins = NULL, *plugin = NULL; +- const char *delims = ","; ++ ARGV_t files = NULL; ++ int nfiles = 0; ++ char *dsoPath = NULL; + +- plugins = rpmExpand("%{?__transaction_plugins}", NULL); +- if (!plugins || rstreq(plugins, "")) { +- goto exit; +- } ++ /* ++ * Assume allocated equals initialized. There are some oddball cases ++ * (verification of non-installed package) where this is not true ++ * currently but that's not a new issue. ++ */ + +- plugin = strtok(plugins, delims); +- while(plugin != NULL) { +- rpmlog(RPMLOG_DEBUG, "plugin is %s\n", plugin); +- if (!rpmpluginsPluginAdded(ts->plugins, (const char*)plugin)) { +- if (rpmpluginsAddPlugin(ts->plugins, "transaction", +- (const char*)plugin) == RPMRC_FAIL) { +- /* any configured plugin failing to load is a failure */ ++ dsoPath = rpmExpand("%{__plugindir}/*.so", NULL); ++ if (rpmGlob(dsoPath, &nfiles, &files) == 0) { ++ rpmPlugins tsplugins = rpmtsPlugins(ts); ++ for (int i = 0; i < nfiles; i++) { ++ char *bn = basename(files[i]); ++ bn[strlen(bn)-strlen(".so")] = '\0'; ++ if (rpmpluginsAddPlugin(tsplugins, "transaction", bn) == RPMRC_FAIL) + rc = RPMRC_FAIL; +- } + } +- plugin = strtok(NULL, delims); ++ files = argvFree(files); + } ++ free(dsoPath); + +-exit: +- free(plugins); + return rc; + } + +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch b/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch new file mode 100644 index 0000000..b5d214d --- /dev/null +++ b/SOURCES/rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch @@ -0,0 +1,27 @@ +--- rpm-4.11.3/scripts/brp-python-bytecompile.old 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/scripts/brp-python-bytecompile 2019-03-25 09:43:06.272804044 +0100 +@@ -6,12 +6,6 @@ + exit 0 + fi + +-# If we don't have a python interpreter, avoid changing anything. +-default_python=${1:-/usr/bin/python} +-if [ ! -x "$default_python" ]; then +- exit 0 +-fi +- + # Figure out how deep we need to descend. We could pick an insanely high + # number and hope it's enough, but somewhere, somebody's sure to run into it. + depth=`(find "$RPM_BUILD_ROOT" -type f -name "*.py" -print0 ; echo /) | \ +@@ -55,6 +49,11 @@ + fi + done + ++# If we don't have a python interpreter, avoid changing anything. ++default_python=${1:-/usr/bin/python} ++if [ ! -x "$default_python" ]; then ++ exit 0 ++fi + + # Handle other locations in the filesystem using the default python + # implementation: diff --git a/SOURCES/rpm-4.11.3-disable-collection-plugins.patch b/SOURCES/rpm-4.11.3-disable-collection-plugins.patch new file mode 100644 index 0000000..f80e525 --- /dev/null +++ b/SOURCES/rpm-4.11.3-disable-collection-plugins.patch @@ -0,0 +1,17 @@ +--- rpm-4.11.3/macros.in.orig 2015-08-19 11:09:48.785440045 +0200 ++++ rpm-4.11.3/macros.in 2015-08-19 11:10:15.322505916 +0200 +@@ -1038,10 +1038,10 @@ + #------------------------------------------------------------------------------ + # Collection specific macros + %__plugindir %{_libdir}/rpm-plugins +-%__collection_font %{__plugindir}/exec.so /usr/bin/fc-cache +-%__collection_java %{__plugindir}/exec.so /usr/bin/rebuild-gcj-db +-%__collection_sepolicy %{__plugindir}/sepolicy.so +-%__collection_sepolicy_flags 1 ++# %__collection_font %{__plugindir}/exec.so /usr/bin/fc-cache ++# %__collection_java %{__plugindir}/exec.so /usr/bin/rebuild-gcj-db ++# %__collection_sepolicy %{__plugindir}/sepolicy.so ++# %__collection_sepolicy_flags 1 + + # Transaction plugin macros + %__transaction_systemd_inhibit %{__plugindir}/systemd_inhibit.so diff --git a/SOURCES/rpm-4.11.3-update-config.guess.patch b/SOURCES/rpm-4.11.3-update-config.guess.patch new file mode 100644 index 0000000..bdaef03 --- /dev/null +++ b/SOURCES/rpm-4.11.3-update-config.guess.patch @@ -0,0 +1,364 @@ +--- rpm-4.11.3/config.guess.orig 2012-11-07 13:55:52.000000000 +0100 ++++ rpm-4.11.3/config.guess 2013-12-27 18:11:24.000000000 +0100 +@@ -1,14 +1,12 @@ + #! /bin/sh + # Attempt to guess a canonical system name. +-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +-# 2011, 2012 Free Software Foundation, Inc. ++# Copyright 1992-2013 Free Software Foundation, Inc. + +-timestamp='2012-02-10' ++timestamp='2013-06-10' + + # This file 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 of the License, or ++# the Free Software Foundation; either version 3 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, but +@@ -22,19 +20,17 @@ + # 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. +- +- +-# Originally written by Per Bothner. Please send patches (context +-# diff format) to and include a ChangeLog +-# entry. ++# the same distribution terms that you use for the rest of that ++# program. This Exception is an additional permission under section 7 ++# of the GNU General Public License, version 3 ("GPLv3"). + # +-# This script attempts to guess a canonical system name similar to +-# config.sub. If it succeeds, it prints the system name on stdout, and +-# exits with 0. Otherwise, it exits with 1. ++# Originally written by Per Bothner. + # + # You can get the latest version of this script from: + # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD ++# ++# Please send patches with a ChangeLog entry to config-patches@gnu.org. ++ + + me=`echo "$0" | sed -e 's,.*/,,'` + +@@ -54,9 +50,7 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 +-Free Software Foundation, Inc. ++Copyright 1992-2013 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -138,6 +132,27 @@ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + ++case "${UNAME_SYSTEM}" in ++Linux|GNU|GNU/*) ++ # If the system lacks a compiler, then just pick glibc. ++ # We could probably try harder. ++ LIBC=gnu ++ ++ eval $set_cc_for_build ++ cat <<-EOF > $dummy.c ++ #include ++ #if defined(__UCLIBC__) ++ LIBC=uclibc ++ #elif defined(__dietlibc__) ++ LIBC=dietlibc ++ #else ++ LIBC=gnu ++ #endif ++ EOF ++ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ++ ;; ++esac ++ + # Note: order is significant - the case branches are not exclusive. + + case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +@@ -200,6 +215,10 @@ + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; ++ *:Bitrig:*:*) ++ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` ++ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} ++ exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} +@@ -302,7 +321,7 @@ + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; +- arm:riscos:*:*|arm:RISCOS:*:*) ++ arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) +@@ -801,6 +820,9 @@ + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; ++ *:MINGW64*:*) ++ echo ${UNAME_MACHINE}-pc-mingw64 ++ exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; +@@ -852,21 +874,21 @@ + exit ;; + *:GNU:*:*) + # the GNU system +- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` ++ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland +- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu ++ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + aarch64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in +@@ -879,59 +901,54 @@ + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 +- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi +- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ++ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; ++ arc:Linux:*:* | arceb:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then +- echo ${UNAME_MACHINE}-unknown-linux-gnueabi ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + else +- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + cris:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + crisv32:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-gnu ++ echo ${UNAME_MACHINE}-axis-linux-${LIBC} + exit ;; + frv:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + hexagon:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:Linux:*:*) +- LIBC=gnu +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c +- #ifdef __dietlibc__ +- LIBC=dietlibc +- #endif +-EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` +- echo "${UNAME_MACHINE}-pc-linux-${LIBC}" ++ echo ${UNAME_MACHINE}-pc-linux-${LIBC} + exit ;; + ia64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m32r*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + m68*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build +@@ -950,54 +967,63 @@ + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` +- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ++ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + ;; ++ or1k:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + or32:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + padre:Linux:*:*) +- echo sparc-unknown-linux-gnu ++ echo sparc-unknown-linux-${LIBC} + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-gnu ++ echo hppa64-unknown-linux-${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +- PA7*) echo hppa1.1-unknown-linux-gnu ;; +- PA8*) echo hppa2.0-unknown-linux-gnu ;; +- *) echo hppa-unknown-linux-gnu ;; ++ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; ++ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; ++ *) echo hppa-unknown-linux-${LIBC} ;; + esac + exit ;; + ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-gnu ++ echo powerpc64-unknown-linux-${LIBC} + exit ;; + ppc:Linux:*:*) +- echo powerpc-unknown-linux-gnu ++ echo powerpc-unknown-linux-${LIBC} ++ exit ;; ++ ppc64le:Linux:*:*) ++ echo powerpc64le-unknown-linux-${LIBC} ++ exit ;; ++ ppcle:Linux:*:*) ++ echo powerpcle-unknown-linux-${LIBC} + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) +- echo ${UNAME_MACHINE}-ibm-linux ++ echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sh*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + tile*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + vax:Linux:*:*) +- echo ${UNAME_MACHINE}-dec-linux-gnu ++ echo ${UNAME_MACHINE}-dec-linux-${LIBC} + exit ;; + x86_64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + xtensa*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-gnu ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. +@@ -1201,6 +1227,9 @@ + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; ++ x86_64:Haiku:*:*) ++ echo x86_64-unknown-haiku ++ exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; +@@ -1227,19 +1256,21 @@ + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown +- case $UNAME_PROCESSOR in +- i386) +- eval $set_cc_for_build +- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then +- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ +- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ +- grep IS_64BIT_ARCH >/dev/null +- then +- UNAME_PROCESSOR="x86_64" +- fi +- fi ;; +- unknown) UNAME_PROCESSOR=powerpc ;; +- esac ++ eval $set_cc_for_build ++ if test "$UNAME_PROCESSOR" = unknown ; then ++ UNAME_PROCESSOR=powerpc ++ fi ++ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi ++ fi + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) +@@ -1256,7 +1287,7 @@ + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; +- NSE-?:NONSTOP_KERNEL:*:*) ++ NSE-*:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) +@@ -1330,9 +1361,6 @@ + exit ;; + esac + +-#echo '(No uname command or uname output not recognized.)' 1>&2 +-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 +- + eval $set_cc_for_build + cat >$dummy.c < +Date: Wed, 22 Jan 2014 10:56:00 +0200 +Subject: [PATCH] Add %make_build macro for hiding parallel-build magic from + specs (ticket #115) + +- This allows simplifying the make invokations from specs. In particular + the parallel build options no longer need to be messed with from specs, + and %__make can be overridden to force a different make implementation + to be used throughout the spec. +- While a lot of software builds correctly in parallel, there are always + exceptions... together with _smp_ncpus_max macro this can now be + expressed with a separate "%global _smp_ncpus_max 1" (or any other + arbitrary value beyond which parallel build is buggy) line which + is easy to grep for and experiment with. +--- + macros.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/macros.in b/macros.in +index 5a075a3..9c7a111 100644 +--- a/macros.in ++++ b/macros.in +@@ -861,6 +861,10 @@ package or when debugging this package.\ + --infodir=%{_infodir} + + #------------------------------------------------------------------------------ ++# The "make" analogue, hiding the _smp_mflags magic from specs ++%make_build %{__make} %{?_smp_mflags} ++ ++#------------------------------------------------------------------------------ + # The make install analogue of %configure for modern autotools: + %make_install %{__make} install DESTDIR=%{?buildroot} + +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-Add-noplugins.patch b/SOURCES/rpm-4.11.x-Add-noplugins.patch new file mode 100644 index 0000000..47813cb --- /dev/null +++ b/SOURCES/rpm-4.11.x-Add-noplugins.patch @@ -0,0 +1,109 @@ +From 454285b3a259c6bbf5fee4300fac2f50a40e4ac4 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Tue, 24 Jun 2014 15:11:32 +0300 +Subject: [PATCH] Add disabler flag + --noplugins cli switch for plugins + +- Always knew we'd need a plugin disabler flag sooner than later but + didn't realize enabled plugins would fail basically the entire + test-suite :) +- Enable --noplugins for entire test-suite for now, but eventually + we'll need to come up with ways to test plugins as well +--- + lib/poptALL.c | 5 +++++ + lib/rpmts.h | 2 +- + lib/transaction.c | 2 +- + python/rpmmodule.c | 1 + + tests/atlocal.in | 2 +- + 5 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/lib/poptALL.c b/lib/poptALL.c +index 31e1210..2e894e0 100644 +--- a/lib/poptALL.c ++++ b/lib/poptALL.c +@@ -187,6 +187,11 @@ struct poptOption rpmcliAllPoptTable[] = { + N_("read instead of default file(s)"), + N_("") }, + ++ /* XXX this is a bit out of place here but kinda unavoidable... */ ++ { "noplugins", '\0', POPT_BIT_SET, ++ &rpmIArgs.transFlags, RPMTRANS_FLAG_NOPLUGINS, ++ N_("don't enable any plugins"), NULL }, ++ + { "nodigest", '\0', 0, 0, RPMCLI_POPT_NODIGEST, + N_("don't verify package digest(s)"), NULL }, + { "nohdrchk", '\0', POPT_ARGFLAG_DOC_HIDDEN, 0, RPMCLI_POPT_NOHDRCHK, +diff --git a/lib/rpmts.h b/lib/rpmts.h +index e1b260d..5231c80 100644 +--- a/lib/rpmts.h ++++ b/lib/rpmts.h +@@ -34,7 +34,7 @@ enum rpmtransFlags_e { + RPMTRANS_FLAG_NOTRIGGERS = (1 << 4), /*!< from --notriggers */ + RPMTRANS_FLAG_NODOCS = (1 << 5), /*!< from --excludedocs */ + RPMTRANS_FLAG_ALLFILES = (1 << 6), /*!< from --allfiles */ +- /* bit 7 unused */ ++ RPMTRANS_FLAG_NOPLUGINS = (1 << 7), /*!< from --noplugins */ + RPMTRANS_FLAG_NOCONTEXTS = (1 << 8), /*!< from --nocontexts */ + /* bits 9-15 unused */ + RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16), /*!< from --notriggerprein */ +diff --git a/lib/transaction.c b/lib/transaction.c +index 0317c1e..736f64d 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -1361,6 +1361,9 @@ rpmRC rpmtsSetupTransactionPlugins(rpmts ts) + * (verification of non-installed package) where this is not true + * currently but that's not a new issue. + */ ++ ++ if (rpmtsFlags(ts) & RPMTRANS_FLAG_NOPLUGINS) ++ return RPMRC_OK; + + dsoPath = rpmExpand("%{__plugindir}/*.so", NULL); + if (rpmGlob(dsoPath, &nfiles, &files) == 0) { +diff --git a/python/rpmmodule.c b/python/rpmmodule.c +index e0fcef0..4e6fe27 100644 +--- a/python/rpmmodule.c ++++ b/python/rpmmodule.c +@@ -428,6 +428,7 @@ static int initModule(PyObject *m) + REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERS); + REGISTER_ENUM(RPMTRANS_FLAG_NODOCS); + REGISTER_ENUM(RPMTRANS_FLAG_ALLFILES); ++ REGISTER_ENUM(RPMTRANS_FLAG_NOPLUGINS); + REGISTER_ENUM(RPMTRANS_FLAG_KEEPOBSOLETE); + REGISTER_ENUM(RPMTRANS_FLAG_NOCONTEXTS); + REGISTER_ENUM(RPMTRANS_FLAG_REPACKAGE); +diff --git a/tests/atlocal.in b/tests/atlocal.in +index 10ff27a..c2a07d5 100644 +--- a/tests/atlocal.in ++++ b/tests/atlocal.in +@@ -30,6 +30,6 @@ function run() + function runroot() + { + (cd ${RPMTEST} && \ +- MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" ++ MAGIC="/magic/magic" FAKECHROOT_BASE="${RPMTEST}" fakechroot "$@" --define "_topdir /build" --noplugins + ) + } +-- +2.5.5 + +--- current/doc/rpm.8.orig 2016-07-14 14:34:14.286125290 +0200 ++++ current/doc/rpm.8 2016-07-14 14:36:29.715481426 +0200 +@@ -86,7 +86,7 @@ + [\fB--excludedocs\fR] [\fB--force\fR] [\fB-h,--hash\fR] + [\fB--ignoresize\fR] [\fB--ignorearch\fR] [\fB--ignoreos\fR] + [\fB--includedocs\fR] [\fB--justdb\fR] [\fB--nocollections\fR] +- [\fB--nodeps\fR] [\fB--nodigest\fR] [\fB--nosignature\fR] ++ [\fB--nodeps\fR] [\fB--nodigest\fR] [\fB--nosignature\fR] [\fB--noplugins\fR] + [\fB--noorder\fR] [\fB--noscripts\fR] [\fB--notriggers\fR] + [\fB--oldpackage\fR] [\fB--percent\fR] [\fB--prefix \fINEWPATH\fB\fR] + [\fB--relocate \fIOLDPATH\fB=\fINEWPATH\fB\fR] +@@ -269,6 +269,9 @@ + Don't reorder the packages for an install. The list of + packages would normally be reordered to satisfy dependencies. + .TP ++\fB--noplugins\fR ++Do not load and execute plugins. ++.TP + \fB--noscripts\fR + .TP + \fB--nopre\fR diff --git a/SOURCES/rpm-4.11.x-CVE-2014-8118.patch b/SOURCES/rpm-4.11.x-CVE-2014-8118.patch new file mode 100644 index 0000000..79e2a00 --- /dev/null +++ b/SOURCES/rpm-4.11.x-CVE-2014-8118.patch @@ -0,0 +1,12 @@ +--- rpm-4.11.1.orig/lib/cpio.c 2014-11-28 12:21:50.444158675 +0100 ++++ rpm-4.11.1/lib/cpio.c 2014-11-28 12:22:53.776453253 +0100 +@@ -296,6 +296,9 @@ + st->st_rdev = makedev(major, minor); + + GET_NUM_FIELD(hdr.namesize, nameSize); ++ if (nameSize <= 0 || nameSize > 4096) { ++ return CPIOERR_BAD_HEADER; ++ } + + *path = xmalloc(nameSize + 1); + read = Fread(*path, nameSize, 1, cpio->fd); diff --git a/SOURCES/rpm-4.11.x-Fix-Python-hdr-refcount.patch b/SOURCES/rpm-4.11.x-Fix-Python-hdr-refcount.patch new file mode 100644 index 0000000..99f8420 --- /dev/null +++ b/SOURCES/rpm-4.11.x-Fix-Python-hdr-refcount.patch @@ -0,0 +1,72 @@ +From 40326b5724b0cd55a21b2d86eeef344e4826f863 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Thu, 20 Oct 2016 16:06:06 +0200 +Subject: [PATCH] Do not call headerLink() in hdr_Wrap() + +as headers often already have an ref count of 1. +Add headerLink() only where it is necessary. +Plugs memory leaks in Python binding +Resolves: rhbz:#1358467 +--- + python/header-py.c | 4 ++-- + python/rpmmi-py.c | 2 ++ + python/rpmts-py.c | 1 - + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/python/header-py.c b/python/header-py.c +index 63167d9..5d98f89 100644 +--- a/python/header-py.c ++++ b/python/header-py.c +@@ -394,6 +394,7 @@ static PyObject *hdr_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds) + h = headerNew(); + } else if (CAPSULE_CHECK(obj)) { + h = CAPSULE_EXTRACT(obj, "rpm._C_Header"); ++ headerLink(h); + } else if (hdrObject_Check(obj)) { + h = headerCopy(((hdrObject*) obj)->h); + } else if (PyBytes_Check(obj)) { +@@ -778,8 +779,7 @@ PyObject * hdr_Wrap(PyTypeObject *subtype, Header h) + { + hdrObject * hdr = (hdrObject *)subtype->tp_alloc(subtype, 0); + if (hdr == NULL) return NULL; +- +- hdr->h = headerLink(h); ++ hdr->h = h; + return (PyObject *) hdr; + } + +diff --git a/python/rpmmi-py.c b/python/rpmmi-py.c +index 0e27575..379cafb 100644 +--- a/python/rpmmi-py.c ++++ b/python/rpmmi-py.c +@@ -1,6 +1,7 @@ + #include "rpmsystem-py.h" + + #include ++#include + + #include "rpmmi-py.h" + #include "header-py.h" +@@ -74,6 +75,7 @@ rpmmi_iternext(rpmmiObject * s) + s->mi = rpmdbFreeIterator(s->mi); + return NULL; + } ++ headerLink(h); + return hdr_Wrap(&hdr_Type, h); + } + +diff --git a/python/rpmts-py.c b/python/rpmts-py.c +index 13951df..f05371c 100644 +--- a/python/rpmts-py.c ++++ b/python/rpmts-py.c +@@ -384,7 +384,6 @@ rpmts_HdrFromFdno(rpmtsObject * s, PyObject *arg) + + if (rpmrc == RPMRC_OK) { + ho = hdr_Wrap(&hdr_Type, h); +- h = headerFree(h); /* ref held by python object */ + } else { + Py_INCREF(Py_None); + ho = Py_None; +-- +2.9.3 + diff --git a/SOURCES/rpm-4.11.x-Fix-off-by-one-base64.patch b/SOURCES/rpm-4.11.x-Fix-off-by-one-base64.patch new file mode 100644 index 0000000..24cca69 --- /dev/null +++ b/SOURCES/rpm-4.11.x-Fix-off-by-one-base64.patch @@ -0,0 +1,30 @@ +From 0964912b94f9f48a0a812fbfbb2f996dbd93eff0 Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Wed, 25 May 2016 12:31:19 +0100 +Subject: [PATCH] Fix off-by-one error + +There's an off-by-one error in base64_decode_value which results in undefined behaviour: + + void* out; + size_t len; + rpmBase64Decode("\x7b", &out, &len); +--- + rpmio/base64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmio/base64.c b/rpmio/base64.c +index 60e67d4..4424aab 100644 +--- a/rpmio/base64.c ++++ b/rpmio/base64.c +@@ -104,7 +104,7 @@ static int base64_decode_value(unsigned char value_in) + { + static const int decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; + value_in -= 43; +- if (value_in > sizeof(decoding)/sizeof(int)) ++ if (value_in >= sizeof(decoding)/sizeof(int)) + return -1; + return decoding[value_in]; + } +-- +2.9.3 + diff --git a/SOURCES/rpm-4.11.x-Handle-line-continuation.patch b/SOURCES/rpm-4.11.x-Handle-line-continuation.patch new file mode 100644 index 0000000..e96ec3b --- /dev/null +++ b/SOURCES/rpm-4.11.x-Handle-line-continuation.patch @@ -0,0 +1,31 @@ +From 817959609b95afe34ce0f7f6c3dc5d7d0d9a8470 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 25 Jun 2014 11:28:02 +0300 +Subject: [PATCH] Handle line continuation in grabArgs() (related to + RhBug:1045723) + +- Commit 1bdcd0500865efd3566efd7f951228f69b58e755 to fix RhBug:1045723 + broke some funky java macros in Fedora which include line continuation + in the argument (comments 6-7 in the bug). That it ever worked seems + far more like luck than by design but since this seems to fix it... +--- + rpmio/macro.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/rpmio/macro.c b/rpmio/macro.c +index 12a65a4..b00155c 100644 +--- a/rpmio/macro.c ++++ b/rpmio/macro.c +@@ -771,7 +771,8 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se, + + exit: + argvFree(argv); +- return (*lastc == '\0' || *lastc == '\n') ? lastc : lastc + 1; ++ return ((*lastc == '\0' || *lastc == '\n') && *(lastc-1) != '\\') ? ++ lastc : lastc + 1; + } + + /** +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-add-g-libs.patch b/SOURCES/rpm-4.11.x-add-g-libs.patch new file mode 100644 index 0000000..9ffa73d --- /dev/null +++ b/SOURCES/rpm-4.11.x-add-g-libs.patch @@ -0,0 +1,86 @@ +--- rpm-4.11.3/scripts/find-debuginfo.sh.old 2019-01-02 13:14:10.283068553 +0100 ++++ rpm-4.11.3/scripts/find-debuginfo.sh 2019-03-21 09:36:06.196400883 +0100 +@@ -3,6 +3,7 @@ + #for inclusion in an rpm spec file. + # + # Usage: find-debuginfo.sh [--strict-build-id] [-g] [-r] [-m] ++# [--g-libs] + # [-o debugfiles.list] + # [--run-dwz] [--dwz-low-mem-die-limit N] + # [--dwz-max-die-limit N] +@@ -10,6 +11,8 @@ + # [builddir] + # + # The -g flag says to use strip -g instead of full strip on DSOs or EXEs. ++# The --g-libs flag says to use strip -g instead of full strip ONLY on DSOs. ++# Options -g and --g-libs are mutually exclusive. + # The --strict-build-id flag says to exit with failure status if + # any ELF binary processed fails to contain a build-id note. + # The -r flag says to use eu-strip --reloc-debug-sections. +@@ -32,6 +35,9 @@ + # With -g arg, pass it to strip on libraries or executables. + strip_g=false + ++# With --g-libs arg, pass it to strip on libraries. ++strip_glibs=false ++ + # with -r arg, pass --reloc-debug-sections to eu-strip. + strip_r=false + +@@ -65,6 +71,9 @@ + dwz_max_die_limit=$2 + shift + ;; ++ --g-libs) ++ strip_glibs=true ++ ;; + -g) + strip_g=true + ;; +@@ -100,6 +109,11 @@ + shift + done + ++if ("$strip_g" = "true") && ("$strip_glibs" = "true"); then ++ echo >&2 "*** ERROR: -g and --g-libs cannot be used together" ++ exit 2 ++fi ++ + i=0 + while ((i < nout)); do + outs[$i]="$BUILDDIR/${outs[$i]}" +@@ -132,6 +146,9 @@ + application/x-sharedlib*) g=-g ;; + application/x-executable*) g=-g ;; + esac ++ $strip_glibs && case "$(file -bi "$2")" in ++ application/x-sharedlib*) g=-g ;; ++ esac + eu-strip --remove-comment $r $g -f "$1" "$2" || exit + chmod 444 "$1" || exit + } +@@ -317,7 +334,23 @@ + chmod u-w "$f" + fi + +- $include_minidebug && add_minidebug "${debugfn}" "$f" ++ # strip -g implies we have full symtab, don't add mini symtab in that case. ++ # It only makes sense to add a minisymtab for executables and shared ++ # libraries. Other executable ELF files (like kernel modules) don't need it. ++ if [ "$include_minidebug" = "true" -a "$strip_g" = "false" ]; then ++ skip_mini=true ++ if [ "$strip_glibs" = "false" ]; then ++ case "$(file -bi "$f")" in ++ application/x-sharedlib*) skip_mini=false ;; ++ esac ++ fi ++ case "$(file -bi "$f")" in ++ application/x-sharedlib*) skip_mini=false ;; ++ application/x-executable*) skip_mini=false ;; ++ application/x-pie-executable*) skip_mini=false ;; ++ esac ++ $skip_mini || add_minidebug "${debugfn}" "$f" ++ fi + + echo "./${f#$RPM_BUILD_ROOT}" >> "$ELFBINSFILE" + diff --git a/SOURCES/rpm-4.11.x-bdb-warings.patch b/SOURCES/rpm-4.11.x-bdb-warings.patch new file mode 100644 index 0000000..9241194 --- /dev/null +++ b/SOURCES/rpm-4.11.x-bdb-warings.patch @@ -0,0 +1,10 @@ +--- rpm-4.11.3/lib/backend/db3.c.orig 2016-04-22 09:16:15.019084419 +0200 ++++ rpm-4.11.3/lib/backend/db3.c 2016-04-22 09:17:16.448291533 +0200 +@@ -190,6 +190,7 @@ + dbenv->set_alloc(dbenv, rmalloc, rrealloc, NULL); + dbenv->set_errcall(dbenv, NULL); + dbenv->set_errpfx(dbenv, _errpfx); ++ dbenv->set_msgfile(dbenv, stderr); + + /* + * These enable automatic stale lock removal. diff --git a/SOURCES/rpm-4.11.x-broken-pipe.patch b/SOURCES/rpm-4.11.x-broken-pipe.patch new file mode 100644 index 0000000..d9aa9b6 --- /dev/null +++ b/SOURCES/rpm-4.11.x-broken-pipe.patch @@ -0,0 +1,45 @@ +From f515907c71c03019a52f89921c41303fa5926b2a Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Fri, 12 Jun 2015 13:38:23 +0200 +Subject: [PATCH] Don't show error message if log function fails because of + broken pipe. + +- regression from commit 11b005c957fb0e52d42078480104d3e27e95e609 +- rhbz: #1231138 +--- + rpmio/rpmlog.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c +index f43e622..43ae36f 100644 +--- a/rpmio/rpmlog.c ++++ b/rpmio/rpmlog.c +@@ -4,7 +4,8 @@ + + #include "system.h" + #include ++#include + #include + #include + #include "debug.h" + +@@ -127,13 +128,13 @@ static int rpmlogDefault(FILE *stdlog, rpmlogRec rec) + break; + } + +- if (fputs(rpmlogLevelPrefix(rec->pri), msgout) == EOF) ++ if (fputs(rpmlogLevelPrefix(rec->pri), msgout) == EOF && errno != EPIPE) + perror("Error occurred during writing of a log message"); + +- if (fputs(rec->message, msgout) == EOF) ++ if (fputs(rec->message, msgout) == EOF && errno != EPIPE) + perror("Error occurred during writing of a log message"); + +- if (fflush(msgout) == EOF) ++ if (fflush(msgout) == EOF && errno != EPIPE) + perror("Error occurred during writing of a log message"); + + return (rec->pri <= RPMLOG_CRIT ? RPMLOG_EXIT : 0); +-- +1.9.3 + diff --git a/SOURCES/rpm-4.11.x-chmod.patch b/SOURCES/rpm-4.11.x-chmod.patch new file mode 100644 index 0000000..2a0636b --- /dev/null +++ b/SOURCES/rpm-4.11.x-chmod.patch @@ -0,0 +1,22 @@ +--- rpm-4.11.1/lib/fsm.c.orig 2014-11-13 13:38:56.742934031 +0100 ++++ rpm-4.11.1/lib/fsm.c 2014-11-13 13:42:13.036380024 +0100 +@@ -726,12 +726,17 @@ + { + FD_t wfd = NULL; + const struct stat * st = &fsm->sb; +- rpm_loff_t left = st->st_size; ++ rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix); + const unsigned char * fidigest = NULL; + pgpHashAlgo digestalgo = 0; + int rc = 0; + +- wfd = Fopen(fsm->path, "w.ufdio"); ++ /* Create the file with 000 permissions. */ ++ { ++ mode_t old_umask = umask(0777); ++ wfd = Fopen(fsm->path, "w.ufdio"); ++ umask(old_umask); ++ } + if (Ferror(wfd)) { + rc = CPIOERR_OPEN_FAILED; + goto exit; diff --git a/SOURCES/rpm-4.11.x-color-skipping.patch b/SOURCES/rpm-4.11.x-color-skipping.patch new file mode 100644 index 0000000..46b77cf --- /dev/null +++ b/SOURCES/rpm-4.11.x-color-skipping.patch @@ -0,0 +1,30 @@ +From 2f31395dcd49459c775caaadefa0513181cd12ff Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Wed, 17 Dec 2014 12:53:30 +0100 +Subject: [PATCH] Fix color skipping of multiple files with the same content. + +- If we process some file and we find another file with the same path + and the same content and this other file is skipped for color then + the currently being processed file has to be skipped for color too. + (RhBug:1170124) +--- + lib/transaction.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/lib/transaction.c b/lib/transaction.c +index 736f64d..2d1432e 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -587,6 +587,9 @@ assert(otherFi != NULL); + if (!(oflags & RPMFILE_GHOST)) { + rpmfsSetAction(fs, i, FA_SKIP); + } ++ /* if the other file is color skipped then skip this file too */ ++ } else if (oaction == FA_SKIPCOLOR) { ++ rpmfsSetAction(fs, i, FA_SKIPCOLOR); + } + } + +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-correct-g-libs.patch b/SOURCES/rpm-4.11.x-correct-g-libs.patch new file mode 100644 index 0000000..70ed760 --- /dev/null +++ b/SOURCES/rpm-4.11.x-correct-g-libs.patch @@ -0,0 +1,11 @@ +--- rpm-4.11.3/scripts/find-debuginfo.sh.old 2019-07-26 10:03:50.390264038 +0200 ++++ rpm-4.11.3/scripts/find-debuginfo.sh 2019-07-26 10:24:12.540154792 +0200 +@@ -109,7 +109,7 @@ + shift + done + +-if ("$strip_g" = "true") && ("$strip_glibs" = "true"); then ++if [ "$strip_g" = "true" ] && [ "$strip_glibs" = "true" ]; then + echo >&2 "*** ERROR: -g and --g-libs cannot be used together" + exit 2 + fi diff --git a/SOURCES/rpm-4.11.x-defattr-permissions.patch b/SOURCES/rpm-4.11.x-defattr-permissions.patch new file mode 100644 index 0000000..f8e1b50 --- /dev/null +++ b/SOURCES/rpm-4.11.x-defattr-permissions.patch @@ -0,0 +1,16 @@ +--- rpm-4.8.0/build/files.c.defattr-permissions 2015-02-23 10:45:47.043339687 +0100 ++++ rpm-4.8.0/build/files.c 2015-02-23 10:53:55.673480702 +0100 +@@ -1446,6 +1446,12 @@ + if (fl->def.ar.ar_dmodestr) { + fileMode &= S_IFMT; + fileMode |= fl->def.ar.ar_dmode; ++ } else if (fl->def.ar.ar_fmodestr){ ++ rpmlog(RPMLOG_WARNING, _("%%defattr doesn't define directory " ++ "mode so file mode defined in %%defattr is used for " ++ "directory: %s\n"), diskPath); ++ fileMode &= S_IFMT; ++ fileMode |= fl->def.ar.ar_fmode; + } + } else if (!S_ISLNK(fileMode) && fl->def.ar.ar_fmodestr) { + fileMode &= S_IFMT; + diff --git a/SOURCES/rpm-4.11.x-define-PY_SSIZE_T_CLEAN.patch b/SOURCES/rpm-4.11.x-define-PY_SSIZE_T_CLEAN.patch new file mode 100644 index 0000000..b96d58c --- /dev/null +++ b/SOURCES/rpm-4.11.x-define-PY_SSIZE_T_CLEAN.patch @@ -0,0 +1,32 @@ +From f0a58d1dced6215b7caaa70db17d54834e0cd44e Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Fri, 18 Sep 2015 15:29:25 +0200 +Subject: [PATCH] Define PY_SSIZE_T_CLEAN + +When PyArg_ParseTupleAndKeywords() is used with format argument "s#" +that means get a string and his length then the length is returned as +as a Py_ssize_t in python3 but as an int in python2, which casues +a problem because rpmfd_write() that uses PyArg_ParseTupleAndKeywords() +expects the length as a Py_ssize_t always. This problem affects big +endian systems with python2 as default. If PY_SSIZE_T_CLEAN is defined +then PyArg_ParseTupleAndKeywords() returns the length as a Py_ssize_t +in both python2 and python3. +--- + python/rpmsystem-py.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h +index 50e8770..c8423e3 100644 +--- a/python/rpmsystem-py.h ++++ b/python/rpmsystem-py.h +@@ -5,6 +5,7 @@ + #include + #endif + ++#define PY_SSIZE_T_CLEAN + #include + #include + +-- +1.9.3 + diff --git a/SOURCES/rpm-4.11.x-dependson.patch b/SOURCES/rpm-4.11.x-dependson.patch new file mode 100644 index 0000000..7b084fd --- /dev/null +++ b/SOURCES/rpm-4.11.x-dependson.patch @@ -0,0 +1,13 @@ +diff -up rpm-4.11.3/lib/depends.c.dependson rpm-4.11.3/lib/depends.c +--- rpm-4.11.3/lib/depends.c.dependson 2019-10-04 10:46:35.399545965 +0300 ++++ rpm-4.11.3/lib/depends.c 2019-10-04 10:47:10.693542015 +0300 +@@ -117,7 +117,8 @@ static int removePackage(rpmts ts, Heade + tsmem->order = xrealloc(tsmem->order, sizeof(*tsmem->order) * tsmem->orderAlloced); + } + +- rpmteSetDependsOn(p, depends); ++ if (depends) ++ rpmteSetDependsOn(p, depends); + + tsmem->order[tsmem->orderCount] = p; + tsmem->orderCount++; diff --git a/SOURCES/rpm-4.11.x-deprecate-addsign.patch b/SOURCES/rpm-4.11.x-deprecate-addsign.patch new file mode 100644 index 0000000..eb7a1a6 --- /dev/null +++ b/SOURCES/rpm-4.11.x-deprecate-addsign.patch @@ -0,0 +1,25 @@ +From 5dd555adbed5dae6a9255bb17074d2b043d0244e Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Fri, 27 Mar 2015 09:57:29 +0100 +Subject: [PATCH] Add deprecation warning to description of "--addsign" + +--- + rpmpopt.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmpopt.in b/rpmpopt.in +index fe4f40f..ca95702 100644 +--- a/rpmpopt.in ++++ b/rpmpopt.in +@@ -188,7 +188,7 @@ rpmbuild alias --buildpolicy --define '__os_install_post %{_rpmconfigdir}/brp-!# + # Minimally preserve rpmbuild's --sign functionality + rpmbuild alias --sign \ + --pipe "grep '.*: .*\.rpm$'|cut -d: -f2|xargs -r rpm --addsign" \ +- --POPTdesc=$"generate GPG signature" ++ --POPTdesc=$"generate GPG signature (deprecated, use command rpmsign instead)" + + rpmsign alias --key-id --define '_gpg_name !#:+' \ + --POPTdesc=$"key id/name to sign with" \ +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-dirlink-verify.patch b/SOURCES/rpm-4.11.x-dirlink-verify.patch new file mode 100644 index 0000000..a639c2d --- /dev/null +++ b/SOURCES/rpm-4.11.x-dirlink-verify.patch @@ -0,0 +1,27 @@ +commit 3ccd774255b8215733e0bdfdf5a683da9dd10923 +Author: Panu Matilainen +Date: Wed Sep 24 10:31:51 2014 +0300 + + Handle directory replaced with a symlink to one in verify (RhBug:1101861) + + - An unforced installation must not cause verification failures - we + permit directories to be replaced by directory symlinks during + install so we need to do the same in verify too. + +diff --git a/lib/verify.c b/lib/verify.c +index eb6f2e1..84e9843 100644 +--- a/lib/verify.c ++++ b/lib/verify.c +@@ -96,6 +96,12 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, + return 1; + } + ++ /* If we expected a directory but got a symlink to one, follow the link */ ++ if (S_ISDIR(fmode) && S_ISLNK(sb.st_mode) && stat(fn, &sb) != 0) { ++ *res |= RPMVERIFY_LSTATFAIL; ++ return 1; ++ } ++ + /* Links have no mode, other types have no linkto */ + if (S_ISLNK(sb.st_mode)) + flags &= ~(RPMVERIFY_MODE); diff --git a/SOURCES/rpm-4.11.x-disk-space-calculation.patch b/SOURCES/rpm-4.11.x-disk-space-calculation.patch new file mode 100644 index 0000000..6e8c4ee --- /dev/null +++ b/SOURCES/rpm-4.11.x-disk-space-calculation.patch @@ -0,0 +1,77 @@ +--- rpm-4.11.3/lib/transaction.c.old 2019-01-02 13:14:10.304068576 +0100 ++++ rpm-4.11.3/lib/transaction.c 2019-02-28 11:03:32.164403544 +0100 +@@ -368,6 +368,11 @@ + return rConflicts; + } + ++static rpm_loff_t DivideHardlinkSize(int nlink, rpm_loff_t originalSize) ++{ ++ return (originalSize / nlink) + 1; ++} ++ + /** + * handleInstInstalledFiles. + * @param ts transaction set +@@ -384,6 +389,8 @@ + { + rpmfs fs = rpmteGetFileStates(p); + int isCfgFile = ((rpmfiFFlagsIndex(otherFi, ofx) | rpmfiFFlagsIndex(fi, fx)) & RPMFILE_CONFIG); ++ rpm_loff_t otherFileSize; ++ int nlink; + + if (XFA_SKIPPING(rpmfsGetAction(fs, fx))) + return; +@@ -445,7 +452,15 @@ + action = rpmfiDecideFateIndex(otherFi, ofx, fi, fx, skipMissing); + rpmfsSetAction(fs, fx, action); + } +- rpmfiSetFReplacedSizeIndex(fi, fx, rpmfiFSizeIndex(otherFi, ofx)); ++ ++ otherFileSize = rpmfiFSizeIndex(otherFi, ofx); ++ ++ /* Only an appropriate fraction of the file size of a hardlink */ ++ nlink = rpmfiFNlinkIndex(otherFi, ofx); ++ if (nlink > 1) ++ otherFileSize = DivideHardlinkSize(nlink, otherFileSize); ++ ++ rpmfiSetFReplacedSizeIndex(fi, fx, otherFileSize); + } + + /** +@@ -470,6 +485,8 @@ + rpmfileAttrs FFlags; + struct rpmffi_s * recs; + int numRecs; ++ rpm_loff_t fileSize; ++ int nlink; + + if (XFA_SKIPPING(rpmfsGetAction(fs, i))) + continue; +@@ -633,9 +650,15 @@ + break; + } + ++ fileSize = rpmfiFSizeIndex(fi, i); ++ nlink = rpmfiFNlinkIndex(fi, i); ++ /* Only an appropriate fraction of the file sizeof a hardlink */ ++ if (nlink > 1) ++ fileSize = DivideHardlinkSize(nlink, fileSize); ++ + /* Update disk space info for a file. */ + rpmtsUpdateDSI(ts, fpEntryDev(fpc, fiFps), fpEntryDir(fpc, fiFps), +- rpmfiFSizeIndex(fi, i), rpmfiFReplacedSizeIndex(fi, i), ++ fileSize, rpmfiFReplacedSizeIndex(fi, i), + fixupSize, rpmfsGetAction(fs, i)); + + } +--- rpm-4.11.3/lib/rpmfi.h.old 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/lib/rpmfi.h 2019-01-07 09:57:40.407787724 +0100 +@@ -396,7 +396,7 @@ + + #define RPMFI_FLAGS_ERASE \ + (RPMFI_NOFILECLASS | RPMFI_NOFILELANGS | \ +- RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | RPMFI_NOFILEINODES | \ ++ RPMFI_NOFILEMTIMES | RPMFI_NOFILERDEVS | \ + RPMFI_NOFILEVERIFYFLAGS) + + #define RPMFI_FLAGS_INSTALL \ diff --git a/SOURCES/rpm-4.11.x-do-not-filter-ld64.patch b/SOURCES/rpm-4.11.x-do-not-filter-ld64.patch new file mode 100644 index 0000000..422bc67 --- /dev/null +++ b/SOURCES/rpm-4.11.x-do-not-filter-ld64.patch @@ -0,0 +1,27 @@ +From f6771b6722f0df097f9c61fc1b487f6f0ee402e8 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Tue, 30 Jul 2013 16:35:21 +0200 +Subject: [PATCH] Do not filter ld64.* and ld64-* provides and requires Fixes + #988373 + +--- + tools/elfdeps.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/elfdeps.c b/tools/elfdeps.c +index 906de10..8679f89 100644 +--- a/tools/elfdeps.c ++++ b/tools/elfdeps.c +@@ -52,7 +52,8 @@ static int skipSoname(const char *soname) + if (!strstr(soname, ".so")) + return 1; + +- if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3)) ++ if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3) || ++ rstreqn(soname, "ld64.", 3) || rstreqn(soname, "ld64-", 3)) + return 0; + + if (rstreqn(soname, "lib", 3)) +-- +1.7.11.7 + diff --git a/SOURCES/rpm-4.11.x-elem-progress.patch b/SOURCES/rpm-4.11.x-elem-progress.patch new file mode 100644 index 0000000..7025075 --- /dev/null +++ b/SOURCES/rpm-4.11.x-elem-progress.patch @@ -0,0 +1,77 @@ +From 08473f4ad8d79e6d232832c6863b2848f8a41734 Mon Sep 17 00:00:00 2001 +From: Michal Domonkos +Date: Mon, 7 Dec 2015 17:13:26 +0100 +Subject: [PATCH] Add RPMCALLBACK_ELEM_PROGRESS callback type + +Currently, there's no callback type that would be issued per each +transaction element. RPMCALLBACK_TRANS_PROGRESS is only issued during +the prepare phase but not when packages are actually installed or +erased. Likewise, RPMCALLBACK_INST_ST* and RPMCALLBACK_UNINST_ST* won't +be issued if an install or erase operation is skipped for some reason (a +script or package upgrade failure). + +Having such a callback would allow the Python API consumers to always +know upfront which element is about to be processed, before any other +callbacks are issued. This is important since not every callback type +carries enough data about the subject package; while the INST types +provide the user object passed to a former addInstall call, the UNINST +types only provide the package name (which may not be unique within the +transaction set). + +This commit adds such a callback. + +(cherry picked from commit 448db68ceb5be3c7171b7ec0ea908d905792dc2f) +--- + lib/rpmcallback.h | 1 + + lib/transaction.c | 4 ++++ + python/rpmmodule.c | 1 + + 3 files changed, 6 insertions(+) + +diff --git a/lib/rpmcallback.h b/lib/rpmcallback.h +index b3b05c6c1..b6d434c01 100644 +--- a/lib/rpmcallback.h ++++ b/lib/rpmcallback.h +@@ -31,6 +31,7 @@ typedef enum rpmCallbackType_e { + RPMCALLBACK_SCRIPT_START = (1 << 16), + RPMCALLBACK_SCRIPT_STOP = (1 << 17), + RPMCALLBACK_INST_STOP = (1 << 18), ++ RPMCALLBACK_ELEM_PROGRESS = (1 << 19), + } rpmCallbackType; + + /** +diff --git a/lib/transaction.c b/lib/transaction.c +index 45c30b5ba..1cd9ca674 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -1410,12 +1410,16 @@ exit: + static int rpmtsProcess(rpmts ts) + { + rpmtsi pi; rpmte p; ++ tsMembers tsmem = rpmtsMembers(ts); + int rc = 0; ++ int i = 0; + + pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, 0)) != NULL) { + int failed; + ++ rpmtsNotify(ts, NULL, RPMCALLBACK_ELEM_PROGRESS, i++, ++ tsmem->orderCount); + rpmlog(RPMLOG_DEBUG, "========== +++ %s %s-%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); + +diff --git a/python/rpmmodule.c b/python/rpmmodule.c +index 04285a63f..fc8115d30 100644 +--- a/python/rpmmodule.c ++++ b/python/rpmmodule.c +@@ -459,6 +459,7 @@ static int initModule(PyObject *m) + REGISTER_ENUM(RPMCALLBACK_SCRIPT_START); + REGISTER_ENUM(RPMCALLBACK_SCRIPT_STOP); + REGISTER_ENUM(RPMCALLBACK_INST_STOP); ++ REGISTER_ENUM(RPMCALLBACK_ELEM_PROGRESS); + + REGISTER_ENUM(RPMPROB_BADARCH); + REGISTER_ENUM(RPMPROB_BADOS); +-- +2.13.2 + diff --git a/SOURCES/rpm-4.11.x-export-verifysigs-to-python.patch b/SOURCES/rpm-4.11.x-export-verifysigs-to-python.patch new file mode 100644 index 0000000..76e2e7d --- /dev/null +++ b/SOURCES/rpm-4.11.x-export-verifysigs-to-python.patch @@ -0,0 +1,87 @@ +diff -up rpm-4.11.3/lib/rpmchecksig.c.orig rpm-4.11.3/lib/rpmchecksig.c +--- rpm-4.11.3/lib/rpmchecksig.c.orig 2013-11-22 11:31:31.000000000 +0100 ++++ rpm-4.11.3/lib/rpmchecksig.c 2017-03-15 18:18:20.688251955 +0100 +@@ -242,8 +242,8 @@ static void formatResult(rpmTagVal sigta + free(msg); + } + +-static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, +- FD_t fd, const char *fn) ++int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, FD_t fd, ++ const char *fn) + { + + char *buf = NULL; +diff -up rpm-4.11.3/lib/rpmcli.h.orig rpm-4.11.3/lib/rpmcli.h +--- rpm-4.11.3/lib/rpmcli.h.orig 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/lib/rpmcli.h 2017-03-15 18:18:20.689251950 +0100 +@@ -254,6 +254,17 @@ int showVerifyPackage(QVA_t qva, rpmts t + */ + int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn); + ++/** ++ * Check package and header signatures. ++ * @param keyring keyring handle ++ * @param flags flags to control what to verify ++ * @param fd package file handle ++ * @param fn package file name ++ * @return 0 on success, 1 on failure ++ */ ++int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, FD_t fd, ++ const char *fn); ++ + /** \ingroup rpmcli + * Verify package install. + * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union? +diff -up rpm-4.11.3/python/rpmts-py.c.orig rpm-4.11.3/python/rpmts-py.c +--- rpm-4.11.3/python/rpmts-py.c.orig 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3/python/rpmts-py.c 2017-03-15 18:18:20.689251950 +0100 +@@ -7,6 +7,8 @@ + #include + #include + #include ++#include ++#include + + #include "header-py.h" + #include "rpmds-py.h" /* XXX for rpmdsNew */ +@@ -671,6 +672,24 @@ exit: + return mio; + } + ++static PyObject * ++rpmts_VerifySigs(rpmtsObject * s, PyObject * args) ++{ ++ rpmfdObject *fdo = NULL; ++ char *fn = NULL; ++ rpmQueryFlags flags = (VERIFY_DIGEST|VERIFY_SIGNATURE); ++ int rc = 1; ++ ++ if (!PyArg_ParseTuple(args, "O&s|i:VerifySigs", rpmfdFromPyObject, &fdo, ++ &fn, &flags)) ++ return NULL; ++ ++ rpmKeyring keyring = rpmtsGetKeyring(s->ts, 1); ++ rc = rpmpkgVerifySigs(keyring, flags, rpmfdGetFd(fdo), fn); ++ rpmKeyringFree(keyring); ++ return PyBool_FromLong(rc == 0); ++} ++ + static struct PyMethodDef rpmts_methods[] = { + {"addInstall", (PyCFunction) rpmts_AddInstall, METH_VARARGS, + NULL }, +@@ -729,6 +748,14 @@ Remove all elements from the transaction + {"dbIndex", (PyCFunction) rpmts_index, METH_VARARGS|METH_KEYWORDS, + "ts.dbIndex(TagN) -> ii\n\ + - Create a key iterator for the default transaction rpmdb.\n" }, ++ {"_verifySigs", (PyCFunction) rpmts_VerifySigs, METH_VARARGS, ++ "ts._verifySigs(fdno, fn, [flags]) -- Verify package signature\n\n" ++ "Returns True if it verifies, False otherwise.\n\n" ++ "Args:\n" ++ " fdno : file descriptor of the package to verify\n" ++ " fn : package file name (just for logging purposes)\n" ++ " flags : bitfield to control what to verify\n" ++ " (default is rpm.VERIFY_SIGNATURE | rpm.VERIFY_DIGEST)"}, + {NULL, NULL} /* sentinel */ + }; + diff --git a/SOURCES/rpm-4.11.x-filter-soname-deps.patch b/SOURCES/rpm-4.11.x-filter-soname-deps.patch new file mode 100644 index 0000000..c52e11e --- /dev/null +++ b/SOURCES/rpm-4.11.x-filter-soname-deps.patch @@ -0,0 +1,80 @@ +commit 73bd9636d0e76a4d255776b7733667198b9ef585 +Author: Panu Matilainen +Date: Mon Jan 7 15:52:43 2013 +0200 + + Filter ELF dependencies by name + + - Instead of vain heuristics on DT_SONAME presence, filter out + irregular sonames from all dependencies: linkable library names generally + must contain ".so" and start with "lib" for the linker to find it at all, + anything else is an exception of one kind or another (the prime exception + of ld.so variants we handle here). This weeds out provides for most + dlopen()'ed modules etc, and filtering both provides and requires + by the same rules means we wont generate requires for things that wont be + provided. Of course this also means we can omit things that are in + DT_NEEDED, but these should be rare exceptions which the new + --no-filter-soname switch is for. + +diff --git a/tools/elfdeps.c b/tools/elfdeps.c +index fc9a905..a0db9f7 100644 +--- a/tools/elfdeps.c ++++ b/tools/elfdeps.c +@@ -15,6 +15,7 @@ + int filter_private = 0; + int soname_only = 0; + int fake_soname = 1; ++int filter_soname = 1; + + typedef struct elfInfo_s { + Elf *elf; +@@ -36,6 +37,31 @@ static int skipPrivate(const char *s) + return (filter_private && rstreq(s, "GLIBC_PRIVATE")); + } + ++/* ++ * Rough soname sanity filtering: all sane soname's dependencies need to ++ * contain ".so", and normal linkable libraries start with "lib", ++ * everything else is an exception of some sort. The most notable ++ * and common exception is the dynamic linker itself, which we allow ++ * here, the rest can use --no-filter-soname. ++ */ ++static int skipSoname(const char *soname) ++{ ++ if (filter_soname) { ++ if (!strstr(soname, ".so")) ++ return 1; ++ ++ if (rstreqn(soname, "ld.", 3) || rstreqn(soname, "ld-", 3)) ++ return 0; ++ ++ if (rstreqn(soname, "lib", 3)) ++ return 0; ++ else ++ return 1; ++ } ++ ++ return 0; ++} ++ + static const char *mkmarker(GElf_Ehdr *ehdr) + { + const char *marker = NULL; +@@ -58,6 +84,10 @@ static void addDep(ARGV_t *deps, + const char *soname, const char *ver, const char *marker) + { + char *dep = NULL; ++ ++ if (skipSoname(soname)) ++ return; ++ + if (ver || marker) { + rasprintf(&dep, + "%s(%s)%s", soname, ver ? ver : "", marker ? marker : ""); +@@ -293,6 +323,7 @@ int main(int argc, char *argv[]) + { "filter-private", 0, POPT_ARG_VAL, &filter_private, -1, NULL, NULL }, + { "soname-only", 0, POPT_ARG_VAL, &soname_only, -1, NULL, NULL }, + { "no-fake-soname", 0, POPT_ARG_VAL, &fake_soname, 0, NULL, NULL }, ++ { "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL }, + POPT_AUTOHELP + POPT_TABLEEND + }; diff --git a/SOURCES/rpm-4.11.x-fix-debuginfo-creation.patch b/SOURCES/rpm-4.11.x-fix-debuginfo-creation.patch new file mode 100644 index 0000000..02a80e3 --- /dev/null +++ b/SOURCES/rpm-4.11.x-fix-debuginfo-creation.patch @@ -0,0 +1,27 @@ +From 659614aeb6fffe3b249c12b442bd85129100f73b Mon Sep 17 00:00:00 2001 +From: Pascal Terjan +Date: Mon, 16 Feb 2015 13:08:50 +0100 +Subject: [PATCH] Fix debuginfo creation for changed file output. + +file will print a "warning" that it only processed up to 256 notes. +Fixes: http://rpm.org/ticket/887 +--- + scripts/find-debuginfo.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh +index 57449f7..264fad5 100644 +--- a/scripts/find-debuginfo.sh ++++ b/scripts/find-debuginfo.sh +@@ -205,7 +205,7 @@ $strict || strict_error=WARNING + find "$RPM_BUILD_ROOT" ! -path "${debugdir}/*.debug" -type f \ + \( -perm -0100 -or -perm -0010 -or -perm -0001 \) \ + -print | +-file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' | ++file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped.*/\1/p' | + xargs --no-run-if-empty stat -c '%h %D_%i %n' | + while read nlinks inum f; do + get_debugfn "$f" +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-fix-stripping-of-binaries.patch b/SOURCES/rpm-4.11.x-fix-stripping-of-binaries.patch new file mode 100644 index 0000000..79fd6b7 --- /dev/null +++ b/SOURCES/rpm-4.11.x-fix-stripping-of-binaries.patch @@ -0,0 +1,56 @@ +From 5b4805df2085b0e7c4f09caad62638c3238b3bc1 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Tue, 30 Jun 2015 11:39:21 +0200 +Subject: [PATCH] Fix stripping of binaries for changed file output. + +file will print a "warning" that it only processed up to 256 notes. + + - Related: 659614aeb6fffe3b249c12b442bd85129100f73b + - Related: http://rpm.org/ticket/887 + - Related: rhbz#1206312 +--- + scripts/brp-strip | 2 +- + scripts/brp-strip-comment-note | 2 +- + scripts/brp-strip-shared | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/brp-strip b/scripts/brp-strip +index 2e99d1e..5e64566 100755 +--- a/scripts/brp-strip ++++ b/scripts/brp-strip +@@ -15,6 +15,6 @@ esac + for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + grep -v ' shared object,' | \ +- sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do ++ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p'`; do + $STRIP -g "$f" || : + done +diff --git a/scripts/brp-strip-comment-note b/scripts/brp-strip-comment-note +index 323c041..833ac78 100755 +--- a/scripts/brp-strip-comment-note ++++ b/scripts/brp-strip-comment-note +@@ -16,7 +16,7 @@ esac + # for already stripped elf files in the build root + for f in `find "$RPM_BUILD_ROOT" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ +- sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do ++ sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped.*/\1/p'`; do + note="-R .note" + if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \ + grep ALLOC >/dev/null; then +diff --git a/scripts/brp-strip-shared b/scripts/brp-strip-shared +index e06ee4b..51d10d5 100644 +--- a/scripts/brp-strip-shared ++++ b/scripts/brp-strip-shared +@@ -20,6 +20,6 @@ esac + for f in `find "$RPM_BUILD_ROOT" -type f -a -exec file {} \; | \ + grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \ + grep ' shared object,' | \ +- sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do ++ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped.*/\1/p'`; do + $STRIP --strip-unneeded "$f" + done +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-man-systemd-inhibit.patch b/SOURCES/rpm-4.11.x-man-systemd-inhibit.patch new file mode 100644 index 0000000..50e0af3 --- /dev/null +++ b/SOURCES/rpm-4.11.x-man-systemd-inhibit.patch @@ -0,0 +1,68 @@ +From 4a2c311bfe21eda9472f52795db1c9f883e6c194 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Mon, 4 Jul 2016 17:45:33 +0200 +Subject: [PATCH] Add man page for systemd-inhibit plugin + +--- + doc/Makefile.am | 1 + + doc/rpm-plugin-systemd-inhibit.8 | 36 ++++++++++++++++++++++++++++++++++++ + 2 files changed, 37 insertions(+) + create mode 100644 doc/rpm-plugin-systemd-inhibit.8 + +diff --git a/doc/Makefile.am b/doc/Makefile.am +index f7940b9..d2f520d 100644 +--- a/doc/Makefile.am ++++ b/doc/Makefile.am +@@ -9,6 +9,7 @@ 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 ++man_man8_DATA += rpm-plugin-systemd-inhibit.8 + EXTRA_DIST += $(man_man8_DATA) + + man_fr_man8dir = $(mandir)/fr/man8 +diff --git a/doc/rpm-plugin-systemd-inhibit.8 b/doc/rpm-plugin-systemd-inhibit.8 +new file mode 100644 +index 0000000..b49e8ef +--- /dev/null ++++ b/doc/rpm-plugin-systemd-inhibit.8 +@@ -0,0 +1,36 @@ ++.TH "RPM-SYSTEMD-INHIBIT" "8" "14 Apr 2016" "Red Hat, Inc." ++.SH NAME ++rpm-plugin-systemd-inhibit \- Plugin for the RPM Package Manager ++ ++.SH Description ++ ++This plugin for RPM prevents the system to enter shutdown, sleep or idle ++mode while there is a rpm transaction running to prevent system corruption ++that can occur if the transaction is interrupted by a reboot. ++ ++This is achieved by using the inhibit DBUS interface of systemd. The call is ++roughly equivalent to executing ++ ++\fBsystemd-inhibit --mode=block --what=idle:sleep:shutdown --who=RPM --why="Transaction running"\fR ++ ++See \fBsystemd-inhibit(1)\fR for the details of this mechanism. ++ ++It is strongly advised to have the plugin installed on all systemd ++based systems. ++ ++.SH Prerequisites ++ ++For the plugin to work systemd has to be used as init system and ++though the DBUS system bus must be available. If the plugin cannot access the ++interface it gives a warning but does not stop the transaction. ++ ++.SH Configuration ++ ++The plugin currently does not have any configuration option other than ++turning it on and off. It can be disabled by commenting out the ++\fI%__transaction_systemd_inhibit\fR macro in main macros file ++(typically located at \fI/usr/lib/rpm/macros\fR) or otherwise change ++the value of the macro. ++ ++Another option is to remove the plugin from the system if it is ++packaged in its own sub package. +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-minidebuginfo-ppc64.patch b/SOURCES/rpm-4.11.x-minidebuginfo-ppc64.patch new file mode 100644 index 0000000..600d8f8 --- /dev/null +++ b/SOURCES/rpm-4.11.x-minidebuginfo-ppc64.patch @@ -0,0 +1,15 @@ +diff -up rpm-4.11.1/scripts/find-debuginfo.sh.minidebug-ppc64 rpm-4.11.1/scripts/find-debuginfo.sh +--- rpm-4.11.1/scripts/find-debuginfo.sh.minidebug-ppc64 2014-01-16 14:05:17.291955782 +0200 ++++ rpm-4.11.1/scripts/find-debuginfo.sh 2014-01-16 14:05:56.437285842 +0200 +@@ -149,7 +149,10 @@ add_minidebug() + # in the normal symbol table + nm -D "$binary" --format=posix --defined-only | awk '{ print $1 }' | sort > "$dynsyms" + # Extract all the text (i.e. function) symbols from the debuginfo +- nm "$debuginfo" --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > "$funcsyms" ++ # Use format sysv to make sure we can match against the actual ELF FUNC ++ # symbol type. The binutils nm posix format symbol type chars are ++ # ambigous for architectures that might use function descriptors. ++ nm "$debuginfo" --format=sysv --defined-only | awk -F \| '{ if ($4 ~ "FUNC") print $1 }' | sort > "$funcsyms" + # Keep all the function symbols not already in the dynamic symbol table + comm -13 "$dynsyms" "$funcsyms" > "$keep_symbols" + # Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections diff --git a/SOURCES/rpm-4.11.x-move-rename.patch b/SOURCES/rpm-4.11.x-move-rename.patch new file mode 100644 index 0000000..1f38432 --- /dev/null +++ b/SOURCES/rpm-4.11.x-move-rename.patch @@ -0,0 +1,89 @@ +From d519580bd638ceb48829ae66557ca3c5941b4a5f Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Wed, 4 May 2016 14:05:06 +0200 +Subject: [PATCH] Set permissions before moving new files to their final place + +--- + lib/fsm.c | 37 ++++++++++++++++++++----------------- + 1 file changed, 20 insertions(+), 17 deletions(-) + +diff --git a/lib/fsm.c b/lib/fsm.c +index 1ee7e67..3bb23a4 100644 +--- a/lib/fsm.c ++++ b/lib/fsm.c +@@ -621,14 +621,15 @@ static FSM_t fsmFree(FSM_t fsm) + + /* Find and set file security context */ + static int fsmSetSELabel(struct selabel_handle *sehandle, +- const char *path, mode_t mode) ++ const char *path, const char * nominalpath, ++ mode_t mode) + { + int rc = 0; + #if WITH_SELINUX + if (sehandle) { + security_context_t scon = NULL; + +- if (selabel_lookup_raw(sehandle, &scon, path, mode) == 0) { ++ if (selabel_lookup_raw(sehandle, &scon, nominalpath, mode) == 0) { + rc = lsetfilecon(path, scon); + + if (_fsm_debug) { +@@ -1215,7 +1216,7 @@ static int fsmMkdirs(rpmfi fi, rpmfs fs, struct selabel_handle *sehandle) + mode_t mode = S_IFDIR | (_dirPerms & 07777); + rc = fsmMkdir(dn, mode); + if (!rc) { +- rc = fsmSetSELabel(sehandle, dn, mode); ++ rc = fsmSetSELabel(sehandle, dn, dn, mode); + + rpmlog(RPMLOG_DEBUG, + "%s directory created with perms %04o\n", +@@ -1534,22 +1535,11 @@ static int fsmCommit(FSM_t fsm, int ix) + /* Backup on-disk file if needed. Directories are handled earlier */ + if (!S_ISDIR(st->st_mode)) + rc = fsmBackup(fsm); +- /* Rename temporary to final file name. */ +- if (!S_ISDIR(st->st_mode) && (fsm->suffix || fsm->nsuffix)) { +- char *npath = fsmFsPath(fsm, 0, fsm->nsuffix); +- rc = fsmRename(fsm->path, npath, fsm->mapFlags); +- if (!rc && fsm->nsuffix) { +- char * opath = fsmFsPath(fsm, 0, NULL); +- rpmlog(RPMLOG_WARNING, _("%s created as %s\n"), +- opath, npath); +- free(opath); +- } +- free(fsm->path); +- fsm->path = npath; +- } + /* Set file security context (if enabled) */ + if (!rc && !getuid()) { +- rc = fsmSetSELabel(fsm->sehandle, fsm->path, fsm->sb.st_mode); ++ char * opath = fsmFsPath(fsm, 0, NULL); ++ rc = fsmSetSELabel(fsm->sehandle, fsm->path, opath, fsm->sb.st_mode); ++ opath = _free(opath); + } + if (S_ISLNK(st->st_mode)) { + if (!rc && !getuid()) +@@ -1571,6 +1561,19 @@ static int fsmCommit(FSM_t fsm, int ix) + rc = fsmSetFCaps(fsm->path, rpmfiFCapsIndex(fi, ix)); + } + } ++ /* Rename temporary to final file name. */ ++ if (!rc && !S_ISDIR(st->st_mode) && (fsm->suffix || fsm->nsuffix)) { ++ char *npath = fsmFsPath(fsm, 0, fsm->nsuffix); ++ rc = fsmRename(fsm->path, npath, fsm->mapFlags); ++ if (!rc && fsm->nsuffix) { ++ char * opath = fsmFsPath(fsm, 0, NULL); ++ rpmlog(RPMLOG_WARNING, _("%s created as %s\n"), ++ opath, npath); ++ free(opath); ++ } ++ free(fsm->path); ++ fsm->path = npath; ++ } + } + + if (rc && fsm->failedFile && *fsm->failedFile == NULL) { +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-multitheaded_xz.patch b/SOURCES/rpm-4.11.x-multitheaded_xz.patch new file mode 100644 index 0000000..cb84970 --- /dev/null +++ b/SOURCES/rpm-4.11.x-multitheaded_xz.patch @@ -0,0 +1,111 @@ +diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c +index cd223e8..f23fc11 100644 +--- a/rpmio/rpmio.c ++++ b/rpmio/rpmio.c +@@ -5,6 +5,7 @@ + #include "system.h" + #include + #include ++#include + + #include + #include +@@ -873,7 +874,12 @@ static const char * getFdErrstr (FD_t fd) + + #include + #include ++#define LZMA_UNSTABLE + #include ++/* Multithreading support in stable API since xz 5.2.0 */ ++#if LZMA_VERSION >= 50010020 ++#define HAVE_LZMA_MT ++#endif + + #define kBufferSize (1 << 15) + +@@ -897,7 +902,10 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x + LZFILE *lzfile; + lzma_ret ret; + lzma_stream init_strm = LZMA_STREAM_INIT; +- ++ uint64_t mem_limit = rpmExpandNumeric("%{_xz_memlimit}"); ++#ifdef HAVE_LZMA_MT ++ int threads = 0; ++#endif + for (; *mode; mode++) { + if (*mode == 'w') + encoding = 1; +@@ -905,6 +913,21 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x + encoding = 0; + else if (*mode >= '1' && *mode <= '9') + level = *mode - '0'; ++ else if (*mode == 'T') { ++ if (isdigit(*(mode+1))) { ++#ifdef HAVE_LZMA_MT ++ threads = atoi(++mode); ++#endif ++ /* skip past rest of digits in string that atoi() ++ * should've processed ++ * */ ++ while(isdigit(*++mode)); ++ } ++#ifdef HAVE_LZMA_MT ++ else ++ threads = -1; ++#endif ++ } + } + if (fd != -1) + fp = fdopen(fd, encoding ? "w" : "r"); +@@ -924,16 +947,48 @@ static LZFILE *lzopen_internal(const char *path, const char *mode, int fd, int x + lzfile->strm = init_strm; + if (encoding) { + if (xz) { +- ret = lzma_easy_encoder(&lzfile->strm, level, LZMA_CHECK_SHA256); ++#ifdef HAVE_LZMA_MT ++ if (!threads) { ++#endif ++ ret = lzma_easy_encoder(&lzfile->strm, level, LZMA_CHECK_SHA256); ++#ifdef HAVE_LZMA_MT ++ } else { ++ if (threads == -1) ++ threads = sysconf(_SC_NPROCESSORS_ONLN); ++ lzma_mt mt_options = { ++ .flags = 0, ++ .threads = threads, ++ .block_size = 0, ++ .timeout = 0, ++ .preset = level, ++ .filters = NULL, ++ .check = LZMA_CHECK_SHA256 }; ++ ++ ret = lzma_stream_encoder_mt(&lzfile->strm, &mt_options); ++ } ++#endif + } else { + lzma_options_lzma options; + lzma_lzma_preset(&options, level); + ret = lzma_alone_encoder(&lzfile->strm, &options); + } +- } else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */ +- ret = lzma_auto_decoder(&lzfile->strm, 100<<20, 0); ++ } else { /* lzma_easy_decoder_memusage(level) is not ready yet, use hardcoded limit for now */ ++ ret = lzma_auto_decoder(&lzfile->strm, mem_limit ? mem_limit : 100<<20, 0); + } + if (ret != LZMA_OK) { ++ switch (ret) { ++ case LZMA_MEM_ERROR: ++ rpmlog(RPMLOG_ERR, "liblzma: Memory allocation failed"); ++ break; ++ ++ case LZMA_DATA_ERROR: ++ rpmlog(RPMLOG_ERR, "liblzma: File size limits exceeded"); ++ break; ++ ++ default: ++ rpmlog(RPMLOG_ERR, "liblzma: +Date: Wed, 21 Oct 2015 15:25:47 +0200 +Subject: [PATCH] Overwrite a file if it is not marked as config any more. + +If a file was marked as config in the previous version of a package but +it is not marked as config in currently being installed version of +the package then backup the old file as .rpmsave and overwrite it with +the new file. (rhbz:1263859) +--- + lib/rpmfi.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/lib/rpmfi.c b/lib/rpmfi.c +index 924ff4b..28a697e 100644 +--- a/lib/rpmfi.c ++++ b/lib/rpmfi.c +@@ -1040,6 +1040,12 @@ rpmFileAction rpmfilesDecideFate(rpmfiles ofi, int oix, + goto exit; /* file identical in new, replace. */ + } + ++ /* if new file is no longer config, backup it and replace it */ ++ if (!(newFlags & RPMFILE_CONFIG)) { ++ action = FA_SAVE; ++ goto exit; ++ } ++ + /* If file can be determined identical in old and new pkg, let it be */ + if (newWhat == REG && oalgo == nalgo && odiglen == ndiglen) { + if (odigest && ndigest && memcmp(odigest, ndigest, odiglen) == 0) { +@@ -1071,6 +1077,12 @@ rpmFileAction rpmfilesDecideFate(rpmfiles ofi, int oix, + goto exit; /* unmodified config file, replace. */ + } + ++ /* if new file is no longer config, backup it and replace it */ ++ if (!(newFlags & RPMFILE_CONFIG)) { ++ action = FA_SAVE; ++ goto exit; ++ } ++ + /* If link is identical in old and new pkg, let it be */ + if (newWhat == LINK && oFLink && nFLink && rstreq(oFLink, nFLink)) { + action = FA_SKIP; /* identical file, don't bother. */ +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-parametrized-macro-invocations.patch b/SOURCES/rpm-4.11.x-parametrized-macro-invocations.patch new file mode 100644 index 0000000..2769f1c --- /dev/null +++ b/SOURCES/rpm-4.11.x-parametrized-macro-invocations.patch @@ -0,0 +1,32 @@ +From 1bdcd0500865efd3566efd7f951228f69b58e755 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 19 Feb 2014 14:16:38 +0200 +Subject: [PATCH] Dont eat newlines on parametrized macro invocations + (RhBug:1045723) + +- Makes the testcase from commit f082b5baa4dcf9601eeb1e0e520ff06e77dc61c0 + succeed. While the old behavior is non-sensical and most likely entirely + unintentional, we're changing a very long-standing behavior here (tested + back to rpm 4.4.x and almost certainly much much older than that) so + its entirely possible people are actually relying on the old + behavior. Lets see what breaks... +--- + rpmio/macro.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmio/macro.c b/rpmio/macro.c +index e1c2a91..72471a2 100644 +--- a/rpmio/macro.c ++++ b/rpmio/macro.c +@@ -764,7 +764,7 @@ grabArgs(MacroBuf mb, const rpmMacroEntry me, const char * se, + + exit: + argvFree(argv); +- return *lastc ? lastc + 1 : lastc; ++ return (*lastc == '\0' || *lastc == '\n') ? lastc : lastc + 1; + } + + /** +-- +2.1.0 + diff --git a/SOURCES/rpm-4.11.x-perl.req-1.patch b/SOURCES/rpm-4.11.x-perl.req-1.patch new file mode 100644 index 0000000..0d4b142 --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-1.patch @@ -0,0 +1,30 @@ +From 4f05fa0e15bcb66d29f89e28829ea43107f6382b Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Mon, 1 Dec 2014 16:04:32 +0100 +Subject: [PATCH 1/2] Fix parsing multi-line print statement with unquoted tag + +- script perl.req was able to parse only multi-line print statements + with quoted tag e.g. 'print <<"tag"' or "print <<'tag'". Now it can + also parse "print <) { + chomp; + ( $_ eq $tag ) && last; +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-perl.req-2.patch b/SOURCES/rpm-4.11.x-perl.req-2.patch new file mode 100644 index 0000000..1159477 --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-2.patch @@ -0,0 +1,41 @@ +From 4c621e97776a47c2b4e7f17c1cd2a7961453babf Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Wed, 3 Dec 2014 14:01:14 +0100 +Subject: [PATCH 2/2] Ignore "use" or "requires" within multi-line print or + assign statement + +- Now script perl.req ignores "use" and "requires" on lines that are + part of printing or assigning multi-line string i. e. string that + hasn't starting and ending quote on the same line. + (RhBug:1024517) +--- + scripts/perl.req | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/scripts/perl.req b/scripts/perl.req +index e17ad5a..6e53c91 100755 +--- a/scripts/perl.req ++++ b/scripts/perl.req +@@ -174,6 +174,19 @@ sub process_file { + $_ = ; + } + ++ # Skip multiline print and assign statements ++ if ( m/\$\S+\s*=\s*(")([^"\\]|(\\.))*$/ || ++ m/\$\S+\s*=\s*(')([^'\\]|(\\.))*$/ || ++ m/print\s+(")([^"\\]|(\\.))*$/ || ++ m/print\s+(')([^'\\]|(\\.))*$/ ) { ++ ++ my $quote = $1; ++ while () { ++ m/^([^\\$quote]|(\\.))*$quote/ && last; ++ } ++ $_ = ; ++ } ++ + if ( + + # ouch could be in a eval, perhaps we do not want these since we catch +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-perl.req-3.patch b/SOURCES/rpm-4.11.x-perl.req-3.patch new file mode 100644 index 0000000..5b85e10 --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-3.patch @@ -0,0 +1,37 @@ +From 1d9a0018f9cde8fc5c59df9af70a2164e672210f Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Wed, 25 Nov 2015 13:49:01 +0100 +Subject: [PATCH] Improve perl.req script + +This commit 0d5929ba5eabadec49273bb090ba9158dfccc30c tries to ignore +"use" and "require" within multi-line print statements that start with +line like this "print <) { + chomp; + ( $_ eq $tag ) && last; +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-perl.req-4.patch b/SOURCES/rpm-4.11.x-perl.req-4.patch new file mode 100644 index 0000000..f154ceb --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-4.patch @@ -0,0 +1,32 @@ +From 6a8754b2153e0e4305ef2bc5a789bfe02f65e889 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Tue, 14 Jun 2016 15:01:16 +0200 +Subject: [PATCH] perl.req: Skip over multi line return statements See + Rhbz#1275551 + +--- + scripts/perl.req | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/scripts/perl.req b/scripts/perl.req +index f1000c8..7155518 100755 +--- a/scripts/perl.req ++++ b/scripts/perl.req +@@ -160,11 +160,12 @@ sub process_file { + + # + # The (require|use) match further down in this subroutine will match lines +- # within a multi-line print statement. So, let's skip over such print ++ # within a multi-line print or return statements. So, let's skip over such + # statements whose content should not be loading modules anyway. -BEF- + # + if (m/print(?:\s+|\s+\S+\s+)\<\<\s*(["'`])(.+?)\1/ || +- m/print(\s+|\s+\S+\s+)\<\<(\w+)/) { ++ m/print(\s+|\s+\S+\s+)\<\<(\w+)/ || ++ m/return(\s+)\<\<(\w+)/ ) { + + my $tag = $2; + while () { +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-perl.req-6.patch b/SOURCES/rpm-4.11.x-perl.req-6.patch new file mode 100644 index 0000000..8a86532 --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-6.patch @@ -0,0 +1,81 @@ +--- rpm-4.11.3/scripts/perl.req.old 2019-05-26 15:41:33.316395021 +0200 ++++ rpm-4.11.3/scripts/perl.req 2019-05-26 14:08:38.248028422 +0200 +@@ -90,10 +90,10 @@ + + sub compute_global_requires { + +-# restrict require to all non provided by the file +- foreach my $moduler (sort keys %require) { +- if (exists $provide{$moduler} && length($require{$moduler}) == 0) { +- $require = delete $require{$moduler}; ++# restrict require_removable to all non provided by the file ++ foreach my $moduler (sort keys %require_removable) { ++ if (exists $provide{$moduler} && length($require_removable{$moduler}) == 0) { ++ $require_removable = delete $require_removable{$moduler}; + } + } + # store requires to global_requires +@@ -107,8 +107,21 @@ + $global_require{$module} = $newver; + } + } ++ ++# store requires_removable to global_requires ++ foreach my $module (sort keys %require_removable) { ++ my $oldver = $global_require{$module}; ++ my $newver = $require_removable{$module}; ++ if ($oldver) { ++ $global_require{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } else { ++ $global_require{$module} = $newver; ++ } ++ } + # remove all local requires and provides + undef %require; ++ undef %require_removable; + undef %provide; + } + +@@ -124,6 +137,18 @@ + } + } + ++sub add_require_removable { ++ my ($module, $newver) = @_; ++ my $oldver = $require_removable{$module}; ++ if ($oldver) { ++ $require_removable{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } ++ else { ++ $require_removable{$module} = $newver; ++ } ++} ++ + sub process_file { + + my ($file) = @_; +@@ -286,7 +311,6 @@ + + # if the module starts with /, it is an absolute path to a file + if ($module =~ m(^/)) { +- print "$module\n"; + next; + } + +@@ -346,7 +370,13 @@ + add_require($_, undef) for split(' ', $1); + } + elsif ($version =~ /(["'])([^"']+)\1/) { +- add_require($2, undef); ++ # requires like "use base name" can be removed if they are ++ # provided in the same file ++ if (($whitespace eq "") && ($statement eq "use") && ($module eq "base")) { ++ add_require_removable($2, undef); ++ } else { ++ add_require($2, undef); ++ } + } + next; + } diff --git a/SOURCES/rpm-4.11.x-perl.req-skip-my-var-block.patch b/SOURCES/rpm-4.11.x-perl.req-skip-my-var-block.patch new file mode 100644 index 0000000..61ef41b --- /dev/null +++ b/SOURCES/rpm-4.11.x-perl.req-skip-my-var-block.patch @@ -0,0 +1,39 @@ +From 4a9b7f547ce1bb6b0b352d2e29ae4b0d3bddebfb Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Mon, 13 Mar 2017 11:20:11 +0100 +Subject: [PATCH] perl.req: Also skip blocks with my var = << + +Before only +var = <) { + chomp; +-- +2.9.3 + diff --git a/SOURCES/rpm-4.11.x-provide-audit-events.patch b/SOURCES/rpm-4.11.x-provide-audit-events.patch new file mode 100644 index 0000000..7fc7879 --- /dev/null +++ b/SOURCES/rpm-4.11.x-provide-audit-events.patch @@ -0,0 +1,156 @@ +--- rpm-4.11.3/configure.ac.old 2018-05-25 09:02:29.103209393 +0200 ++++ rpm-4.11.3/configure.ac 2018-05-28 14:46:27.134913783 +0200 +@@ -334,6 +334,22 @@ + AC_SUBST(WITH_POPT_INCLUDE) + AC_SUBST(WITH_POPT_LIB) + ++ ++#================= ++# Check for audit library. ++AC_ARG_WITH(audit, ++AS_HELP_STRING([--with-audit],[log results using Linux Audit]), ++with_audit=$withval, ++with_audit=auto) ++ ++WITH_AUDIT_LIB= ++AS_IF([test "$with_audit" = auto],[ ++ AC_SEARCH_LIBS([audit_open],[audit],[WITH_AUDIT_LIB="$ac_res"], ++ [AC_MSG_ERROR([missing audit library]) ++ ]) ++]) ++AC_SUBST(WITH_AUDIT_LIB) ++ + #================= + # Process --with/without-external-db + AC_ARG_WITH(external_db, [AS_HELP_STRING([--with-external-db],[build against an external Berkeley db])], +--- rpm-4.11.3/lib/Makefile.am.old 2014-09-05 13:51:05.000000000 +0200 ++++ rpm-4.11.3/lib/Makefile.am 2018-05-28 13:24:17.309657132 +0200 +@@ -47,6 +47,7 @@ + @WITH_SELINUX_LIB@ \ + @WITH_CAP_LIB@ \ + @WITH_ACL_LIB@ \ ++ @WITH_AUDIT_LIB@ \ + @LIBINTL@ + + if WITH_LUA +--- rpm-4.11.3/lib/rpmte.c.old 2018-05-25 09:02:29.173209513 +0200 ++++ rpm-4.11.3/lib/rpmte.c 2018-06-18 10:38:02.929670757 +0200 +@@ -3,6 +3,7 @@ + * Routine(s) to handle an "rpmte" transaction element. + */ + #include "system.h" ++#include + + #include + #include /* RPM_MACHTABLE_* */ +@@ -22,6 +23,16 @@ + + #include "debug.h" + ++#ifndef AUDIT_SOFTWARE_UPDATE ++#define AUDIT_SOFTWARE_UPDATE 1138 ++#endif ++ ++RPM_GNUC_INTERNAL ++int auditEnabled = 0; ++ ++RPM_GNUC_INTERNAL ++int auditGpgResult = 0; ++ + /** \ingroup rpmte + * A single package instance to be installed/removed atomically. + */ +@@ -698,7 +709,15 @@ + + switch (rpmteType(te)) { + case TR_ADDED: +- h = rpmteDBInstance(te) ? rpmteDBHeader(te) : rpmteFDHeader(te); ++ if (rpmteDBInstance(te)) { ++ h = rpmteDBHeader(te); ++ } else { ++ if (reload_fi) { ++ auditEnabled = 1; ++ auditGpgResult = 0; ++ } ++ h = rpmteFDHeader(te); ++ } + break; + case TR_REMOVED: + h = rpmteDBHeader(te); +@@ -904,6 +923,41 @@ + return rc; + } + ++/* ++ * Input variables: ++ * te - transaction element ++ * keyEnforcement - gpg key enforcement status: 1 enforced, 0 not enforced ++ * gpgResult - results of gpg signature check: 1 verified, 0 otherwise ++ * result - overall result of installing the rpm: 1 success, 0 failure ++ */ ++static void audit_rpm_install(rpmte te, unsigned int keyEnforcement, ++ unsigned int gpgResult, int result) ++{ ++ int auditFd; ++ char eventTxt[128], *packageField, *dirField; ++ const char *dir; ++ ++ auditFd = audit_open(); ++ if (auditFd < 0) ++ return; ++ ++ packageField = audit_encode_nv_string("sw", te->NEVRA, strlen(te->NEVRA)); ++ dir = rpmtsRootDir(te->ts); ++ dirField = audit_encode_nv_string("root_dir", dir, strlen(dir)); ++ ++ snprintf(eventTxt, sizeof(eventTxt), ++ "%s sw_type=rpm key_enforce=%u gpg_res=%u %s", ++ packageField, keyEnforcement, gpgResult, dirField); ++ audit_log_user_comm_message(auditFd, AUDIT_SOFTWARE_UPDATE, eventTxt, ++ NULL, NULL, NULL, NULL, result); ++ ++ free(packageField); ++ free(dirField); ++ audit_close(auditFd); ++ ++ return; ++} ++ + static rpmRC rpmteRunAllCollections(rpmte te, rpmPluginHook hook) + { + ARGV_const_t colls; +@@ -977,5 +1031,10 @@ + failed = rpmteMarkFailed(te); + } + ++ if (auditEnabled) { ++ audit_rpm_install(te, 0, auditGpgResult, failed ? 0 : 1); ++ auditEnabled = 0; ++ } ++ + return failed; + } +--- rpm-4.11.3/lib/package.c.old 2018-05-25 09:02:29.132209443 +0200 ++++ rpm-4.11.3/lib/package.c 2018-06-15 12:11:58.996022237 +0200 +@@ -25,6 +25,9 @@ + static unsigned int nextkeyid = 0; + static unsigned int * keyids; + ++extern int auditGpgResult; ++extern int auditEnabled; ++ + /** \ingroup header + * Translate and merge legacy signature tags into header. + * @param h header (dest) +@@ -646,7 +649,10 @@ + + /** @todo Implement disable/enable/warn/error/anal policy. */ + rc = rpmVerifySignature(keyring, &sigtd, sig, ctx, &msg); +- ++ ++ if (auditEnabled && (sig != NULL)) ++ auditGpgResult = (rc == 0); ++ + switch (rc) { + case RPMRC_OK: /* Signature is OK. */ + rpmlog(RPMLOG_DEBUG, "%s: %s", fn, msg); diff --git a/SOURCES/rpm-4.11.x-python-binding-test-case.patch b/SOURCES/rpm-4.11.x-python-binding-test-case.patch new file mode 100644 index 0000000..05c1682 --- /dev/null +++ b/SOURCES/rpm-4.11.x-python-binding-test-case.patch @@ -0,0 +1,25 @@ +From 3c74e34e8d8c5b3db024dbe04a352e807ed2b627 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Wed, 23 Sep 2015 11:30:12 +0200 +Subject: [PATCH] Fix error handling in rpmio Python binding test case + +--- + tests/rpmpython.at | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/rpmpython.at b/tests/rpmpython.at +index 949673b..eac31b2 100644 +--- a/tests/rpmpython.at ++++ b/tests/rpmpython.at +@@ -53,7 +53,7 @@ for iot in [ 'fpio', 'fdio', 'ufdio', 'gzdio' ]: + fd = rpm.fd(fn, 'r', iot) + rdata = fd.read() + if rdata != data: +- myprint('%s read fail (got %d bytes)' % (iot, len(rdata), rdata)) ++ myprint('%s read fail (got %d bytes)\n%s' % (iot, len(rdata), rdata)) + # compressed io types can't seek + if iot == 'ufdio': + fd.seek(0) +-- +1.9.3 + diff --git a/SOURCES/rpm-4.11.x-quiet-signing.patch b/SOURCES/rpm-4.11.x-quiet-signing.patch new file mode 100644 index 0000000..6000b89 --- /dev/null +++ b/SOURCES/rpm-4.11.x-quiet-signing.patch @@ -0,0 +1,63 @@ +From 4a3d73081cb7db6673fa6775fbf5f6655f846241 Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Mon, 4 Jul 2016 18:34:44 +0200 +Subject: [PATCH] Fix rpmbuild --sign --quiet which relies on the output of + rpmbuild + +by reproducing the output of the librpmbuild in the rpmbuild tool. +--- + rpmbuild.c | 31 +++++++++++++++++++++++++++++++ + 1 file changed, 31 insertions(+) + +diff --git a/rpmbuild.c b/rpmbuild.c +index 02d2655..aa63f97 100644 +--- a/rpmbuild.c ++++ b/rpmbuild.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include "build/rpmbuild_internal.h" + #include "lib/signature.h" + #include "cliutils.h" + +@@ -517,6 +518,36 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) + if (rpmSpecBuild(spec, ba)) { + goto exit; + } ++ /* Output generated package files for the --sign alias */ ++ if (quiet && rpmcliPipeOutput && ++ strncmp(rpmcliPipeOutput, "rpm --addsign", 13)) { ++ rpmSetVerbosity(RPMLOG_INFO); ++ if (buildAmount&RPMBUILD_PACKAGESOURCE) { ++ char *fn = rpmGetPath("%{_srcrpmdir}/", spec->sourceRpmName,NULL); ++ rpmlog(RPMLOG_INFO, _("Wrote: %s\n"), fn); ++ fn = _free(fn); ++ } ++ if (buildAmount&RPMBUILD_PACKAGEBINARY) { ++ rpmSpecPkgIter pkgiter = rpmSpecPkgIterInit(spec); ++ for (rpmSpecPkg pkg = rpmSpecPkgIterNext(pkgiter); ++ pkg; ++ pkg = rpmSpecPkgIterNext(pkgiter)) { ++ char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); ++ char *binRpm, *fn; ++ const char *errorString; ++ Header h = rpmSpecPkgHeader(pkg); ++ if (h) { ++ binRpm = headerFormat(h, binFormat, &errorString); ++ fn = rpmGetPath("%{_rpmdir}/", binRpm, NULL); ++ free(binRpm); ++ rpmlog(RPMLOG_INFO, _("Wrote: %s\n"), fn); ++ free(fn); ++ } ++ free(binFormat); ++ } ++ } ++ rpmSetVerbosity(RPMLOG_WARNING); ++ } + + if (buildMode == 't') + (void) unlink(specFile); +-- +2.5.5 + diff --git a/SOURCES/rpm-4.11.x-reinstall.patch b/SOURCES/rpm-4.11.x-reinstall.patch new file mode 100644 index 0000000..75cbdfa --- /dev/null +++ b/SOURCES/rpm-4.11.x-reinstall.patch @@ -0,0 +1,368 @@ +This patchset consists of following upstream commits: +- 1f3164ae6975747e72af383f2d74c27245e6fe36 +- fd40d58efa0fbff535f273e5ae5c200d43d28aef +- bfa76529864b9dfb29258f4dedc3fa9de9c5aeca +- 6665503ec6fb6430ecaafb3e318a4730f146efa9 +- bf856744f2820a1625ef9428284b5788d18103f3 +- c5200145fa08da884ce2c1ed85941363eeae6407 +- 80dee39fb1f97ab3927c10bdd13c7c438b5677be + +with some changes to make RPM to compile. + +diff -uNr rpm-4.11.3/doc/rpm.8 rpm-4.11.3.reinstall/doc/rpm.8 +--- rpm-4.11.3/doc/rpm.8 2017-07-12 16:57:41.711722771 +0200 ++++ rpm-4.11.3.reinstall/doc/rpm.8 2017-07-12 16:14:26.842680581 +0200 +@@ -110,7 +110,7 @@ + One of the following basic modes must be selected: + \fBQuery\fR, + \fBVerify\fR, +-\fBInstall/Upgrade/Freshen\fR, ++\fBInstall/Upgrade/Freshen/Reinstall\fR, + \fBUninstall\fR, + \fBSet Owners/Groups\fR, + \fBShow Querytags\fR, and +@@ -206,6 +206,13 @@ + This will upgrade packages, but only ones for which an earlier version is + installed. + .PP ++The general form of an rpm reinstall command is ++.PP ++\fBrpm\fR {\fB--reinstall\fR} [\fBinstall-options\fR] \fB\fIPACKAGE_FILE\fB\fR\fI ...\fR ++.PP ++This reinstalls a previously installed package. ++.PP ++.PP + .TP + \fB--allfiles\fR + Installs or upgrades all the missingok files in the package, +diff -uNr rpm-4.11.3/lib/depends.c rpm-4.11.3.reinstall/lib/depends.c +--- rpm-4.11.3/lib/depends.c 2017-07-12 16:57:41.742723041 +0200 ++++ rpm-4.11.3.reinstall/lib/depends.c 2017-07-12 16:14:12.203550634 +0200 +@@ -54,6 +54,12 @@ + #undef HASHTYPE + #undef HTKEYTYPE + ++enum addOp_e { ++ RPMTE_INSTALL = 0, ++ RPMTE_UPGRADE = 1, ++ RPMTE_REINSTALL = 2, ++}; ++ + /** + * Check for supported payload format in header. + * @param h header to check +@@ -126,7 +132,7 @@ + } + + /* Return rpmdb iterator with removals optionally pruned out */ +-static rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag, ++rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag, + const char * key, int prune) + { + rpmdbMatchIterator mi = rpmtsInitIterator(ts, tag, key, 0); +@@ -152,22 +158,29 @@ + } + + /* Add erase elements for older packages of same color (if any). */ +-static int addUpgradeErasures(rpmts ts, rpm_color_t tscolor, ++static int addSelfErasures(rpmts ts, rpm_color_t tscolor, int op, + rpmte p, rpm_color_t hcolor, Header h) + { + Header oh; + rpmdbMatchIterator mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(p), 0); + int rc = 0; ++ int cmp; + + while((oh = rpmdbNextIterator(mi)) != NULL) { + /* Ignore colored packages not in our rainbow. */ + if (skipColor(tscolor, hcolor, headerGetNumber(oh, RPMTAG_HEADERCOLOR))) + continue; + +- /* Skip packages that contain identical NEVR. */ +- if (rpmVersionCompare(h, oh) == 0) ++ cmp = rpmVersionCompare(h, oh); ++ ++ /* On upgrade, skip packages that contain identical NEVR. */ ++ if ((op == RPMTE_UPGRADE) && (cmp == 0)) + continue; + ++ /* On reinstall, skip packages with differing NEVR. */ ++ if ((op == RPMTE_REINSTALL) && (cmp != 0)) ++ continue; ++ + if (removePackage(ts, oh, p)) { + rc = 1; + break; +@@ -385,8 +398,8 @@ + return al; + } + +-int rpmtsAddInstallElement(rpmts ts, Header h, +- fnpyKey key, int upgrade, rpmRelocation * relocs) ++static int addPackage(rpmts ts, Header h, ++ fnpyKey key, int op, rpmRelocation * relocs) + { + tsMembers tsmem = rpmtsMembers(ts); + rpm_color_t tscolor = rpmtsColor(ts); +@@ -403,10 +416,10 @@ + + /* Source packages are never "upgraded" */ + if (isSource) +- upgrade = 0; ++ op = RPMTE_INSTALL; + + /* Do lazy (readonly?) open of rpm database for upgrades. */ +- if (upgrade && rpmtsGetRdb(ts) == NULL && rpmtsGetDBMode(ts) != -1) { ++ if (op != RPMTE_INSTALL && rpmtsGetRdb(ts) == NULL && rpmtsGetDBMode(ts) != -1) { + if ((ec = rpmtsOpenDB(ts, rpmtsGetDBMode(ts))) != 0) + goto exit; + } +@@ -419,7 +432,7 @@ + + /* Check binary packages for redundancies in the set */ + if (!isSource) { +- oc = findPos(ts, tscolor, p, upgrade); ++ oc = findPos(ts, tscolor, p, (op == RPMTE_UPGRADE)); + /* If we're replacing a previously added element, free the old one */ + if (oc >= 0 && oc < tsmem->orderCount) { + rpmalDel(tsmem->addedPackages, tsmem->order[oc]); +@@ -451,15 +464,33 @@ + + /* Add erasure elements for old versions and obsoletions on upgrades */ + /* XXX TODO: If either of these fails, we'd need to undo all additions */ +- if (upgrade) { +- addUpgradeErasures(ts, tscolor, p, rpmteColor(p), h); ++ if (op != RPMTE_INSTALL) ++ addSelfErasures(ts, tscolor, op, p, rpmteColor(p), h); ++ if (op == RPMTE_UPGRADE) + addObsoleteErasures(ts, tscolor, p); +- } + + exit: + return ec; + } + ++int rpmtsAddInstallElement(rpmts ts, Header h, ++ fnpyKey key, int upgrade, rpmRelocation * relocs) ++{ ++ int op = (upgrade == 0) ? RPMTE_INSTALL : RPMTE_UPGRADE; ++ if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) ++ return 1; ++ return addPackage(ts, h, key, op, relocs); ++} ++ ++int rpmtsAddReinstallElement(rpmts ts, Header h, fnpyKey key) ++{ ++ if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) ++ return 1; ++ /* TODO: pull relocations from installed package */ ++ /* TODO: should reinstall of non-installed package fail? */ ++ return addPackage(ts, h, key, RPMTE_REINSTALL, NULL); ++} ++ + int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset) + { + return removePackage(ts, h, NULL); +diff -uNr rpm-4.11.3/lib/poptI.c rpm-4.11.3.reinstall/lib/poptI.c +--- rpm-4.11.3/lib/poptI.c 2013-06-07 09:37:21.000000000 +0200 ++++ rpm-4.11.3.reinstall/lib/poptI.c 2017-07-12 16:14:26.842680581 +0200 +@@ -247,6 +247,10 @@ + &rpmIArgs.installInterfaceFlags, (INSTALL_UPGRADE|INSTALL_INSTALL), + N_("upgrade package(s)"), + N_("+") }, ++ { "reinstall", '\0', POPT_BIT_SET, ++ &rpmIArgs.installInterfaceFlags, (INSTALL_REINSTALL|INSTALL_INSTALL), ++ N_("reinstall package(s)"), ++ N_("+") }, + + POPT_TABLEEND + }; +diff -uNr rpm-4.11.3/lib/rpmcli.h rpm-4.11.3.reinstall/lib/rpmcli.h +--- rpm-4.11.3/lib/rpmcli.h 2017-07-12 16:57:41.741723032 +0200 ++++ rpm-4.11.3.reinstall/lib/rpmcli.h 2017-07-12 16:14:26.842680581 +0200 +@@ -293,7 +293,8 @@ + INSTALL_FRESHEN = (1 << 6), /*!< from --freshen */ + INSTALL_INSTALL = (1 << 7), /*!< from --install */ + INSTALL_ERASE = (1 << 8), /*!< from --erase */ +- INSTALL_ALLMATCHES = (1 << 9) /*!< from --allmatches */ ++ INSTALL_ALLMATCHES = (1 << 9), /*!< from --allmatches */ ++ INSTALL_REINSTALL = (1 << 10), /*!< from --reinstall */ + }; + + typedef rpmFlags rpmInstallFlags; +@@ -354,7 +355,7 @@ + }; + + /** \ingroup rpmcli +- * Install/upgrade/freshen binary rpm package. ++ * Install/upgrade/freshen/reinstall binary rpm package. + * @param ts transaction set + * @param ia mode flags and parameters + * @param fileArgv array of package file names (NULL terminated) +diff -uNr rpm-4.11.3/lib/rpminstall.c rpm-4.11.3.reinstall/lib/rpminstall.c +--- rpm-4.11.3/lib/rpminstall.c 2014-09-05 13:48:07.000000000 +0200 ++++ rpm-4.11.3.reinstall/lib/rpminstall.c 2017-07-12 16:14:26.843680590 +0200 +@@ -552,7 +552,10 @@ + continue; + } + +- rc = rpmtsAddInstallElement(ts, h, (fnpyKey)fileName, ++ if (ia->installInterfaceFlags & INSTALL_REINSTALL) ++ rc = rpmtsAddReinstallElement(ts, h, (fnpyKey)fileName); ++ else ++ rc = rpmtsAddInstallElement(ts, h, (fnpyKey)fileName, + (ia->installInterfaceFlags & INSTALL_UPGRADE) != 0, + relocations); + +diff -uNr rpm-4.11.3/lib/rpmts.h rpm-4.11.3.reinstall/lib/rpmts.h +--- rpm-4.11.3/lib/rpmts.h 2017-07-12 16:57:41.710722762 +0200 ++++ rpm-4.11.3.reinstall/lib/rpmts.h 2017-07-12 16:14:12.203550634 +0200 +@@ -544,6 +544,16 @@ + rpmRelocation * relocs); + + /** \ingroup rpmts ++ * Add package to be reinstalled to transaction set. ++ * ++ * @param ts transaction set ++ * @param h header ++ * @param key package retrieval key (e.g. file name) ++ * @return 0 on success ++ */ ++int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key); ++ ++/** \ingroup rpmts + * Add package to be erased to transaction set. + * @param ts transaction set + * @param h header +diff -uNr rpm-4.11.3/lib/rpmts_internal.h rpm-4.11.3.reinstall/lib/rpmts_internal.h +--- rpm-4.11.3/lib/rpmts_internal.h 2014-06-04 11:25:23.000000000 +0200 ++++ rpm-4.11.3.reinstall/lib/rpmts_internal.h 2017-07-12 16:44:18.613959252 +0200 +@@ -86,6 +86,11 @@ + RPM_GNUC_INTERNAL + tsMembers rpmtsMembers(rpmts ts); + ++/* Return rpmdb iterator with removals optionally pruned out */ ++RPM_GNUC_INTERNAL ++rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag, ++ const char * key, int prune); ++ + RPM_GNUC_INTERNAL + rpmal rpmtsCreateAl(rpmts ts, rpmElementTypes types); + +@@ -118,6 +123,9 @@ + */ + void rpmtsSELabelFini(rpmts ts, int close_status); + ++RPM_GNUC_INTERNAL ++rpmRC rpmtsSetupTransactionPlugins(rpmts ts); ++ + #ifdef __cplusplus + } + #endif +diff -uNr rpm-4.11.3/lib/transaction.c rpm-4.11.3.reinstall/lib/transaction.c +--- rpm-4.11.3/lib/transaction.c 2017-07-12 16:57:41.747723085 +0200 ++++ rpm-4.11.3.reinstall/lib/transaction.c 2017-07-12 16:43:59.563741144 +0200 +@@ -1138,7 +1138,7 @@ + if (!(probFilter & RPMPROB_FILTER_REPLACEPKG)) { + Header h; + rpmdbMatchIterator mi; +- mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(p), 0); ++ mi = rpmtsPrunedIterator(ts, RPMDBI_NAME, rpmteN(p), 1); + rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, rpmteE(p)); + rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP, rpmteV(p)); + rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, rpmteR(p)); +@@ -1444,7 +1444,7 @@ + return rc; + } + +-static rpmRC rpmtsSetupTransactionPlugins(rpmts ts) ++rpmRC rpmtsSetupTransactionPlugins(rpmts ts) + { + rpmRC rc = RPMRC_OK; + ARGV_t files = NULL; +diff -uNr rpm-4.11.3/python/rpm/transaction.py rpm-4.11.3.reinstall/python/rpm/transaction.py +--- rpm-4.11.3/python/rpm/transaction.py 2014-02-05 14:04:02.000000000 +0100 ++++ rpm-4.11.3.reinstall/python/rpm/transaction.py 2017-07-12 16:14:22.573642686 +0200 +@@ -50,7 +50,7 @@ + else: + return tuple(keys) + +- def addInstall(self, item, key, how="u"): ++ def _f2hdr(self, item): + if isinstance(item, _string_types): + f = open(item) + header = self.hdrFromFdno(f) +@@ -59,6 +59,10 @@ + header = item + else: + header = self.hdrFromFdno(item) ++ return header ++ ++ def addInstall(self, item, key, how="u"): ++ header = self._f2hdr(item) + + if not how in ['u', 'i']: + raise ValueError('how argument must be "u" or "i"') +@@ -67,6 +71,12 @@ + if not TransactionSetCore.addInstall(self, header, key, upgrade): + raise rpm.error("adding package to transaction failed") + ++ def addReinstall(self, item, key): ++ header = self._f2hdr(item) ++ ++ if not TransactionSetCore.addReinstall(self, header, key): ++ raise rpm.error("adding package to transaction failed") ++ + def addErase(self, item): + hdrs = [] + if isinstance(item, rpm.hdr): +diff -uNr rpm-4.11.3/python/rpmts-py.c rpm-4.11.3.reinstall/python/rpmts-py.c +--- rpm-4.11.3/python/rpmts-py.c 2017-07-12 16:57:41.741723032 +0200 ++++ rpm-4.11.3.reinstall/python/rpmts-py.c 2017-07-12 16:14:18.800609194 +0200 +@@ -190,6 +190,24 @@ + } + + static PyObject * ++rpmts_AddReinstall(rpmtsObject * s, PyObject * args) ++{ ++ Header h = NULL; ++ PyObject * key; ++ int rc; ++ ++ if (!PyArg_ParseTuple(args, "O&O:AddReinstall", ++ hdrFromPyObject, &h, &key)) ++ return NULL; ++ ++ rc = rpmtsAddReinstallElement(s->ts, h, key); ++ if (key && rc == 0) { ++ PyList_Append(s->keyList, key); ++ } ++ return PyBool_FromLong((rc == 0)); ++} ++ ++static PyObject * + rpmts_AddErase(rpmtsObject * s, PyObject * args) + { + Header h; +@@ -693,6 +711,8 @@ + static struct PyMethodDef rpmts_methods[] = { + {"addInstall", (PyCFunction) rpmts_AddInstall, METH_VARARGS, + NULL }, ++ {"addReinstall", (PyCFunction) rpmts_AddReinstall, METH_VARARGS, ++ NULL }, + {"addErase", (PyCFunction) rpmts_AddErase, METH_VARARGS|METH_KEYWORDS, + NULL }, + {"check", (PyCFunction) rpmts_Check, METH_VARARGS|METH_KEYWORDS, +diff -uNr rpm-4.11.3/rpmqv.c rpm-4.11.3.reinstall/rpmqv.c +--- rpm-4.11.3/rpmqv.c 2012-11-07 13:55:24.000000000 +0100 ++++ rpm-4.11.3.reinstall/rpmqv.c 2017-07-12 16:14:26.843680590 +0200 +@@ -135,7 +135,8 @@ + #ifdef IAM_RPMEIU + if (bigMode == MODE_UNKNOWN || (bigMode & MODES_IE)) + { int iflags = (ia->installInterfaceFlags & +- (INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL)); ++ (INSTALL_UPGRADE|INSTALL_FRESHEN| ++ INSTALL_INSTALL|INSTALL_REINSTALL)); + int eflags = (ia->installInterfaceFlags & INSTALL_ERASE); + + if (iflags & eflags) diff --git a/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch b/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch new file mode 100644 index 0000000..e785591 --- /dev/null +++ b/SOURCES/rpm-4.11.x-remove-perl-provides-from-requires.patch @@ -0,0 +1,104 @@ +--- rpm-4.11.3/scripts/perl.req.old 2019-01-02 13:14:10.258068525 +0100 ++++ rpm-4.11.3/scripts/perl.req 2019-02-28 11:00:57.200220227 +0100 +@@ -42,18 +42,29 @@ + $HAVE_VERSION = 0; + eval { require version; $HAVE_VERSION = 1; }; + ++use File::Basename; ++my $dir = dirname($0); ++$HAVE_PROV = 0; ++if ( -e "$dir/perl.prov" ) { ++ $HAVE_PROV = 1; ++ $prov_script = "$dir/perl.prov"; ++} + + if ("@ARGV") { +- foreach (@ARGV) { +- process_file($_); ++ foreach my $file (@ARGV) { ++ process_file($file); ++ process_file_provides($file); ++ compute_global_requires(); + } + } else { + + # notice we are passed a list of filenames NOT as common in unix the + # contents of the file. + +- foreach (<>) { +- process_file($_); ++ foreach my $file (<>) { ++ process_file($file); ++ process_file_provides($file); ++ compute_global_requires(); + } + } + +@@ -61,8 +72,9 @@ + foreach $perlver (sort keys %perlreq) { + print "perl >= $perlver\n"; + } +-foreach $module (sort keys %require) { +- if (length($require{$module}) == 0) { ++ ++foreach my $module (sort keys %global_require) { ++ if (length($global_require{$module}) == 0) { + print "perl($module)\n"; + } else { + +@@ -70,13 +82,35 @@ + # operators. Also I will need to change the processing of the + # $RPM_* variable when I upgrade. + +- print "perl($module) >= $require{$module}\n"; ++ print "perl($module) >= $global_require{$module}\n"; + } + } + + exit 0; + +- ++sub compute_global_requires { ++ ++# restrict require to all non provided by the file ++ foreach my $moduler (sort keys %require) { ++ if (exists $provide{$moduler} && length($require{$moduler}) == 0) { ++ $require = delete $require{$moduler}; ++ } ++ } ++# store requires to global_requires ++ foreach my $module (sort keys %require) { ++ my $oldver = $global_require{$module}; ++ my $newver = $require{$module}; ++ if ($oldver) { ++ $global_require{$module} = $newver ++ if ($HAVE_VERSION && $newver && version->new($oldver) < $newver); ++ } else { ++ $global_require{$module} = $newver; ++ } ++ } ++# remove all local requires and provides ++ undef %require; ++ undef %provide; ++} + + sub add_require { + my ($module, $newver) = @_; +@@ -328,3 +362,17 @@ + + return; + } ++ ++sub process_file_provides { ++ ++ my ($file) = @_; ++ chomp $file; ++ ++ return if (! $HAVE_PROV); ++ ++ my @result = readpipe( "$prov_script $file" ); ++ foreach my $prov (@result) { ++ $provide{$1} = undef if $prov =~ /perl\(([_:a-zA-Z0-9]+)\)/; ++ } ++ ++} diff --git a/SOURCES/rpm-4.11.x-setcaps.patch b/SOURCES/rpm-4.11.x-setcaps.patch new file mode 100644 index 0000000..097c5e8 --- /dev/null +++ b/SOURCES/rpm-4.11.x-setcaps.patch @@ -0,0 +1,28 @@ +--- rpm-4.11.3/rpmpopt.in.old 2019-01-02 13:14:10.222068485 +0100 ++++ rpm-4.11.3/rpmpopt.in 2019-01-02 13:36:46.212326391 +0100 +@@ -52,6 +52,25 @@ + --pipe "(echo 'ch() { chown -h -- \"$1\" \"$3\";chgrp -h -- \"$2\" \"$3\"; }';grep '^ch '|grep -v \(none\))|sh" \ + --POPTdesc=$"set user/group ownership of files in a package" + ++ ++rpm alias --setcaps -q --qf \ ++ "[if \[ -f %{FILENAMES:shescape} -a ! -L %{FILENAMES:shescape} \]; then\n\ ++%|FILECAPS?{ if \[ -n %{FILECAPS:shescape} \]; then\n\ ++ setcap %{FILECAPS:shescape} %{FILENAMES:shescape}\n\ ++ el}:{ }|if \[ -n \"\$(getcap %{FILENAMES:shescape})\" \]; then\n\ ++ setcap -r %{FILENAMES:shescape}\n\ ++ fi\n\ ++fi\n]" \ ++ --pipe "sh" \ ++ --POPTdesc=$"set capabilities of files in a package" ++ ++rpm alias --restore -q --qf \ ++ '[ rpm --setugids %{NAME:shescape}; \ ++ rpm --setperms %{NAME:shescape}; \ ++ rpm --setcaps %{NAME:shescape}; \n]' --pipe "sh" \ ++ --POPTdesc=$"restore file/directory permissions" ++ ++ + rpm alias --conflicts --qf \ + "[%|VERBOSE?{%{CONFLICTFLAGS:deptype}: }:{}|%{CONFLICTNEVRS}\n]" \ + --POPTdesc=$"list capabilities this package conflicts with" diff --git a/SOURCES/rpm-4.11.x-setperms-setugids-mutual-exclusion.patch b/SOURCES/rpm-4.11.x-setperms-setugids-mutual-exclusion.patch new file mode 100644 index 0000000..b422346 --- /dev/null +++ b/SOURCES/rpm-4.11.x-setperms-setugids-mutual-exclusion.patch @@ -0,0 +1,25 @@ +From 6013799f80d4dc4fbf5d23cfa0c54ffdee4f95c7 Mon Sep 17 00:00:00 2001 +From: jchaloup +Date: Fri, 13 Jun 2014 12:53:02 +0200 +Subject: [PATCH] rpm.8 setperms setugids mutual exclusion + +--- + doc/rpm.8 | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/doc/rpm.8 b/doc/rpm.8 +index 31ccceb..c3b79bd 100644 +--- a/doc/rpm.8 ++++ b/doc/rpm.8 +@@ -851,6 +851,8 @@ sets permissions of files in the given package. + .TP + \fBrpm\fR \fB--setugids\fR \fIPACKAGE_NAME\fR + sets user/group ownership of files in the given package. ++.TP ++Options \fB--setperms\fR and \fB--setugids\fR are mutually exclusive. + + .SS "FTP/HTTP OPTIONS" + .PP +-- +1.9.3 + diff --git a/SOURCES/rpm-4.11.x-skipattr.patch b/SOURCES/rpm-4.11.x-skipattr.patch new file mode 100644 index 0000000..5095f7d --- /dev/null +++ b/SOURCES/rpm-4.11.x-skipattr.patch @@ -0,0 +1,61 @@ +diff --git a/lib/query.c b/lib/query.c +index 6f2d593a7..8a2623241 100644 +--- a/lib/query.c ++++ b/lib/query.c +@@ -150,8 +150,8 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h) + if ((qva->qva_flags & QUERY_FOR_LICENSE) && !(fflags & RPMFILE_LICENSE)) + continue; + +- /* If not querying %ghost, skip ghost files. */ +- if ((qva->qva_fflags & RPMFILE_GHOST) && (fflags & RPMFILE_GHOST)) ++ /* Skip on attributes (eg from --noghost) */ ++ if (fflags & qva->qva_fflags) + continue; + + if (qva->qva_flags & QUERY_FOR_STATE) { +diff --git a/lib/verify.c b/lib/verify.c +index eb6f2e15e..df17a7b01 100644 +--- a/lib/verify.c ++++ b/lib/verify.c +@@ -378,10 +378,11 @@ static const char * stateStr(rpmfileState fstate) + * @param ts transaction set + * @param h header to verify + * @param omitMask bits to disable verify checks +- * @param ghosts should ghosts be verified? ++ * @param skipAttr skip files with these attrs (eg %ghost) + * @return 0 no problems, 1 problems found + */ +-static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts) ++static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, ++ rpmfileAttrs skipAttrs) + { + rpmVerifyAttrs verifyResult = 0; + int ec = 0; /* assume no problems */ +@@ -398,8 +399,8 @@ static int verifyHeader(rpmts ts, Header h, rpmVerifyAttrs omitMask, int ghosts) + char ac; + int rc; + +- /* If not verifying %ghost, skip ghost files. */ +- if ((fileAttrs & RPMFILE_GHOST) && !ghosts) ++ /* Skip on attributes (eg from --noghost) */ ++ if (skipAttrs & fileAttrs) + continue; + + rc = rpmVerifyFile(ts, fi, &verifyResult, omitMask); +@@ -494,7 +495,6 @@ static int verifyDependencies(rpmts ts, Header h) + int showVerifyPackage(QVA_t qva, rpmts ts, Header h) + { + rpmVerifyAttrs omitMask = ((qva->qva_flags & VERIFY_ATTRS) ^ VERIFY_ATTRS); +- int ghosts = (qva->qva_fflags & RPMFILE_GHOST); + int ec = 0; + int rc; + +@@ -503,7 +503,7 @@ int showVerifyPackage(QVA_t qva, rpmts ts, Header h) + ec = rc; + } + if (qva->qva_flags & VERIFY_FILES) { +- if ((rc = verifyHeader(ts, h, omitMask, ghosts)) != 0) ++ if ((rc = verifyHeader(ts, h, omitMask, qva->qva_fflags)) != 0) + ec = rc; + } + if (qva->qva_flags & VERIFY_SCRIPT) { diff --git a/SOURCES/rpm-4.11.x-sources-to-lua-variables.patch b/SOURCES/rpm-4.11.x-sources-to-lua-variables.patch new file mode 100644 index 0000000..a5ea75d --- /dev/null +++ b/SOURCES/rpm-4.11.x-sources-to-lua-variables.patch @@ -0,0 +1,43 @@ +From 344f938670b8f7400ef177945cef5552783d450f Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Fri, 10 Apr 2015 17:28:17 +0200 +Subject: [PATCH] Fix adding of sources to lua variables during recursive + parsing of spec + +- Before this fix sources and patches weren't added to lua variables + "sources" and "patches" if they were located in spec file after tag + "BuildArch". Now it works.(rhbz:#1084309) +--- + build/parsePreamble.c | 2 +- + build/spec.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/build/parsePreamble.c b/build/parsePreamble.c +index 21160cd..521068c 100644 +--- a/build/parsePreamble.c ++++ b/build/parsePreamble.c +@@ -308,7 +308,7 @@ static int addSource(rpmSpec spec, Package pkg, const char *field, rpmTagVal tag + addMacro(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); +diff --git a/build/spec.c b/build/spec.c +index d06e2c1..1db5d15 100644 +--- a/build/spec.c ++++ b/build/spec.c +@@ -239,6 +239,8 @@ rpmSpec newSpec(void) + { + /* 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); +-- +2.9.3 + diff --git a/SOURCES/rpm-4.11.x-systemd-inhibit.patch b/SOURCES/rpm-4.11.x-systemd-inhibit.patch new file mode 100644 index 0000000..6757b1a --- /dev/null +++ b/SOURCES/rpm-4.11.x-systemd-inhibit.patch @@ -0,0 +1,657 @@ +diff --git a/configure.ac b/configure.ac +index 167491e..3bacc1d 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -745,6 +745,16 @@ 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.0], ++ [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]) + + with_dmalloc=no + AC_ARG_WITH(dmalloc, [AS_HELP_STRING([--with-dmalloc],[build with dmalloc debugging support])]) +diff --git a/lib/psm.c b/lib/psm.c +index 8f5376d..e80a90e 100644 +--- a/lib/psm.c ++++ b/lib/psm.c +@@ -23,8 +23,11 @@ + #include "lib/rpmfi_internal.h" /* XXX replaced/states... */ + #include "lib/rpmte_internal.h" /* XXX internal apis */ + #include "lib/rpmdb_internal.h" /* rpmdbAdd/Remove */ ++#include "lib/rpmts_internal.h" /* ts->plugins */ + #include "lib/rpmscript.h" + ++#include "lib/rpmplugins.h" ++ + #include "debug.h" + + typedef enum pkgStage_e { +@@ -421,7 +424,7 @@ static rpmRC runScript(rpmpsm psm, ARGV_const_t prefixes, + + rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); + rc = rpmScriptRun(script, arg1, arg2, sfd, +- prefixes, warn_only, selinux); ++ prefixes, warn_only, selinux, psm->ts->plugins); + rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0); + + /* Map warn-only errors to "notfound" for script stop callback */ +@@ -1033,16 +1036,23 @@ rpmRC rpmpsmRun(rpmts ts, rpmte te, pkgGoal goal) + switch (goal) { + case PKG_INSTALL: + case PKG_ERASE: +- op = (goal == PKG_INSTALL) ? RPMTS_OP_INSTALL : RPMTS_OP_ERASE; +- rpmswEnter(rpmtsOp(psm->ts, op), 0); ++ /* Run pre transaction element hook for all plugins */ ++ if (rpmpluginsCallPsmPre(ts->plugins, te) != RPMRC_FAIL) { ++ ++ op = (goal == PKG_INSTALL) ? RPMTS_OP_INSTALL : RPMTS_OP_ERASE; ++ rpmswEnter(rpmtsOp(psm->ts, op), 0); + +- rc = rpmpsmNext(psm, PSM_INIT); +- if (!rc) rc = rpmpsmNext(psm, PSM_PRE); +- if (!rc) rc = rpmpsmNext(psm, PSM_PROCESS); +- if (!rc) rc = rpmpsmNext(psm, PSM_POST); +- (void) rpmpsmNext(psm, PSM_FINI); ++ rc = rpmpsmNext(psm, PSM_INIT); ++ if (!rc) rc = rpmpsmNext(psm, PSM_PRE); ++ if (!rc) rc = rpmpsmNext(psm, PSM_PROCESS); ++ if (!rc) rc = rpmpsmNext(psm, PSM_POST); ++ (void) rpmpsmNext(psm, PSM_FINI); ++ ++ rpmswExit(rpmtsOp(psm->ts, op), 0); ++ } + +- rpmswExit(rpmtsOp(psm->ts, op), 0); ++ /* Run post transaction element hook for all plugins */ ++ rpmpluginsCallPsmPost(ts->plugins, te, rc); + break; + case PKG_PRETRANS: + case PKG_POSTTRANS: +diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c +index 9098aa5..7285f54 100644 +--- a/lib/rpmplugins.c ++++ b/lib/rpmplugins.c +@@ -76,16 +76,16 @@ rpmRC rpmpluginsAdd(rpmPlugins plugins, const char *name, const char *path, + return rpmpluginsCallInit(plugins, name, opts); + } + +-rpmRC rpmpluginsAddCollectionPlugin(rpmPlugins plugins, const char *name) ++rpmRC rpmpluginsAddPlugin(rpmPlugins plugins, const char *type, const char *name) + { + char *path; + char *options; + rpmRC rc = RPMRC_FAIL; + +- path = rpmExpand("%{?__collection_", name, "}", NULL); ++ path = rpmExpand("%{?__", type, "_", name, "}", NULL); + if (!path || rstreq(path, "")) { +- rpmlog(RPMLOG_ERR, _("Failed to expand %%__collection_%s macro\n"), +- name); ++ rpmlog(RPMLOG_ERR, _("Failed to expand %%__%s_%s macro\n"), ++ type, name); + goto exit; + } + +@@ -195,3 +195,88 @@ rpmRC rpmpluginsCallCollectionPreRemove(rpmPlugins plugins, const char *name) + RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_COLL_PRE_REMOVE); + return hookFunc(); + } ++ ++rpmRC rpmpluginsCallTsmPre(rpmPlugins plugins, rpmts ts) ++{ ++ rpmRC (*hookFunc)(rpmts); ++ int i; ++ rpmRC rc = RPMRC_OK; ++ const char *name = NULL; ++ ++ for (i = 0; i < plugins->count; i++) { ++ name = plugins->names[i]; ++ RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_TSM_PRE); ++ if (hookFunc(ts) == RPMRC_FAIL) ++ rc = RPMRC_FAIL; ++ } ++ ++ return rc; ++} ++ ++rpmRC rpmpluginsCallTsmPost(rpmPlugins plugins, rpmts ts, int res) ++{ ++ rpmRC (*hookFunc)(rpmts, int); ++ int i; ++ rpmRC rc = RPMRC_OK; ++ const char *name = NULL; ++ ++ for (i = 0; i < plugins->count; i++) { ++ name = plugins->names[i]; ++ RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_TSM_POST); ++ if (hookFunc(ts, res) == RPMRC_FAIL) ++ rc = RPMRC_FAIL; ++ } ++ ++ return rc; ++} ++ ++rpmRC rpmpluginsCallPsmPre(rpmPlugins plugins, rpmte te) ++{ ++ rpmRC (*hookFunc)(rpmte); ++ int i; ++ rpmRC rc = RPMRC_OK; ++ const char *name = NULL; ++ ++ for (i = 0; i < plugins->count; i++) { ++ name = plugins->names[i]; ++ RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_PSM_PRE); ++ if (hookFunc(te) == RPMRC_FAIL) ++ rc = RPMRC_FAIL; ++ } ++ ++ return rc; ++} ++ ++rpmRC rpmpluginsCallPsmPost(rpmPlugins plugins, rpmte te, int res) ++{ ++ rpmRC (*hookFunc)(rpmte, int); ++ int i; ++ rpmRC rc = RPMRC_OK; ++ const char *name = NULL; ++ ++ for (i = 0; i < plugins->count; i++) { ++ name = plugins->names[i]; ++ RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_PSM_POST); ++ if (hookFunc(te, res) == RPMRC_FAIL) ++ rc = RPMRC_FAIL; ++ } ++ ++ return rc; ++} ++ ++rpmRC rpmpluginsCallScriptSetup(rpmPlugins plugins, char* path) ++{ ++ rpmRC (*hookFunc)(char*); ++ int i; ++ rpmRC rc = RPMRC_OK; ++ const char *name = NULL; ++ ++ for (i = 0; i < plugins->count; i++) { ++ name = plugins->names[i]; ++ RPMPLUGINS_SET_HOOK_FUNC(PLUGINHOOK_SCRIPT_SETUP); ++ if (hookFunc(path) == RPMRC_FAIL) ++ rc = RPMRC_FAIL; ++ } ++ ++ return rc; ++} +diff --git a/lib/rpmplugins.h b/lib/rpmplugins.h +index 7985559..c462eae 100644 +--- a/lib/rpmplugins.h ++++ b/lib/rpmplugins.h +@@ -11,11 +11,20 @@ extern "C" { + + #define PLUGINHOOK_INIT_FUNC pluginhook_init + #define PLUGINHOOK_CLEANUP_FUNC pluginhook_cleanup ++ + #define PLUGINHOOK_OPENTE_FUNC pluginhook_opente + #define PLUGINHOOK_COLL_POST_ADD_FUNC pluginhook_coll_post_add + #define PLUGINHOOK_COLL_POST_ANY_FUNC pluginhook_coll_post_any + #define PLUGINHOOK_COLL_PRE_REMOVE_FUNC pluginhook_coll_pre_remove + ++#define PLUGINHOOK_TSM_PRE_FUNC pluginhook_tsm_pre ++#define PLUGINHOOK_TSM_POST_FUNC pluginhook_tsm_post ++ ++#define PLUGINHOOK_PSM_PRE_FUNC pluginhook_psm_pre ++#define PLUGINHOOK_PSM_POST_FUNC pluginhook_psm_post ++ ++#define PLUGINHOOK_SCRIPT_SETUP_FUNC pluginhook_script_setup ++ + enum rpmPluginHook_e { + PLUGINHOOK_NONE = 0, + PLUGINHOOK_INIT = 1 << 0, +@@ -23,7 +32,12 @@ enum rpmPluginHook_e { + PLUGINHOOK_OPENTE = 1 << 2, + PLUGINHOOK_COLL_POST_ADD = 1 << 3, + PLUGINHOOK_COLL_POST_ANY = 1 << 4, +- PLUGINHOOK_COLL_PRE_REMOVE = 1 << 5 ++ PLUGINHOOK_COLL_PRE_REMOVE = 1 << 5, ++ PLUGINHOOK_TSM_PRE = 1 << 6, ++ PLUGINHOOK_TSM_POST = 1 << 7, ++ PLUGINHOOK_PSM_PRE = 1 << 8, ++ PLUGINHOOK_PSM_POST = 1 << 9, ++ PLUGINHOOK_SCRIPT_SETUP = 1 << 10 + }; + + typedef rpmFlags rpmPluginHook; +@@ -53,12 +67,13 @@ rpmPlugins rpmpluginsFree(rpmPlugins plugins); + rpmRC rpmpluginsAdd(rpmPlugins plugins, const char *name, const char *path, const char *opts); + + /** \ingroup rpmplugins +- * Add and open a collection plugin ++ * Add and open a rpm plugin + * @param plugins plugins structure to add a collection plugin to +- * @param name name of collection to open ++ * @param type type of plugin ++ * @param name name of plugin + * @return RPMRC_OK on success, RPMRC_FAIL otherwise + */ +-rpmRC rpmpluginsAddCollectionPlugin(rpmPlugins plugins, const char *name); ++rpmRC rpmpluginsAddPlugin(rpmPlugins plugins, const char *type, const char *name); + + /** \ingroup rpmplugins + * Determine if a plugin has been added already +@@ -119,6 +134,48 @@ rpmRC rpmpluginsCallCollectionPostAny(rpmPlugins plugins, const char *name); + */ + rpmRC rpmpluginsCallCollectionPreRemove(rpmPlugins plugins, const char *name); + ++/** \ingroup rpmplugins ++ * Call the pre transaction plugin hook ++ * @param plugins plugins structure ++ * @param ts processed transaction ++ * @return RPMRC_OK on success, RPMRC_FAIL otherwise ++ */ ++rpmRC rpmpluginsCallTsmPre(rpmPlugins plugins, rpmts ts); ++ ++/** \ingroup rpmplugins ++ * Call the post transaction plugin hook ++ * @param plugins plugins structure ++ * @param ts processed transaction ++ * @param res transaction result code ++ * @return RPMRC_OK on success, RPMRC_FAIL otherwise ++ */ ++rpmRC rpmpluginsCallTsmPost(rpmPlugins plugins, rpmts ts, int res); ++ ++/** \ingroup rpmplugins ++ * Call the pre transaction element plugin hook ++ * @param plugins plugins structure ++ * @param te processed transaction element ++ * @return RPMRC_OK on success, RPMRC_FAIL otherwise ++ */ ++rpmRC rpmpluginsCallPsmPre(rpmPlugins plugins, rpmte te); ++ ++/** \ingroup rpmplugins ++ * Call the post transaction element plugin hook ++ * @param plugins plugins structure ++ * @param te processed transaction element ++ * @param res transaction element result code ++ * @return RPMRC_OK on success, RPMRC_FAIL otherwise ++ */ ++rpmRC rpmpluginsCallPsmPost(rpmPlugins plugins, rpmte te, int res); ++ ++/** \ingroup rpmplugins ++ * Call the script setup plugin hook ++ * @param plugins plugins structure ++ * @param path script path ++ * @return RPMRC_OK on success, RPMRC_FAIL otherwise ++ */ ++rpmRC rpmpluginsCallScriptSetup(rpmPlugins plugins, char* path); ++ + #ifdef __cplusplus + } + #endif +diff --git a/lib/rpmscript.c b/lib/rpmscript.c +index 57c24c6..f8c5fc7 100644 +--- a/lib/rpmscript.c ++++ b/lib/rpmscript.c +@@ -14,6 +14,8 @@ + #include "rpmio/rpmlua.h" + #include "lib/rpmscript.h" + ++#include "lib/rpmplugins.h" /* rpm plugins hooks */ ++ + #include "debug.h" + + struct rpmScript_s { +@@ -91,7 +93,7 @@ static rpmRC runLuaScript(int selinux, ARGV_const_t prefixes, + + static const char * const SCRIPT_PATH = "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin"; + +-static void doScriptExec(int selinux, ARGV_const_t argv, ARGV_const_t prefixes, ++static void doScriptExec(rpmPlugins plugins, int selinux, ARGV_const_t argv, ARGV_const_t prefixes, + FD_t scriptFd, FD_t out) + { + int pipes[2]; +@@ -169,7 +171,10 @@ static void doScriptExec(int selinux, ARGV_const_t argv, ARGV_const_t prefixes, + } + + if (xx == 0) { +- xx = execv(argv[0], argv); ++ /* Run script setup hook for all plugins */ ++ if (rpmpluginsCallScriptSetup(plugins, argv[0]) != RPMRC_FAIL) { ++ xx = execv(argv[0], argv); ++ } + } + } + _exit(127); /* exit 127 for compatibility with bash(1) */ +@@ -202,7 +207,7 @@ exit: + /** + * Run an external script. + */ +-static rpmRC runExtScript(int selinux, ARGV_const_t prefixes, ++static rpmRC runExtScript(rpmPlugins plugins, int selinux, ARGV_const_t prefixes, + const char *sname, rpmlogLvl lvl, FD_t scriptFd, + ARGV_t * argvp, const char *script, int arg1, int arg2) + { +@@ -258,7 +263,7 @@ static rpmRC runExtScript(int selinux, ARGV_const_t prefixes, + } else if (pid == 0) {/* Child */ + rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n", + sname, *argvp[0], (unsigned)getpid()); +- doScriptExec(selinux, *argvp, prefixes, scriptFd, out); ++ doScriptExec(plugins, selinux, *argvp, prefixes, scriptFd, out); + } + + do { +@@ -297,7 +302,7 @@ exit: + } + + rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, +- ARGV_const_t prefixes, int warn_only, int selinux) ++ ARGV_const_t prefixes, int warn_only, int selinux, rpmPlugins plugins) + { + ARGV_t args = NULL; + rpmlogLvl lvl = warn_only ? RPMLOG_WARNING : RPMLOG_ERR; +@@ -315,7 +320,7 @@ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, + if (rstreq(args[0], "")) { + rc = runLuaScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); + } else { +- rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); ++ rc = runExtScript(plugins, selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2); + } + argvFree(args); + +diff --git a/lib/rpmscript.h b/lib/rpmscript.h +index 7d584bc..852735b 100644 +--- a/lib/rpmscript.h ++++ b/lib/rpmscript.h +@@ -29,7 +29,7 @@ rpmScript rpmScriptFree(rpmScript script); + + RPM_GNUC_INTERNAL + rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd, +- ARGV_const_t prefixes, int warn_only, int selinux); ++ ARGV_const_t prefixes, int warn_only, int selinux, rpmPlugins plugins); + + RPM_GNUC_INTERNAL + rpmTagVal rpmScriptTag(rpmScript script); +diff --git a/lib/rpmte.c b/lib/rpmte.c +index 87fb391..9fc5522 100644 +--- a/lib/rpmte.c ++++ b/lib/rpmte.c +@@ -889,7 +889,7 @@ rpmRC rpmteSetupCollectionPlugins(rpmte te) + rpmteOpen(te, 0); + for (; colls && *colls; colls++) { + if (!rpmpluginsPluginAdded(plugins, *colls)) { +- rc = rpmpluginsAddCollectionPlugin(plugins, *colls); ++ rc = rpmpluginsAddPlugin(plugins, "collection", *colls); + if (rc != RPMRC_OK) { + break; + } +diff --git a/lib/transaction.c b/lib/transaction.c +index 45c30b5..08a5643 100644 +--- a/lib/transaction.c ++++ b/lib/transaction.c +@@ -22,6 +22,8 @@ + #include "lib/rpmts_internal.h" + #include "rpmio/rpmhook.h" + ++#include "lib/rpmplugins.h" ++ + /* XXX FIXME: merge with existing (broken?) tests in system.h */ + /* portability fiddles */ + #if STATFS_IN_SYS_STATVFS +@@ -1435,12 +1437,43 @@ static int rpmtsProcess(rpmts ts) + return rc; + } + ++static rpmRC rpmtsSetupTransactionPlugins(rpmts ts) ++{ ++ rpmRC rc = RPMRC_OK; ++ char *plugins = NULL, *plugin = NULL; ++ const char *delims = ","; ++ ++ plugins = rpmExpand("%{?__transaction_plugins}", NULL); ++ if (!plugins || rstreq(plugins, "")) { ++ goto exit; ++ } ++ ++ plugin = strtok(plugins, delims); ++ while(plugin != NULL) { ++ rpmlog(RPMLOG_DEBUG, "plugin is %s\n", plugin); ++ if (!rpmpluginsPluginAdded(ts->plugins, (const char*)plugin)) { ++ if (rpmpluginsAddPlugin(ts->plugins, "transaction", ++ (const char*)plugin) == RPMRC_FAIL) { ++ /* any configured plugin failing to load is a failure */ ++ rc = RPMRC_FAIL; ++ } ++ } ++ plugin = strtok(NULL, delims); ++ } ++ ++exit: ++ free(plugins); ++ return rc; ++} ++ + int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + { + int rc = -1; /* assume failure */ + tsMembers tsmem = rpmtsMembers(ts); + rpmlock lock = NULL; + rpmps tsprobs = NULL; ++ int TsmPreDone = 0; /* TsmPre hook hasn't been called */ ++ + /* Force default 022 umask during transaction for consistent results */ + mode_t oldmask = umask(022); + +@@ -1462,11 +1495,21 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + goto exit; + } + ++ if (rpmtsSetupTransactionPlugins(ts) == RPMRC_FAIL) { ++ goto exit; ++ } ++ + rpmtsSetupCollections(ts); + + /* Check package set for problems */ + tsprobs = checkProblems(ts); + ++ /* Run pre transaction hook for all plugins */ ++ TsmPreDone = 1; ++ if (rpmpluginsCallTsmPre(ts->plugins, ts) == RPMRC_FAIL) { ++ goto exit; ++ } ++ + /* Run pre-transaction scripts, but only if there are no known + * problems up to this point and not disabled otherwise. */ + if (!((rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRE)) +@@ -1511,6 +1554,10 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) + } + + exit: ++ /* Run post transaction hook for all plugins */ ++ if (TsmPreDone) /* If TsmPre hook has been called, call the TsmPost hook */ ++ rpmpluginsCallTsmPost(ts->plugins, ts, rc); ++ + /* Finish up... */ + (void) umask(oldmask); + (void) rpmtsFinish(ts); +diff --git a/macros.in b/macros.in +index 3aaebcd..fb030b5 100644 +--- a/macros.in ++++ b/macros.in +@@ -1032,6 +1032,9 @@ done \ + %__collection_sepolicy %{__plugindir}/sepolicy.so + %__collection_sepolicy_flags 1 + ++# Transaction plugin macros ++%__transaction_systemd_inhibit %{__plugindir}/systemd_inhibit.so ++ + #------------------------------------------------------------------------------ + # Macros for further automated spec %setup and patch application + +diff --git a/plugins/Makefile.am b/plugins/Makefile.am +index a9c962c..0c0a410 100644 +--- a/plugins/Makefile.am ++++ b/plugins/Makefile.am +@@ -24,3 +24,10 @@ sepolicy_la_LIBADD = $(top_builddir)/lib/librpm.la $(top_builddir)/rpmio/librpmi + + plugins_LTLIBRARIES += sepolicy.la + endif ++ ++if DBUS ++systemd_inhibit_la_SOURCES = systemd_inhibit.c ++systemd_inhibit_la_CPPFLAGS = $(AM_CPPFLAGS) @DBUS_CFLAGS@ ++systemd_inhibit_la_LIBADD = $(top_builddir)/lib/librpm.la $(top_builddir)/rpmio/librpmio.la @DBUS_LIBS@ ++plugins_LTLIBRARIES += systemd_inhibit.la ++endif +diff --git a/plugins/plugin.h b/plugins/plugin.h +index 5156f93..ad4171a 100644 +--- a/plugins/plugin.h ++++ b/plugins/plugin.h +@@ -7,9 +7,23 @@ + #include "lib/rpmplugins.h" + #include "lib/rpmchroot.h" + ++/* general plugin hooks */ + rpmRC PLUGINHOOK_INIT_FUNC(rpmts ts, const char * name, const char * opts); + rpmRC PLUGINHOOK_CLEANUP_FUNC(void); ++ ++/* collection plugin hooks */ + rpmRC PLUGINHOOK_OPENTE_FUNC(rpmte te); + rpmRC PLUGINHOOK_COLL_POST_ANY_FUNC(void); + rpmRC PLUGINHOOK_COLL_POST_ADD_FUNC(void); + rpmRC PLUGINHOOK_COLL_PRE_REMOVE_FUNC(void); ++ ++/* per transaction plugin hooks */ ++rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmts ts); ++rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmts ts, int res); ++ ++/* per transaction element plugin hooks */ ++rpmRC PLUGINHOOK_PSM_PRE_FUNC(rpmte te); ++rpmRC PLUGINHOOK_PSM_POST_FUNC(rpmte te, int res); ++ ++/*per script plugin hooks */ ++rpmRC PLUGINHOOK_SCRIPT_SETUP_FUNC(char* path); +diff --git a/plugins/systemd_inhibit.c b/plugins/systemd_inhibit.c +new file mode 100644 +index 0000000..e990bec +--- /dev/null ++++ b/plugins/systemd_inhibit.c +@@ -0,0 +1,111 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "plugin.h" ++ ++rpmPluginHook PLUGIN_HOOKS = ( ++ PLUGINHOOK_INIT | ++ PLUGINHOOK_CLEANUP | ++ PLUGINHOOK_TSM_PRE | ++ PLUGINHOOK_TSM_POST ++); ++ ++static int lock_fd = -1; ++ ++rpmRC PLUGINHOOK_INIT_FUNC(rpmts ts, const char *name, const char *opts) ++{ ++ struct stat st; ++ ++ if (lstat("/run/systemd/system/", &st) == 0) { ++ if (S_ISDIR(st.st_mode)) { ++ return RPMRC_OK; ++ } ++ } ++ ++ return RPMRC_NOTFOUND; ++} ++ ++rpmRC PLUGINHOOK_CLEANUP_FUNC(void) ++{ ++ return RPMRC_OK; ++} ++ ++static int inhibit(void) ++{ ++ DBusError err; ++ DBusConnection *bus = NULL; ++ DBusMessage *msg = NULL; ++ DBusMessage *reply = NULL; ++ int fd = -1; ++ ++ dbus_error_init(&err); ++ bus = dbus_bus_get_private(DBUS_BUS_SYSTEM, &err); ++ ++ if (bus) { ++ msg = dbus_message_new_method_call("org.freedesktop.login1", ++ "/org/freedesktop/login1", ++ "org.freedesktop.login1.Manager", ++ "Inhibit"); ++ } ++ ++ if (msg) { ++ const char *what = "shutdown"; ++ const char *mode = "block"; ++ const char *who = "RPM"; ++ const char *reason = "Transaction running"; ++ ++ dbus_message_append_args(msg, ++ DBUS_TYPE_STRING, &what, ++ DBUS_TYPE_STRING, &who, ++ DBUS_TYPE_STRING, &reason, ++ DBUS_TYPE_STRING, &mode, ++ DBUS_TYPE_INVALID); ++ ++ reply = dbus_connection_send_with_reply_and_block(bus, msg, -1, &err); ++ dbus_message_unref(msg); ++ } ++ ++ if (reply) { ++ dbus_message_get_args(reply, &err, ++ DBUS_TYPE_UNIX_FD, &fd, ++ DBUS_TYPE_INVALID); ++ dbus_message_unref(reply); ++ } ++ ++ if (dbus_error_is_set(&err)) ++ dbus_error_free(&err); ++ if (bus) ++ dbus_connection_close(bus); ++ ++ return fd; ++} ++ ++rpmRC PLUGINHOOK_TSM_PRE_FUNC(rpmts ts) ++{ ++ if (rpmtsFlags(ts) & (RPMTRANS_FLAG_TEST|RPMTRANS_FLAG_BUILD_PROBS)) ++ return RPMRC_OK; ++ ++ lock_fd = inhibit(); ++ ++ if (lock_fd < 0) { ++ rpmlog(RPMLOG_WARNING, ++ "Unable to get systemd shutdown inhibition lock\n"); ++ } else { ++ rpmlog(RPMLOG_DEBUG, "System shutdown blocked (fd %d)\n", lock_fd); ++ } ++ ++ return RPMRC_OK; ++} ++ ++rpmRC PLUGINHOOK_TSM_POST_FUNC(rpmts ts, int res) ++{ ++ if (lock_fd >= 0) { ++ close(lock_fd); ++ lock_fd = -1; ++ rpmlog(RPMLOG_DEBUG, "System shutdown unblocked\n"); ++ } ++ return RPMRC_OK; ++} diff --git a/SOURCES/rpm-4.11.x-verify-data-range.patch b/SOURCES/rpm-4.11.x-verify-data-range.patch new file mode 100644 index 0000000..a90614c --- /dev/null +++ b/SOURCES/rpm-4.11.x-verify-data-range.patch @@ -0,0 +1,96 @@ +Adjusted lib/package.c section to apply, and 4.11.x requires the +same change in lib/signature.c as well. + +From 89dce2b91d7d73a1e225461a7392c3d6d7a30a95 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 19 Oct 2016 14:48:08 +0300 +Subject: [PATCH] Verify data is within range and does not overlap in + headerVerifyInfo() + +Checking whether data start offset is within header data area is of no use +whatsoever if the entire chunk doesn't fit. Validate the entire data +fits within range and that it does not overlap, however with string +types we can only check the array size is sane but we cant check the +actual content. + +Adjust the upper limit for region trailer in headerVerifyRegion() so +it fits the new rules, but in reality calling headerVerifyInfo() for +the region tags is rather pointless since they're so different. + +Partial fix for RhBug:1373107. +--- + lib/header.c | 21 ++++++++++++++++----- + lib/package.c | 2 +- + 2 files changed, 17 insertions(+), 6 deletions(-) + +diff --git a/lib/header.c b/lib/header.c +index 7f7c115..cac5c94 100644 +--- a/lib/header.c ++++ b/lib/header.c +@@ -196,7 +196,8 @@ int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate) + { + entryInfo pe = (entryInfo) pev; + entryInfo info = iv; +- int i; ++ int i, tsize; ++ int32_t end = 0; + + for (i = 0; i < il; i++) { + info->tag = ntohl(pe[i].tag); +@@ -206,16 +207,26 @@ int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate) + info->offset = -info->offset; + info->count = ntohl(pe[i].count); + ++ /* Previous data must not overlap */ ++ if (end > info->offset) ++ return i; ++ + if (hdrchkType(info->type)) + return i; + if (hdrchkAlign(info->type, info->offset)) + return i; +- if (hdrchkRange(dl, info->offset)) +- return i; +- if (hdrchkData(info->count)) +- return i; + ++ /* For string types we can only check the array size is sane */ ++ tsize = typeSizes[info->type]; ++ if (tsize < 1) ++ tsize = 1; ++ ++ /* Verify the data actually fits */ ++ end = info->offset + (info->count * tsize); ++ if (hdrchkRange(dl, end)) ++ return i; + } ++ + return -1; + } + +diff --git a/lib/package.c b/lib/package.c +index b6bea09..bb83163 100644 +--- a/lib/package.c ++++ b/lib/package.c +@@ -339,7 +339,7 @@ static rpmRC headerVerify(rpmKeyring keyring, rpmVSFlags vsflags, + (void) memcpy(&info, regionEnd, REGION_TAG_COUNT); + regionEnd += REGION_TAG_COUNT; + +- if (headerVerifyInfo(1, il * sizeof(*pe), &info, &entry.info, 1) != -1 || ++ if (headerVerifyInfo(1, il * sizeof(*pe) + REGION_TAG_COUNT, &info, &entry.info, 1) != -1 || + !(entry.info.tag == RPMTAG_HEADERIMMUTABLE + && entry.info.type == REGION_TAG_TYPE + && entry.info.count == REGION_TAG_COUNT)) +diff --git a/lib/signature.c b/lib/signature.c +index d8017dc..ddf2eb8 100644 +--- a/lib/signature.c ++++ b/lib/signature.c +@@ -165,7 +165,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * sighp, sigType sig_type, char ** msg) + } + dataEnd += REGION_TAG_COUNT; + +- xx = headerVerifyInfo(1, il * sizeof(*pe), &info, &entry.info, 1); ++ xx = headerVerifyInfo(1, il * sizeof(*pe) + REGION_TAG_COUNT, &info, &entry.info, 1); + if (xx != -1 || + !((entry.info.tag == RPMTAG_HEADERSIGNATURES || entry.info.tag == RPMTAG_HEADERIMAGE) + && entry.info.type == REGION_TAG_TYPE diff --git a/SOURCES/rpm-4.11.x-weakdep-tags.patch b/SOURCES/rpm-4.11.x-weakdep-tags.patch new file mode 100644 index 0000000..b8c5290 --- /dev/null +++ b/SOURCES/rpm-4.11.x-weakdep-tags.patch @@ -0,0 +1,102 @@ +diff -up rpm-4.11.3/build/pack.c.weakdep-tags rpm-4.11.3/build/pack.c +--- rpm-4.11.3/build/pack.c.weakdep-tags 2017-11-13 16:46:28.552714717 +0200 ++++ rpm-4.11.3/build/pack.c 2017-11-13 16:47:44.942681784 +0200 +@@ -228,8 +228,6 @@ static rpmTagVal depevrtags[] = { + RPMTAG_CONFLICTVERSION, + RPMTAG_ORDERVERSION, + RPMTAG_TRIGGERVERSION, +- RPMTAG_SUGGESTSVERSION, +- RPMTAG_ENHANCESVERSION, + 0 + }; + +diff -up rpm-4.11.3/lib/rpmtag.h.weakdep-tags rpm-4.11.3/lib/rpmtag.h +--- rpm-4.11.3/lib/rpmtag.h.weakdep-tags 2017-11-02 12:21:38.248264213 +0200 ++++ rpm-4.11.3/lib/rpmtag.h 2017-11-02 12:24:16.159193622 +0200 +@@ -217,14 +217,14 @@ typedef enum rpmTag_e { + RPMTAG_PRETRANSPROG = 1153, /* s[] */ + RPMTAG_POSTTRANSPROG = 1154, /* s[] */ + RPMTAG_DISTTAG = 1155, /* s */ +- RPMTAG_SUGGESTSNAME = 1156, /* s[] extension (unimplemented) */ +-#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] (unimplemented) */ +- RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */ +- RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */ +- RPMTAG_ENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */ +-#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] (unimplemented) */ +- RPMTAG_ENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */ +- RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */ ++ RPMTAG_OLDSUGGESTSNAME = 1156, /* s[] extension (unimplemented) */ ++#define RPMTAG_OLDSUGGESTS RPMTAG_OLDSUGGESTSNAME /* s[] (unimplemented) */ ++ RPMTAG_OLDSUGGESTSVERSION = 1157, /* s[] extension (unimplemented) */ ++ RPMTAG_OLDSUGGESTSFLAGS = 1158, /* i[] extension (unimplemented) */ ++ RPMTAG_OLDENHANCESNAME = 1159, /* s[] extension placeholder (unimplemented) */ ++#define RPMTAG_OLDENHANCES RPMTAG_OLDENHANCESNAME /* s[] (unimplemented) */ ++ RPMTAG_OLDENHANCESVERSION = 1160, /* s[] extension placeholder (unimplemented) */ ++ RPMTAG_OLDENHANCESFLAGS = 1161, /* i[] extension placeholder (unimplemented) */ + RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */ + RPMTAG_CVSID = 1163, /* s (unimplemented) */ + #define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */ +@@ -307,6 +307,22 @@ typedef enum rpmTag_e { + RPMTAG_OBSOLETENEVRS = 5043, /* s[] extension */ + RPMTAG_CONFLICTNEVRS = 5044, /* s[] extension */ + RPMTAG_FILENLINKS = 5045, /* i[] extension */ ++ RPMTAG_RECOMMENDNAME = 5046, /* s[] */ ++#define RPMTAG_RECOMMENDS RPMTAG_RECOMMENDNAME /* s[] */ ++ RPMTAG_RECOMMENDVERSION = 5047, /* s[] */ ++ RPMTAG_RECOMMENDFLAGS = 5048, /* i[] */ ++ RPMTAG_SUGGESTNAME = 5049, /* s[] */ ++#define RPMTAG_SUGGESTS RPMTAG_SUGGESTNAME /* s[] */ ++ RPMTAG_SUGGESTVERSION = 5050, /* s[] extension */ ++ RPMTAG_SUGGESTFLAGS = 5051, /* i[] extension */ ++ RPMTAG_SUPPLEMENTNAME = 5052, /* s[] */ ++#define RPMTAG_SUPPLEMENTS RPMTAG_SUPPLEMENTNAME /* s[] */ ++ RPMTAG_SUPPLEMENTVERSION = 5053, /* s[] */ ++ RPMTAG_SUPPLEMENTFLAGS = 5054, /* i[] */ ++ RPMTAG_ENHANCENAME = 5055, /* s[] */ ++#define RPMTAG_ENHANCES RPMTAG_ENHANCENAME /* s[] */ ++ RPMTAG_ENHANCEVERSION = 5056, /* s[] */ ++ RPMTAG_ENHANCEFLAGS = 5057, /* i[] */ + + RPMTAG_FIRSTFREE_TAG /*!< internal */ + } rpmTag; +diff -up rpm-4.11.3/tests/rpmgeneral.at.weakdep-tags rpm-4.11.3/tests/rpmgeneral.at +--- rpm-4.11.3/tests/rpmgeneral.at.weakdep-tags 2012-11-07 14:55:24.000000000 +0200 ++++ rpm-4.11.3/tests/rpmgeneral.at 2017-11-02 12:21:38.248264213 +0200 +@@ -79,6 +79,10 @@ DISTTAG + DISTURL + DSAHEADER + E ++ENHANCEFLAGS ++ENHANCENAME ++ENHANCES ++ENHANCEVERSION + EPOCH + EPOCHNUM + EVR +@@ -199,6 +203,10 @@ PROVIDES + PROVIDEVERSION + PUBKEYS + R ++RECOMMENDFLAGS ++RECOMMENDNAME ++RECOMMENDS ++RECOMMENDVERSION + RECONTEXTS + RELEASE + REMOVETID +@@ -219,7 +227,15 @@ SOURCE + SOURCEPACKAGE + SOURCEPKGID + SOURCERPM ++SUGGESTFLAGS ++SUGGESTNAME ++SUGGESTS ++SUGGESTVERSION + SUMMARY ++SUPPLEMENTFLAGS ++SUPPLEMENTNAME ++SUPPLEMENTS ++SUPPLEMENTVERSION + TRIGGERCONDS + TRIGGERFLAGS + TRIGGERINDEX diff --git a/SOURCES/rpm-4.12.x-rpmSign-return-value-correction.patch b/SOURCES/rpm-4.12.x-rpmSign-return-value-correction.patch new file mode 100644 index 0000000..7d94f61 --- /dev/null +++ b/SOURCES/rpm-4.12.x-rpmSign-return-value-correction.patch @@ -0,0 +1,10 @@ +--- rpm-4.11.3/sign/rpmgensig.c.old 2014-09-05 13:49:16.000000000 +0200 ++++ rpm-4.11.3/sign/rpmgensig.c 2018-05-03 10:58:37.104522827 +0200 +@@ -506,6 +506,7 @@ + } + goto exit; + } ++ res = -1; + } + + /* Reallocate the signature into one contiguous region. */ diff --git a/SOURCES/rpm-4.13.x-Implement-noconfig-query.patch b/SOURCES/rpm-4.13.x-Implement-noconfig-query.patch new file mode 100644 index 0000000..c8623eb --- /dev/null +++ b/SOURCES/rpm-4.13.x-Implement-noconfig-query.patch @@ -0,0 +1,33 @@ +--- current/lib/poptQV.c.noconfig 2017-10-10 16:36:22.671332271 +0200 ++++ current/lib/poptQV.c 2017-10-10 16:40:44.735808086 +0200 +@@ -185,6 +185,9 @@ + { "noghost", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_GHOST, + N_("skip %%ghost files"), NULL }, ++ { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, ++ &rpmQVKArgs.qva_fflags, RPMFILE_CONFIG, ++ N_("skip %%config files"), NULL }, + + { "qf", '\0', POPT_ARG_STRING | POPT_ARGFLAG_DOC_HIDDEN, 0, + POPT_QUERYFORMAT, NULL, NULL }, +--- current/doc/rpm.8.noconfig 2017-10-10 16:36:22.671332271 +0200 ++++ current/doc/rpm.8 2017-10-10 17:04:28.537393197 +0200 +@@ -76,7 +76,7 @@ + [\fB--nodigest\fR] [\fB--nosignature\fR] + [\fB--nolinkto\fR] [\fB--nofiledigest\fR] [\fB--nosize\fR] [\fB--nouser\fR] + [\fB--nogroup\fR] [\fB--nomtime\fR] [\fB--nomode\fR] [\fB--nordev\fR] +- [\fB--nocaps\fR] ++ [\fB--nocaps\fR] [\fB--noconfig\fR] + + .SS "install-options" + .PP +@@ -673,6 +673,9 @@ + \fB--nofiles\fR + Don't verify any attributes of package files. + .TP ++\fB--noconfig\fR ++Don't verify config files. ++.TP + \fB--noscripts\fR + Don't execute the \fB%verifyscript\fR scriptlet (if any). + .TP diff --git a/SOURCES/rpm-4.13.x-Make-the-stftime-buffer-big-enuff.patch b/SOURCES/rpm-4.13.x-Make-the-stftime-buffer-big-enuff.patch new file mode 100644 index 0000000..6f31ae0 --- /dev/null +++ b/SOURCES/rpm-4.13.x-Make-the-stftime-buffer-big-enuff.patch @@ -0,0 +1,11 @@ +--- current/lib/formats.orig 2017-10-09 16:02:37.884785158 +0200 ++++ current/lib/formats.c 2017-10-09 16:03:20.640862788 +0200 +@@ -101,7 +101,7 @@ + val = xstrdup(_("(not a number)")); + } else { + struct tm * tstruct; +- char buf[50]; ++ char buf[1024]; + time_t dateint = rpmtdGetNumber(td); + tstruct = localtime(&dateint); + diff --git a/SOURCES/rpm-4.13.x-RPMCALLBACK_ELEM_PROGRESS-available-header.patch b/SOURCES/rpm-4.13.x-RPMCALLBACK_ELEM_PROGRESS-available-header.patch new file mode 100644 index 0000000..2b779eb --- /dev/null +++ b/SOURCES/rpm-4.13.x-RPMCALLBACK_ELEM_PROGRESS-available-header.patch @@ -0,0 +1,86 @@ +Move RPMCALLBACK_ELEM_PROGRESS to rpmteProcess to have header available + +The header of the rpmte is only available after rpmteOpen(). +Added num param to rpmteProcess to be able to signal the progress to the +callback. + +(cherry picked from commit 124ed29259b05fdf574d5e3e145bc1201b24ae4d) +--- +diff -uNr rpm-4.11.3.orig/lib/rpmte.c rpm-4.11.3/lib/rpmte.c +--- rpm-4.11.3.orig/lib/rpmte.c 2017-08-23 15:39:18.195927789 +0200 ++++ rpm-4.11.3/lib/rpmte.c 2017-08-23 15:40:12.857349575 +0200 +@@ -939,7 +939,7 @@ + return rc; + } + +-int rpmteProcess(rpmte te, pkgGoal goal) ++int rpmteProcess(rpmte te, pkgGoal goal, int num) + { + /* Only install/erase resets pkg file info */ + int scriptstage = (goal != PKG_INSTALL && goal != PKG_ERASE); +@@ -959,6 +959,11 @@ + } + + if (rpmteOpen(te, reset_fi)) { ++ if (!scriptstage) { ++ rpmtsNotify(te->ts, te, RPMCALLBACK_ELEM_PROGRESS, num, ++ rpmtsMembers(te->ts)->orderCount); ++ } ++ + failed = rpmpsmRun(te->ts, te, goal); + rpmteClose(te, reset_fi); + } +diff -uNr rpm-4.11.3.orig/lib/rpmte_internal.h rpm-4.11.3/lib/rpmte_internal.h +--- rpm-4.11.3.orig/lib/rpmte_internal.h 2013-11-22 11:31:31.000000000 +0100 ++++ rpm-4.11.3/lib/rpmte_internal.h 2017-08-23 15:40:24.654440605 +0200 +@@ -56,7 +56,7 @@ + FD_t rpmtePayload(rpmte te); + + RPM_GNUC_INTERNAL +-int rpmteProcess(rpmte te, pkgGoal goal); ++int rpmteProcess(rpmte te, pkgGoal goal, int num); + + RPM_GNUC_INTERNAL + void rpmteAddProblem(rpmte te, rpmProblemType type, +diff -uNr rpm-4.11.3.orig/lib/transaction.c rpm-4.11.3/lib/transaction.c +--- rpm-4.11.3.orig/lib/transaction.c 2017-08-23 15:39:18.257928268 +0200 ++++ rpm-4.11.3/lib/transaction.c 2017-08-23 15:42:24.986369126 +0200 +@@ -1170,10 +1170,11 @@ + static int runTransScripts(rpmts ts, pkgGoal goal) + { + int rc = 0; ++ int i = 0; + rpmte p; + rpmtsi pi = rpmtsiInit(ts); + while ((p = rpmtsiNext(pi, TR_ADDED)) != NULL) { +- rc += rpmteProcess(p, goal); ++ rc += rpmteProcess(p, goal, i++); + } + rpmtsiFree(pi); + return rc; +@@ -1415,7 +1416,6 @@ + static int rpmtsProcess(rpmts ts) + { + rpmtsi pi; rpmte p; +- tsMembers tsmem = rpmtsMembers(ts); + int rc = 0; + int i = 0; + +@@ -1423,8 +1423,6 @@ + while ((p = rpmtsiNext(pi, 0)) != NULL) { + int failed; + +- rpmtsNotify(ts, NULL, RPMCALLBACK_ELEM_PROGRESS, i++, +- tsmem->orderCount); + rpmlog(RPMLOG_DEBUG, "========== +++ %s %s-%s 0x%x\n", + rpmteNEVR(p), rpmteA(p), rpmteO(p), rpmteColor(p)); + +@@ -1432,7 +1430,7 @@ + rpmtsSELabelInit(ts, 0); + } + +- failed = rpmteProcess(p, rpmteType(p)); ++ failed = rpmteProcess(p, rpmteType(p), i++); + if (failed) { + rpmlog(RPMLOG_ERR, "%s: %s %s\n", rpmteNEVRA(p), + rpmteTypeString(p), failed > 1 ? _("skipped") : _("failed")); diff --git a/SOURCES/rpm-4.13.x-bad-owner-group.patch b/SOURCES/rpm-4.13.x-bad-owner-group.patch new file mode 100644 index 0000000..0a6785e --- /dev/null +++ b/SOURCES/rpm-4.13.x-bad-owner-group.patch @@ -0,0 +1,53 @@ +--- rpm-4.11.3/build/files.c.old 2019-01-02 13:14:10.217068479 +0100 ++++ rpm-4.11.3/build/files.c 2019-03-20 13:18:38.290142740 +0100 +@@ -2015,23 +2015,32 @@ + flp->fl_mode &= S_IFMT; + flp->fl_mode |= fl.def.ar.ar_fmode; + } ++ + if (fl.def.ar.ar_user) { + flp->uname = fl.def.ar.ar_user; + } else { + 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, "root", 1); ++ } ++ + if (fl.def.ar.ar_group) { + flp->gname = fl.def.ar.ar_group; + } else { + 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, "root", 1); + } + ++ flp->langs = xstrdup(""); + fl.files.used++; + } + argvFree(files); +--- rpm-4.11.3/build/parsePrep.c.old 2013-11-22 11:31:31.000000000 +0100 ++++ rpm-4.11.3/build/parsePrep.c 2019-03-20 13:19:33.705172465 +0100 +@@ -29,10 +29,6 @@ + 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; + } diff --git a/SOURCES/rpm-4.13.x-enable_noghost_option.patch b/SOURCES/rpm-4.13.x-enable_noghost_option.patch new file mode 100644 index 0000000..5d1821f --- /dev/null +++ b/SOURCES/rpm-4.13.x-enable_noghost_option.patch @@ -0,0 +1,46 @@ +--- rpm-4.11.3/doc/rpm.8.old 2018-05-25 09:24:59.329885663 +0200 ++++ rpm-4.11.3/doc/rpm.8 2018-05-25 09:25:19.598901802 +0200 +@@ -76,7 +76,7 @@ + [\fB--nodigest\fR] [\fB--nosignature\fR] + [\fB--nolinkto\fR] [\fB--nofiledigest\fR] [\fB--nosize\fR] [\fB--nouser\fR] + [\fB--nogroup\fR] [\fB--nomtime\fR] [\fB--nomode\fR] [\fB--nordev\fR] +- [\fB--nocaps\fR] [\fB--noconfig\fR] ++ [\fB--nocaps\fR] [\fB--noconfig\fR] [\fB--noghost\fR] + + .SS "install-options" + .PP +@@ -683,6 +683,9 @@ + \fB--noconfig\fR + Don't verify config files. + .TP ++\fB--noghost\fR ++Don't display ghost files. ++.TP + \fB--noscripts\fR + Don't execute the \fB%verifyscript\fR scriptlet (if any). + .TP +--- rpm-4.11.3/lib/poptQV.c.old 2018-05-10 12:29:26.716304826 +0200 ++++ rpm-4.11.3/lib/poptQV.c 2018-05-11 14:08:36.389255974 +0200 +@@ -182,7 +182,7 @@ + N_("list files in package"), NULL }, + + /* Duplicate file attr flags from packages into command line options. */ +- { "noghost", '\0', POPT_BIT_CLR|POPT_ARGFLAG_DOC_HIDDEN, ++ { "noghost", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &rpmQVKArgs.qva_fflags, RPMFILE_GHOST, + N_("skip %%ghost files"), NULL }, + { "noconfig", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, +--- rpm-4.11.3/lib/verify.c.old 2018-05-10 12:29:26.715304826 +0200 ++++ rpm-4.11.3/lib/verify.c 2018-05-11 14:17:16.474959233 +0200 +@@ -453,6 +453,11 @@ + rpmlog(RPMLOG_NOTICE, "%s\n", buf); + buf = _free(buf); + } ++ ++ /* Filter out missing %ghost/%missingok errors from final result */ ++ if (fileAttrs & (RPMFILE_MISSINGOK|RPMFILE_GHOST)) ++ verifyResult &= ~RPMVERIFY_LSTATFAIL; ++ + } + rpmfiFree(fi); + diff --git a/SOURCES/rpm-4.13.x-fix-segfault-on-fingerprint-symlink.patch b/SOURCES/rpm-4.13.x-fix-segfault-on-fingerprint-symlink.patch new file mode 100644 index 0000000..0b26687 --- /dev/null +++ b/SOURCES/rpm-4.13.x-fix-segfault-on-fingerprint-symlink.patch @@ -0,0 +1,21 @@ +--- rpm-4.11.3/lib/fprint.c.old 2014-02-05 14:04:01.000000000 +0100 ++++ rpm-4.11.3/lib/fprint.c 2019-08-21 16:28:03.255538275 +0200 +@@ -484,7 +484,7 @@ + (void) rpmdbCheckSignals(); + + if ((fi = rpmteFI(p)) == NULL) +- continue; /* XXX can't happen */ ++ continue; + + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); + rpmfiFpLookup(fi, fpc); +@@ -518,6 +518,9 @@ + while ((p = rpmtsiNext(pi, 0)) != NULL) { + (void) rpmdbCheckSignals(); + ++ if ((fi = rpmteFI(p)) == NULL) ++ continue; ++ + fs = rpmteGetFileStates(p); + fc = rpmfsFC(fs); + (void) rpmswEnter(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0); diff --git a/SOURCES/rpm-4.13.x-fix_find_debuginfo_opts_g.patch b/SOURCES/rpm-4.13.x-fix_find_debuginfo_opts_g.patch new file mode 100644 index 0000000..de72379 --- /dev/null +++ b/SOURCES/rpm-4.13.x-fix_find_debuginfo_opts_g.patch @@ -0,0 +1,28 @@ +--- rpm-4.11.3/scripts/find-debuginfo.sh.old 2018-05-03 09:53:34.098654333 +0200 ++++ rpm-4.11.3/scripts/find-debuginfo.sh 2018-05-03 13:35:32.092303548 +0200 +@@ -9,7 +9,7 @@ + # [[-l filelist]... [-p 'pattern'] -o debuginfo.list] + # [builddir] + # +-# The -g flag says to use strip -g instead of full strip on DSOs. ++# The -g flag says to use strip -g instead of full strip on DSOs or EXEs. + # The --strict-build-id flag says to exit with failure status if + # any ELF binary processed fails to contain a build-id note. + # The -r flag says to use eu-strip --reloc-debug-sections. +@@ -29,7 +29,7 @@ + # All file names in switches are relative to builddir (. if not given). + # + +-# With -g arg, pass it to strip on libraries. ++# With -g arg, pass it to strip on libraries or executables. + strip_g=false + + # with -r arg, pass --reloc-debug-sections to eu-strip. +@@ -130,6 +130,7 @@ + $strip_r && r=--reloc-debug-sections + $strip_g && case "$(file -bi "$2")" in + application/x-sharedlib*) g=-g ;; ++ application/x-executable*) g=-g ;; + esac + eu-strip --remove-comment $r $g -f "$1" "$2" || exit + chmod 444 "$1" || exit diff --git a/SOURCES/rpm-4.13.x-increase_header_size.patch b/SOURCES/rpm-4.13.x-increase_header_size.patch new file mode 100644 index 0000000..7a2496a --- /dev/null +++ b/SOURCES/rpm-4.13.x-increase_header_size.patch @@ -0,0 +1,59 @@ +From 89e6317c75b494905590903fadbfdc3c8d31e2b8 Mon Sep 17 00:00:00 2001 +From: Stefan Berger +Date: Fri, 29 Apr 2016 07:09:49 -0400 +Subject: [PATCH] Extend header size to 256MB due to file signatures + +Extend the header size to 256MB in case an RPM has a lot of files +and the file signatures do not fit within the current limit of 16MB. + +An example for an RPM with many files is kcbench-data-4.0. It contains +more than 52000 files. With each signature with a 2048 bit key requiring +256 bytes plus a preamble, its representation in text from, and other +overhead, the size of the header (index length and data length) exceeds +32Mb. + +If this particular RPM's files have been signed using this patch, older +versions of the rpm tool will report the header being too large. So this +failure is expected then. + +By setting the limit to 256MB we create a lot of room for the future. + +Signed-off-by: Stefan Berger +--- + lib/header.c | 2 +- + lib/header_internal.h | 5 +++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/header.c b/lib/header.c +index 81f2038..7f7c115 100644 +--- a/lib/header.c ++++ b/lib/header.c +@@ -99,7 +99,7 @@ struct headerToken_s { + /** \ingroup header + * Maximum no. of bytes permitted in a header. + */ +-static const size_t headerMaxbytes = (32*1024*1024); ++static const size_t headerMaxbytes = (256*1024*1024); + + #define INDEX_MALLOC_SIZE 8 + +diff --git a/lib/header_internal.h b/lib/header_internal.h +index bbe2097..aed3977 100644 +--- a/lib/header_internal.h ++++ b/lib/header_internal.h +@@ -45,9 +45,10 @@ struct indexEntry_s { + + /** + * Sanity check on data size and/or offset and/or count. +- * This check imposes a limit of 16 MB, more than enough. ++ * This check imposes a limit of 256 MB -- file signatures ++ * may require a lot of space in the header. + */ +-#define HEADER_DATA_MAX 0x00ffffff ++#define HEADER_DATA_MAX 0x0fffffff + #define hdrchkData(_nbytes) ((_nbytes) & (~HEADER_DATA_MAX)) + + /** +-- +2.9.5 + diff --git a/SOURCES/rpm-4.13.x-writable-tmp-dir.patch b/SOURCES/rpm-4.13.x-writable-tmp-dir.patch new file mode 100644 index 0000000..9a33adb --- /dev/null +++ b/SOURCES/rpm-4.13.x-writable-tmp-dir.patch @@ -0,0 +1,106 @@ +commit c707ab26362e795d3f9dba4eb87dc7ed99a28bcb +Author: Robin Lee +Date: Sat Apr 8 21:21:39 2017 +0800 + + Fix non-standard inherented modes of directories in debuginfo + + In case that binary compiled from source generated in /tmp, a + /usr/src/debug/tmp directory will be created with the same mode as + /tmp, a.k.a 777, which should be avoided. + + Fixes: rhbz#641022 + +diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh +old mode 100644 +new mode 100755 +index 547dbd9..6f38e19 +--- a/scripts/find-debuginfo.sh ++++ b/scripts/find-debuginfo.sh +@@ -396,9 +396,10 @@ + mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug" + LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(|)$' | + (cd "$RPM_BUILD_DIR"; cpio -pd0mL "${RPM_BUILD_ROOT}/usr/src/debug") +- # stupid cpio creates new directories in mode 0700, fixup ++ # stupid cpio creates new directories in mode 0700, ++ # and non-standard modes may be inherented from original directories, fixup + find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 | +- xargs --no-run-if-empty -0 chmod a+rx ++ xargs --no-run-if-empty -0 chmod 0755 + fi + + if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then + +commit e795899780337dea751d85db8f381eff3fe75275 +Author: Mark Wielaard +Date: Fri Apr 21 17:33:26 2017 +0200 + + debugedit: Only output comp_dir under build dir (once). + + The fix for rhbz#444310 (commit c1a5eb - Include empty CU current dirs) + was a little greedy. It would also include comp_dirs outside the build + root. Those are unnecessary and we don't have a good way to store them. + Such dirs (e.g. /tmp) would then show up at the root of /usr/src/debug. + + Fix this by including only comp_dirs under base_dir. Also only output + all dirs once (during phase zero) and don't output empty dirs (which + was harmless but would produce a warning from cpio). + + This still includes all empty dirs from the original rhbz#444310 + nodir testcase and it is an alternative fix for rhbz#641022 + (commit c707ab). + + Both fixes are necessary in case of an unexpected mode for a directory + actually in the build root that we want to include in the source list. + + Signed-off-by: Mark Wielaard + +diff --git a/tools/debugedit.c b/tools/debugedit.c +index 8444e03..bf11513 100644 +--- a/tools/debugedit.c ++++ b/tools/debugedit.c +@@ -926,27 +926,27 @@ + /* Ensure the CU current directory will exist even if only empty. Source + filenames possibly located in its parent directories refer relatively to + it and the debugger (GDB) cannot safely optimize out the missing +- CU current dir subdirectories. */ +- if (comp_dir && list_file_fd != -1) ++ CU current dir subdirectories. Only do this once in phase one. And ++ only do this for dirs under our build/base_dir. Don't output the ++ empty string (in case the comp_dir == base_dir). */ ++ if (phase == 0 && base_dir && comp_dir && list_file_fd != -1) + { +- char *p; +- size_t size; + +- if (base_dir && has_prefix (comp_dir, base_dir)) +- p = comp_dir + strlen (base_dir); +- else if (dest_dir && has_prefix (comp_dir, dest_dir)) +- p = comp_dir + strlen (dest_dir); +- else +- p = comp_dir; +- +- size = strlen (p) + 1; +- while (size > 0) ++ if (has_prefix (comp_dir, base_dir)) + { +- ssize_t ret = write (list_file_fd, p, size); +- if (ret == -1) +- break; +- size -= ret; +- p += ret; ++ char *p = comp_dir + strlen (base_dir); ++ if (p[0] != '\0') ++ { ++ size_t size = strlen (p) + 1; ++ while (size > 0) ++ { ++ ssize_t ret = write (list_file_fd, p, size); ++ if (ret == -1) ++ break; ++ size -= ret; ++ p += ret; ++ } ++ } + } + } + diff --git a/SOURCES/rpm-4.14.x-Add-justdb-to-the-erase-man.patch b/SOURCES/rpm-4.14.x-Add-justdb-to-the-erase-man.patch new file mode 100644 index 0000000..019e861 --- /dev/null +++ b/SOURCES/rpm-4.14.x-Add-justdb-to-the-erase-man.patch @@ -0,0 +1,44 @@ +From 7ebf34fc1b0b7b3fb149761fee01a92859b1a69e Mon Sep 17 00:00:00 2001 +From: Florian Festi +Date: Mon, 18 Apr 2016 15:59:18 +0200 +Subject: [PATCH] Add --justdb to the erase section of the man page, too + +--- + doc/rpm.8 | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/doc/rpm.8 b/doc/rpm.8 +index 2eb5ca5..ccd2e1e 100644 +--- a/doc/rpm.8 ++++ b/doc/rpm.8 +@@ -37,7 +37,7 @@ rpm \- RPM Package Manager + + + +-\fBrpm\fR {\fB-e|--erase\fR} [\fB--allmatches\fR] [\fB--nodeps\fR] [\fB--noscripts\fR] ++\fBrpm\fR {\fB-e|--erase\fR} [\fB--allmatches\fR] [\fB--justdb] [\fB--nodeps\fR] [\fB--noscripts\fR] + [\fB--notriggers\fR] [\fB--test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI\ ...\fR + + .SS "MISCELLANEOUS:" +@@ -377,7 +377,7 @@ potential conflicts. + The general form of an rpm erase command is + .PP + +-\fBrpm\fR {\fB-e|--erase\fR} [\fB--allmatches\fR] [\fB--nodeps\fR] [\fB--noscripts\fR] [\fB--notriggers\fR] [\fB--test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR ++\fBrpm\fR {\fB-e|--erase\fR} [\fB--allmatches\fR] [\fB--justdb] [\fB--nodeps\fR] [\fB--noscripts\fR] [\fB--notriggers\fR] [\fB--test\fR] \fB\fIPACKAGE_NAME\fB\fR\fI ...\fR + + .PP + The following options may also be used: +@@ -388,6 +388,9 @@ Remove all versions of the package which match + error is issued if \fIPACKAGE_NAME\fR + matches multiple packages. + .TP ++\fB--justdb\fR ++Update only the database, not the filesystem. ++.TP + \fB--nodeps\fR + Don't check dependencies before uninstalling the packages. + .TP +-- +2.5.5 + diff --git a/SOURCES/rpm-4.6.0-niagara.patch b/SOURCES/rpm-4.6.0-niagara.patch new file mode 100644 index 0000000..c465b65 --- /dev/null +++ b/SOURCES/rpm-4.6.0-niagara.patch @@ -0,0 +1,61 @@ +diff -up rpm-4.9.1.3/lib/rpmrc.c.niagara rpm-4.9.1.3/lib/rpmrc.c +--- rpm-4.9.1.3/lib/rpmrc.c.niagara 2012-04-19 17:06:23.130595223 +0200 ++++ rpm-4.9.1.3/lib/rpmrc.c 2012-04-19 17:06:23.134739249 +0200 +@@ -718,6 +718,31 @@ exit: + return rc; + } + ++#if defined(__linux__) && defined(__sparc__) ++static int is_sun4v() ++{ ++ char buffer[4096], *p; ++ int fd = open("/proc/cpuinfo", O_RDONLY); ++ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) { ++ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n")); ++ close(fd); ++ return 0; ++ } ++ close(fd); ++ ++ p = strstr(buffer, "type"); ++ p = strtok(p, "\n"); ++ p = strstr(p, "sun"); ++ if (p == NULL) { ++ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'type' line\n")); ++ return 0; ++ } else if (strcmp(p, "sun4v") == 0) { ++ return 1; ++ } ++ return 0; ++} ++#endif ++ + + # if defined(__linux__) && defined(__i386__) + #include +@@ -1178,6 +1203,13 @@ static void defaultMachine(const char ** + personality(oldpers); + } + } ++ if (is_sun4v()){ ++ if (strcmp(un.machine, "sparcv9") == 0 || strcmp(un.machine, "sparc") == 0 ) { ++ strcpy(un.machine, "sparcv9v"); ++ } else if (strcmp(un.machine, "sparc64") == 0 ) { ++ strcpy(un.machine, "sparc64v"); ++ } ++ } + # endif /* sparc*-linux */ + + # if defined(__linux__) && defined(__powerpc__) +diff -up rpm-4.9.1.3/rpmrc.in.niagara rpm-4.9.1.3/rpmrc.in +--- rpm-4.9.1.3/rpmrc.in.niagara 2012-04-19 17:06:23.131476769 +0200 ++++ rpm-4.9.1.3/rpmrc.in 2012-04-19 17:06:23.135738996 +0200 +@@ -316,7 +316,7 @@ arch_compat: sun4c: sparc + arch_compat: sun4d: sparc + arch_compat: sun4m: sparc + arch_compat: sun4u: sparc64 +-arch_compat: sparc64v: sparc64 ++arch_compat: sparc64v: sparc64 sparcv9v + arch_compat: sparc64: sparcv9 + arch_compat: sparcv9v: sparcv9 + arch_compat: sparcv9: sparcv8 diff --git a/SOURCES/rpm-4.7.1-geode-i686.patch b/SOURCES/rpm-4.7.1-geode-i686.patch new file mode 100644 index 0000000..2e8692a --- /dev/null +++ b/SOURCES/rpm-4.7.1-geode-i686.patch @@ -0,0 +1,14 @@ +diff --git a/rpmrc.in b/rpmrc.in +index 4a6cca9..d62ddaf 100644 +--- a/rpmrc.in ++++ b/rpmrc.in +@@ -281,7 +281,7 @@ arch_compat: alphaev5: alpha + arch_compat: alpha: axp noarch + + arch_compat: athlon: i686 +-arch_compat: geode: i586 ++arch_compat: geode: i686 + arch_compat: pentium4: pentium3 + arch_compat: pentium3: i686 + arch_compat: i686: i586 + diff --git a/SOURCES/rpm-4.8.0-ignore-multiline2.patch b/SOURCES/rpm-4.8.0-ignore-multiline2.patch new file mode 100644 index 0000000..6992f17 --- /dev/null +++ b/SOURCES/rpm-4.8.0-ignore-multiline2.patch @@ -0,0 +1,39 @@ +From 4c621e97776a47c2b4e7f17c1cd2a7961453babf Mon Sep 17 00:00:00 2001 +From: Lubos Kardos +Date: Wed, 3 Dec 2014 14:01:14 +0100 +Subject: [PATCH] Ignore "use" or "requires" within multi-line print or assign + statement + +- Now script perl.req ignores "use" and "requires" on lines that are + part of printing or assigning multi-line string i. e. string that + hasn't starting and ending quote on the same line. + (RhBug:1024517) +--- + scripts/perl.req | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- rpm-4.8.0/scripts/perl.req.ignore-multiline2 ++++ rpm-4.8.0/scripts/perl.req +@@ -174,6 +174,19 @@ sub process_file { + $_ = ; + } + ++ # Skip multiline print and assign statements ++ if ( m/\$\S+\s*=\s*(")([^"\\]|(\\.))*$/ || ++ m/\$\S+\s*=\s*(')([^'\\]|(\\.))*$/ || ++ m/print\s+(")([^"\\]|(\\.))*$/ || ++ m/print\s+(')([^'\\]|(\\.))*$/ ) { ++ ++ my $quote = $1; ++ while () { ++ m/^([^\\$quote]|(\\.))*$quote/ && last; ++ } ++ $_ = ; ++ } ++ + if ( + + # ouch could be in a eval, perhaps we do not want these since we catch +-- +1.9.3 + diff --git a/SOURCES/rpm-4.8.1-use-gpg2.patch b/SOURCES/rpm-4.8.1-use-gpg2.patch new file mode 100644 index 0000000..f1dbb56 --- /dev/null +++ b/SOURCES/rpm-4.8.1-use-gpg2.patch @@ -0,0 +1,12 @@ +diff -up rpm-4.8.1/macros.in.gpg2 rpm-4.8.1/macros.in +--- rpm-4.8.0/macros.in.gpg2 2011-01-17 12:17:38.000000000 +0200 ++++ rpm-4.8.0/macros.in 2011-01-17 12:17:59.000000000 +0200 +@@ -40,7 +40,7 @@ + %__cp @__CP@ + %__cpio @__CPIO@ + %__file @__FILE@ +-%__gpg @__GPG@ ++%__gpg %{_bindir}/gpg2 + %__grep @__GREP@ + %__gzip @__GZIP@ + %__id @__ID@ diff --git a/SOURCES/rpm-4.8.x-error-in-log.patch b/SOURCES/rpm-4.8.x-error-in-log.patch new file mode 100644 index 0000000..d22abe8 --- /dev/null +++ b/SOURCES/rpm-4.8.x-error-in-log.patch @@ -0,0 +1,20 @@ +--- rpm-4.8.0/rpmio/rpmlog.c.error-in-log 2015-02-23 13:18:29.696116399 +0100 ++++ rpm-4.8.0/rpmio/rpmlog.c 2015-02-23 13:28:19.630394971 +0100 +@@ -127,10 +127,14 @@ + break; + } + +- (void) fputs(rpmlogLevelPrefix(rec->pri), msgout); ++ if (fputs(rpmlogLevelPrefix(rec->pri), msgout) == EOF) ++ perror("Error occurred during writing of a log message"); + +- (void) fputs(rec->message, msgout); +- (void) fflush(msgout); ++ if (fputs(rec->message, msgout) == EOF) ++ perror("Error occurred during writing of a log message"); ++ ++ if (fflush(msgout) == EOF) ++ perror("Error occurred during writing of a log message"); + + return (rec->pri <= RPMLOG_CRIT ? RPMLOG_EXIT : 0); + } diff --git a/SOURCES/rpm-4.9.0-armhfp-logic.patch b/SOURCES/rpm-4.9.0-armhfp-logic.patch new file mode 100644 index 0000000..916b53f --- /dev/null +++ b/SOURCES/rpm-4.9.0-armhfp-logic.patch @@ -0,0 +1,83 @@ +diff -up rpm-4.11.1/lib/rpmrc.c.armhfp-logic rpm-4.11.1/lib/rpmrc.c +--- rpm-4.11.1/lib/rpmrc.c.armhfp-logic 2013-10-01 14:59:12.841041726 +0300 ++++ rpm-4.11.1/lib/rpmrc.c 2013-10-01 14:59:12.856041684 +0300 +@@ -733,6 +733,56 @@ static int is_sun4v() + } + #endif + ++#if defined(__linux__) && defined(__arm__) ++static int has_neon() ++{ ++ char buffer[4096], *p; ++ int fd = open("/proc/cpuinfo", O_RDONLY); ++ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) { ++ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n")); ++ close(fd); ++ return 0; ++ } ++ close(fd); ++ ++ p = strstr(buffer, "Features"); ++ p = strtok(p, "\n"); ++ p = strstr(p, "neon"); ++ p = strtok(p, " "); ++ if (p == NULL) { ++ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n")); ++ return 0; ++ } else if (strcmp(p, "neon") == 0) { ++ return 1; ++ } ++ return 0; ++} ++ ++static int has_hfp() ++{ ++ char buffer[4096], *p; ++ int fd = open("/proc/cpuinfo", O_RDONLY); ++ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) { ++ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n")); ++ close(fd); ++ return 0; ++ } ++ close(fd); ++ ++ p = strstr(buffer, "Features"); ++ p = strtok(p, "\n"); ++ p = strstr(p, "vfpv3"); ++ p = strtok(p, " "); ++ if (p == NULL) { ++ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n")); ++ return 0; ++ } else if (strcmp(p, "vfpv3") == 0) { ++ return 1; ++ } ++ return 0; ++} ++#endif ++ + + # if defined(__linux__) && defined(__i386__) + #include +@@ -1136,6 +1186,22 @@ static void defaultMachine(const char ** + # endif /* __ORDER_BIG_ENDIAN__ */ + # endif /* ppc64*-linux */ + ++# if defined(__linux__) && defined(__arm__) ++ { ++ if (strcmp(un.machine, "armv7l") == 0 ) { ++ if (has_neon() && has_hfp()) ++ strcpy(un.machine, "armv7hnl"); ++ else if (has_hfp()) ++ strcpy(un.machine, "armv7hl"); ++ } else if (strcmp(un.machine, "armv6l") == 0 ) { ++ if (has_neon() && has_hfp()) ++ strcpy(un.machine, "armv6hnl"); ++ else if (has_hfp()) ++ strcpy(un.machine, "armv6hl"); ++ } ++ } ++# endif /* arm*-linux */ ++ + # if defined(__GNUC__) && defined(__alpha__) + { + unsigned long amask, implver; diff --git a/SOURCES/rpm-4.9.1.1-ld-flags.patch b/SOURCES/rpm-4.9.1.1-ld-flags.patch new file mode 100644 index 0000000..f8b2524 --- /dev/null +++ b/SOURCES/rpm-4.9.1.1-ld-flags.patch @@ -0,0 +1,15 @@ +diff -up rpm-4.9.1.1/macros.in.jx rpm-4.9.1.1/macros.in +--- rpm-4.9.1.1/macros.in.jx 2011-08-03 16:19:05.000000000 -0400 ++++ rpm-4.9.1.1/macros.in 2011-08-08 09:41:52.981064316 -0400 +@@ -674,9 +674,10 @@ print (t)\ + RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\ + RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\ + RPM_OPT_FLAGS=\"%{optflags}\"\ ++ RPM_LD_FLAGS=\"%{?__global_ldflags}\"\ + RPM_ARCH=\"%{_arch}\"\ + RPM_OS=\"%{_os}\"\ +- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS\ ++ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_LD_FLAGS RPM_ARCH RPM_OS\ + RPM_DOC_DIR=\"%{_docdir}\"\ + export RPM_DOC_DIR\ + RPM_PACKAGE_NAME=\"%{name}\"\ diff --git a/SOURCES/rpm-4.9.90-armhfp.patch b/SOURCES/rpm-4.9.90-armhfp.patch new file mode 100644 index 0000000..6337d9f --- /dev/null +++ b/SOURCES/rpm-4.9.90-armhfp.patch @@ -0,0 +1,67 @@ +diff -uNr rpm-4.9.0-orig//macros.in rpm-4.9.0/macros.in +--- rpm-4.9.0-orig//macros.in 2011-08-05 12:23:04.000000000 -0500 ++++ rpm-4.9.0/macros.in 2011-08-05 12:25:13.000000000 -0500 +@@ -1032,7 +1032,7 @@ + + #------------------------------------------------------------------------------ + # arch macro for all supported ARM processors +-%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l ++%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l armv7hl armv7hnl + + #------------------------------------------------------------------------------ + # arch macro for all supported Sparc processors +diff -uNr rpm-4.9.0-orig//rpmrc.in rpm-4.9.0/rpmrc.in +--- rpm-4.9.0-orig//rpmrc.in 2011-08-05 12:23:04.000000000 -0500 ++++ rpm-4.9.0/rpmrc.in 2011-08-05 12:26:34.000000000 -0500 +@@ -66,8 +66,10 @@ + optflags: armv5tejl -O2 -g -march=armv5te + optflags: armv6l -O2 -g -march=armv6 + optflags: armv7l -O2 -g -march=armv7 ++optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 ++optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon + + optflags: m68k -O2 -g -fomit-frame-pointer + + optflags: atarist -O2 -g -fomit-frame-pointer + optflags: atariste -O2 -g -fomit-frame-pointer +@@ -140,6 +142,8 @@ + arch_canon: armv5tejl: armv5tejl 12 + arch_canon: armv6l: armv6l 12 + arch_canon: armv7l: armv7l 12 ++arch_canon: armv7hl: armv7hl 12 ++arch_canon: armv7hnl: armv7hnl 12 + + arch_canon: m68kmint: m68kmint 13 + arch_canon: atarist: m68kmint 13 +@@ -248,8 +252,10 @@ + buildarchtranslate: armv5tejl: armv5tejl + buildarchtranslate: armv6l: armv6l + buildarchtranslate: armv7l: armv7l ++buildarchtranslate: armv7hl: armv7hl ++buildarchtranslate: armv7hnl: armv7hnl + + buildarchtranslate: m68k: m68k + + buildarchtranslate: atarist: m68kmint + buildarchtranslate: atariste: m68kmint +@@ -336,8 +342,10 @@ + arch_compat: armv4tl: armv4l + arch_compat: armv4l: armv3l + arch_compat: armv3l: noarch ++arch_compat: armv7hnl: armv7hl ++arch_compat: armv7hl: noarch + + arch_compat: m68k: noarch + + arch_compat: atarist: m68kmint noarch + arch_compat: atariste: m68kmint noarch +@@ -441,6 +449,9 @@ + buildarch_compat: armv4l: armv3l + buildarch_compat: armv3l: noarch + ++buildarch_compat: armv7hnl: armv7hl ++buildarch_compat: armv7hl: noarch ++ + buildarch_compat: hppa2.0: hppa1.2 + buildarch_compat: hppa1.2: hppa1.1 + buildarch_compat: hppa1.1: hppa1.0 diff --git a/SOURCES/rpm-4.9.90-fedora-specspo.patch b/SOURCES/rpm-4.9.90-fedora-specspo.patch new file mode 100644 index 0000000..61394cf --- /dev/null +++ b/SOURCES/rpm-4.9.90-fedora-specspo.patch @@ -0,0 +1,78 @@ +diff --git a/lib/tagexts.c b/lib/tagexts.c +index dc0e0fb..e0a5d1f 100644 +--- a/lib/tagexts.c ++++ b/lib/tagexts.c +@@ -478,59 +478,29 @@ static const char * const _macro_i18ndomains = "%{?_i18ndomains}"; + */ + static int i18nTag(Header h, rpmTag tag, rpmtd td, headerGetFlags hgflags) + { +- int rc; ++ int rc = headerGet(h, tag, td, HEADERGET_ALLOC); + #if defined(ENABLE_NLS) +- char * dstring = rpmExpand(_macro_i18ndomains, NULL); +- +- td->type = RPM_STRING_TYPE; +- td->data = NULL; +- td->count = 0; +- +- if (dstring && *dstring) { +- char *domain, *de; +- const char * langval; +- char * msgkey; +- const char * msgid; +- +- rasprintf(&msgkey, "%s(%s)", headerGetString(h, RPMTAG_NAME), +- rpmTagGetName(tag)); +- +- /* change to en_US for msgkey -> msgid resolution */ +- langval = getenv(language); +- (void) setenv(language, "en_US", 1); +- ++_nl_msg_cat_cntr; ++ if (rc) { ++ char *de, *dstring = rpmExpand(_macro_i18ndomains, NULL); ++ const char *domain; + +- msgid = NULL; + for (domain = dstring; domain != NULL; domain = de) { ++ const char *msgid = td->data; ++ const char *msg = NULL; ++ + de = strchr(domain, ':'); + if (de) *de++ = '\0'; +- msgid = dgettext(domain, msgkey); +- if (msgid != msgkey) break; +- } +- +- /* restore previous environment for msgid -> msgstr resolution */ +- if (langval) +- (void) setenv(language, langval, 1); +- else +- unsetenv(language); +- ++_nl_msg_cat_cntr; +- +- if (domain && msgid) { +- td->data = dgettext(domain, msgid); +- td->data = xstrdup(td->data); /* XXX xstrdup has side effects. */ +- td->count = 1; +- td->flags = RPMTD_ALLOCED; ++ msg = dgettext(domain, td->data); ++ if (msg != msgid) { ++ free(td->data); ++ td->data = xstrdup(msg); ++ break; ++ } + } +- dstring = _free(dstring); +- free(msgkey); +- if (td->data) +- return 1; ++ free(dstring); + } +- +- free(dstring); + #endif + +- rc = headerGet(h, tag, td, HEADERGET_ALLOC); + return rc; + } + diff --git a/SOURCES/rpm-4.9.90-no-man-dirs.patch b/SOURCES/rpm-4.9.90-no-man-dirs.patch new file mode 100644 index 0000000..04f276a --- /dev/null +++ b/SOURCES/rpm-4.9.90-no-man-dirs.patch @@ -0,0 +1,12 @@ +diff -up rpm-4.9.90.git11486/scripts/find-lang.sh.no-man-dirs rpm-4.9.90.git11486/scripts/find-lang.sh +--- rpm-4.9.90.git11486/scripts/find-lang.sh.no-man-dirs 2012-03-07 11:31:10.000000000 +0200 ++++ rpm-4.9.90.git11486/scripts/find-lang.sh 2012-03-07 15:11:57.465801075 +0200 +@@ -181,7 +181,7 @@ s:%lang(C) :: + find "$TOP_DIR" -type d|sed ' + s:'"$TOP_DIR"':: + '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\):: +-'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*: ++'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1/*: + s:^\([^%].*\):: + s:%lang(C) :: + /^$/d' >> $MO_NAME diff --git a/SPECS/rpm.spec b/SPECS/rpm.spec new file mode 100644 index 0000000..3018662 --- /dev/null +++ b/SPECS/rpm.spec @@ -0,0 +1,1644 @@ +# build against xz? +%bcond_without xz +# just for giggles, option to build with internal Berkeley DB +%bcond_with int_bdb +# run internal testsuite? +%bcond_with check +# disable plugins initially +%bcond_without plugins + +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} + +%define rpmhome /usr/lib/rpm + +%define rpmver 4.11.3 +%define srcver %{rpmver}%{?snapver:-%{snapver}} + +%define bdbname libdb +%define bdbver 5.3.15 +%define dbprefix db + +Summary: The RPM package management system +Name: rpm +Version: %{rpmver} +Release: %{?snapver:0.%{snapver}.}43%{?dist} +Group: System Environment/Base +Url: http://www.rpm.org/ +Source0: http://rpm.org/releases/rpm-4.11.x/%{name}-%{srcver}.tar.bz2 +%if %{with int_bdb} +Source1: db-%{bdbver}.tar.gz +%else +BuildRequires: libdb-devel +%endif +Source10: libsymlink.attr +Source11: rpm + +# Fedora specspo is setup differently than what rpm expects, considering +# this as Fedora-specific patch for now +Patch2: rpm-4.9.90-fedora-specspo.patch +# In current Fedora, man-pages pkg owns all the localized man directories +Patch3: rpm-4.9.90-no-man-dirs.patch +# gnupg2 comes installed by default, avoid need to drag in gnupg too +Patch4: rpm-4.8.1-use-gpg2.patch +Patch5: rpm-4.9.90-armhfp.patch +#conditionally applied patch for arm hardware floating point +Patch6: rpm-4.9.0-armhfp-logic.patch + +# Patches already in upstream +Patch108: rpm-4.11.1-libtool-ppc64le.patch + +# Patches already in upstream but not in 4.11.x branch +Patch150: rpm-4.11.x-dirlink-verify.patch +Patch151: rpm-4.11.x-defattr-permissions.patch +Patch152: rpm-4.8.x-error-in-log.patch +Patch153: rpm-4.11.x-setperms-setugids-mutual-exclusion.patch +Patch154: rpm-4.8.0-ignore-multiline2.patch +Patch155: rpm-4.11.x-deprecate-addsign.patch +Patch156: rpm-4.11.x-Add-make_build-macro.patch +Patch157: rpm-4.11.x-color-skipping.patch +Patch158: rpm-4.11.x-fix-stripping-of-binaries.patch +Patch159: rpm-4.11.x-fix-debuginfo-creation.patch +Patch160: rpm-4.11.x-systemd-inhibit.patch +Patch161: rpm-4.11.x-parametrized-macro-invocations.patch +Patch162: rpm-4.11.x-broken-pipe.patch +# Belongs to Patch 161 +Patch163: rpm-4.11.x-Handle-line-continuation.patch +# Belongs to Patch 160 +Patch164: rpm-4.11.3-Initialize-plugins-based-on-DSO-discovery.patch +Patch166: rpm-4.11.x-move-rename.patch +Patch167: rpm-4.11.x-bdb-warings.patch +Patch168: rpm-4.14.x-Add-justdb-to-the-erase-man.patch +Patch169: rpm-4.11.x-multitheaded_xz.patch +Patch170: rpm-4.11.x-perl.req-1.patch +Patch171: rpm-4.11.x-perl.req-2.patch +Patch172: rpm-4.11.x-perl.req-3.patch +Patch173: rpm-4.11.x-perl.req-4.patch +Patch174: rpm-4.11.x-define-PY_SSIZE_T_CLEAN.patch +Patch175: rpm-4.11.x-python-binding-test-case.patch +Patch176: rpm-4.11.x-Add-noplugins.patch +Patch177: rpm-4.11.x-no-longer-config.patch +Patch178: rpm-4.11.x-Fix-off-by-one-base64.patch +Patch179: rpm-4.11.x-sources-to-lua-variables.patch +Patch180: rpm-4.11.x-Fix-Python-hdr-refcount.patch +Patch181: rpm-4.11.x-perl.req-skip-my-var-block.patch +Patch182: rpm-4.11.x-verify-data-range.patch +Patch183: rpm-4.13.x-writable-tmp-dir.patch +Patch184: rpm-4.13.x-increase_header_size.patch +Patch185: rpm-4.13.x-Make-the-stftime-buffer-big-enuff.patch +Patch186: rpm-4.11.x-skipattr.patch +Patch187: rpm-4.13.x-Implement-noconfig-query.patch +Patch188: rpm-4.11.x-weakdep-tags.patch +Patch189: rpm-4.12.x-rpmSign-return-value-correction.patch +Patch190: rpm-4.13.x-fix_find_debuginfo_opts_g.patch +Patch191: rpm-4.13.x-enable_noghost_option.patch +Patch192: rpm-4.11.x-provide-audit-events.patch +Patch193: rpm-4.11.x-setcaps.patch +Patch194: rpm-4.11.x-disk-space-calculation.patch +Patch195: rpm-4.11.x-remove-perl-provides-from-requires.patch +Patch196: rpm-4.13.x-bad-owner-group.patch +Patch197: rpm-4.11.x-perl.req-6.patch +Patch198: rpm-4.13.x-fix-segfault-on-fingerprint-symlink.patch +Patch199: rpm-4.11.x-dependson.patch + +# Filter soname dependencies by name +Patch200: rpm-4.11.x-filter-soname-deps.patch +Patch201: rpm-4.11.x-do-not-filter-ld64.patch + +# These are not yet upstream +Patch301: rpm-4.6.0-niagara.patch +Patch302: rpm-4.7.1-geode-i686.patch +# Probably to be upstreamed in slightly different form +Patch304: rpm-4.9.1.1-ld-flags.patch +# Compressed debuginfo support (#833311) +Patch305: rpm-4.10.0-dwz-debuginfo.patch +# Minidebuginfo support (#834073) +Patch306: rpm-4.10.0-minidebuginfo.patch +# Fix CRC32 after dwz (#971119) +Patch307: rpm-4.11.1-sepdebugcrcfix.patch +# Fix minidebuginfo on ppc64 (#1052415) +Patch308: rpm-4.11.x-minidebuginfo-ppc64.patch +# Chmod 000 for files being unpacked +Patch309: rpm-4.11.x-chmod.patch +Patch310: rpm-4.11.x-CVE-2014-8118.patch +Patch311: rpm-4.11.3-update-config.guess.patch +Patch312: rpm-4.11.x-man-systemd-inhibit.patch +Patch313: rpm-4.11.x-quiet-signing.patch +Patch314: rpm-4.11.x-export-verifysigs-to-python.patch + + +# Temporary Patch to provide support for updates +Patch400: rpm-4.10.90-rpmlib-filesystem-check.patch +# Disable plugins +Patch401: rpm-4.11.3-disable-collection-plugins.patch +# Remove EVR check +Patch402: rpm-4.11.3-EVR-validity-check.patch + +# Backport of RPMCALLBACK_ELEM_PROGRESS +# https://bugzilla.redhat.com/show_bug.cgi?id=1466649 +Patch501: rpm-4.11.x-elem-progress.patch +# Make header to be available for RPMCALLBACK_ELEM_PROGRESS +Patch502: rpm-4.13.x-RPMCALLBACK_ELEM_PROGRESS-available-header.patch +# Backport of reinstall functionality from 4.12 +# https://bugzilla.redhat.com/show_bug.cgi?id=1466650 +Patch503: rpm-4.11.x-reinstall.patch +Patch504: rpm-4.11.x-add-g-libs.patch + +# Fix brp-python-bytecompile script to work with Python 3 packages +# https://bugzilla.redhat.com/show_bug.cgi?id=1691402 +# Fixed upstream: +# https://github.com/rpm-software-management/rpm/commit/a8e51b3bb05c6acb1d9b2e3d34f859ddda1677be +Patch505: rpm-4.11.3-brp-python-bytecompile-Fix-when-default-python-is-no.patch +Patch506: rpm-4.11.x-correct-g-libs.patch + +# Partially GPL/LGPL dual-licensed and some bits with BSD +# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD +License: GPLv2+ + +Requires: coreutils +%if %{without int_bdb} +# db recovery tools, rpmdb_util symlinks +Requires: %{_bindir}/%{dbprefix}_stat +%endif +Requires: popt%{_isa} >= 1.10.2.1 +Requires: curl + +%if %{without int_bdb} +BuildRequires: %{bdbname}-devel +%endif + +%if %{with check} +BuildRequires: fakechroot +%endif + +# XXX generally assumed to be installed but make it explicit as rpm +# is a bit special... +BuildRequires: redhat-rpm-config +BuildRequires: gawk +BuildRequires: elfutils-devel >= 0.112 +BuildRequires: elfutils-libelf-devel +BuildRequires: readline-devel zlib-devel +BuildRequires: nss-devel +BuildRequires: nss-softokn-freebl-devel +# The popt version here just documents an older known-good version +BuildRequires: popt-devel >= 1.10.2 +BuildRequires: file-devel +BuildRequires: gettext-devel +BuildRequires: libselinux-devel +# XXX semanage is only used by sepolicy plugin but configure requires it... +BuildRequires: libsemanage-devel +BuildRequires: ncurses-devel +BuildRequires: bzip2-devel >= 0.9.0c-2 +BuildRequires: python-devel >= 2.6 +BuildRequires: lua-devel >= 5.1 +BuildRequires: libcap-devel +BuildRequires: libacl-devel +%if ! %{without xz} +BuildRequires: xz-devel >= 4.999.8 +%endif +%if %{with plugins} +# Required for systemd-inhibit plugin +BuildRequires: dbus-devel +%endif +BuildRequires: audit-libs-devel + +# Only required by sepdebugcrcfix patch +BuildRequires: binutils-devel +# Also required as sepdebugcrcfix messes with all the make files +BuildRequires: automake + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +The RPM Package Manager (RPM) is a powerful command line driven +package management system capable of installing, uninstalling, +verifying, querying, and updating software packages. Each software +package consists of an archive of files along with information about +the package like its version, a description, etc. + +%package libs +Summary: Libraries for manipulating RPM packages +Group: Development/Libraries +License: GPLv2+ and LGPLv2+ with exceptions +Requires: rpm = %{version}-%{release} +# librpm uses cap_compare, introduced sometimes between libcap 2.10 and 2.16. +# A manual require is needed, see #505596 +Requires: libcap%{_isa} >= 2.16 + +%description libs +This package contains the RPM shared libraries. + +%package build-libs +Summary: Libraries for building and signing RPM packages +Group: Development/Libraries +License: GPLv2+ and LGPLv2+ with exceptions +Requires: rpm-libs%{_isa} = %{version}-%{release} +Requires: %{_bindir}/gpg2 + +%description build-libs +This package contains the RPM shared libraries for building and signing +packages. + +%package devel +Summary: Development files for manipulating RPM packages +Group: Development/Libraries +License: GPLv2+ and LGPLv2+ with exceptions +Requires: rpm = %{version}-%{release} +Requires: rpm-libs%{_isa} = %{version}-%{release} +Requires: rpm-build-libs%{_isa} = %{version}-%{release} +Requires: popt-devel%{_isa} + +%description devel +This package contains the RPM C library and header files. These +development files will simplify the process of writing programs that +manipulate RPM packages and databases. These files are intended to +simplify the process of creating graphical package managers or any +other tools that need an intimate knowledge of RPM packages in order +to function. + +This package should be installed if you want to develop programs that +will manipulate RPM packages and databases. + +%package build +Summary: Scripts and executable programs used to build packages +Group: Development/Tools +Requires: rpm = %{version}-%{release} +Requires: elfutils >= 0.128 binutils +Requires: findutils sed grep gawk diffutils file patch >= 2.5 +Requires: unzip gzip bzip2 cpio xz tar +Requires: pkgconfig >= 1:0.24 +Requires: /usr/bin/gdb-add-index +# Technically rpmbuild doesn't require any external configuration, but +# creating distro-compatible packages does. To make the common case +# "just work" while allowing for alternatives, depend on a virtual +# provide, typically coming from redhat-rpm-config. +Requires: system-rpm-config +Conflicts: ocaml-runtime < 3.11.1-7 + +%description build +The rpm-build package contains the scripts and executable programs +that are used to build packages using the RPM Package Manager. + +%package sign +Summary: Package signing support +Group: System Environment/Base +Requires: rpm-build-libs%{_isa} = %{version}-%{release} + +%description sign +This package contains support for digitally signing RPM packages. + +%package python +Summary: Python bindings for apps which will manipulate RPM packages +Group: Development/Libraries +Requires: rpm = %{version}-%{release} + +%description python +The rpm-python package contains a module that permits applications +written in the Python programming language to use the interface +supplied by RPM Package Manager libraries. + +This package should be installed if you want to develop Python +programs that will manipulate RPM packages and databases. + +%package apidocs +Summary: API documentation for RPM libraries +Group: Documentation +BuildArch: noarch + +%description apidocs +This package contains API documentation for developing applications +that will manipulate RPM packages and databases. + +%package cron +Summary: Create daily logs of installed packages. +Group: System Environment/Base +BuildArch: noarch +Requires: crontabs logrotate rpm = %{version}-%{release} + +%description cron +This package contains a cron job which creates daily logs of installed +packages on a system. + +%if %{with plugins} +%package plugin-systemd-inhibit +Summary: Rpm plugin for systemd inhibit functionality +Group: System Environment/Base +Requires: rpm-libs%{_isa} = %{version}-%{release} + +%description plugin-systemd-inhibit +%{summary} +%endif + + +%prep +%setup -q -n %{name}-%{srcver} %{?with_int_bdb:-a 1} +%patch2 -p1 -b .fedora-specspo +%patch3 -p1 -b .no-man-dirs +%patch4 -p1 -b .use-gpg2 + +%ifarch ppc64le +%patch108 -p2 -b .ppc64le +%endif + +%patch150 -p1 -b .dirlink-verify +%patch151 -p1 -b .defattr-permissions +%patch152 -p1 -b .error-in-log +%patch153 -p1 -b .setperms-setugids +%patch154 -p1 -b .ignore-multiline2 +%patch155 -p1 -b .deprecate-addsign +%patch156 -p1 -b .make-build +%patch157 -p1 -b .skip-color +%patch158 -p1 -b .strip-binaries +%patch159 -p1 -b .debuginfo +%patch160 -p1 -b .systemd-inihibit +%patch161 -p1 -b .macro-expansion +%patch162 -p1 -b .broken-pipe +%patch163 -p1 -b .line-continuation +%patch164 -p1 -b .plugin-detection +%patch166 -p1 -b .move-rename +%patch167 -p1 -b .bdb-warnings +%patch168 -p1 -b .justdb-man +%patch169 -p1 -b .mt_xz +%patch170 -p1 -b .perl.req1 +%patch171 -p1 -b .perl.req2 +%patch172 -p1 -b .perl.req3 +%patch173 -p1 -b .perl.req4 +%patch174 -p1 -b .py_size +%patch175 -p1 -b .py_size_test +%patch176 -p1 -b .noplugins +%patch177 -p1 -b .noconfig +%patch178 -p1 -b .offbyone +%patch179 -p1 -b .sourceslua +%patch180 -p1 -b .hdrrefcnt +%patch181 -p1 -b .perlblock +%patch182 -p1 -b .verifysignature +%patch183 -p1 -b .writable_tmp +%patch184 -p1 -b .hdr_size +%patch185 -p1 -b .strtime +%patch186 -p1 -b .skipattr +%patch187 -p1 -b .noconfig-cli +%patch188 -p1 -b .weakdep-tags +%patch189 -p1 -b .rpmsign-error +%patch190 -p1 -b .find_debuginfo_opts +%patch191 -p1 -b .noghost +%patch192 -p1 -b .audit-events +%patch193 -p1 -b .setcaps +%patch194 -p1 -b .diskspace +%patch195 -p1 -b .perl.req5 +%patch196 -p1 -b .badowner +%patch197 -p1 -b .perl.req6 +%patch198 -p1 -b .sf_fingerprint +%patch199 -p1 -b .dependson + +%patch200 -p1 -b .filter-soname-deps +%patch201 -p1 -b .dont-filter-ld64 + +%patch301 -p1 -b .niagara +%patch302 -p1 -b .geode +%patch304 -p1 -b .ldflags +%patch305 -p1 -b .dwz-debuginfo +%patch306 -p1 -b .minidebuginfo +%patch307 -p1 -b .sepdebugcrcfix +%patch308 -p1 -b .minidebuginfo-ppc64 +%patch309 -p1 -b .chmod +%patch310 -p1 -b .namesize +%patch311 -p1 -b .config.guess +%patch312 -p1 -b .man-inhibit +%patch313 -p1 -b .quiet-sign +%patch314 -p1 -b .verifysig + +%patch400 -p1 -b .rpmlib-filesystem-check +%patch401 -p1 -b .disable-collection-plugins +%patch402 -p1 -b .remove-EVR-check + +%patch5 -p1 -b .armhfp +# this patch cant be applied on softfp builds +%ifnarch armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l +%patch6 -p1 -b .armhfp-logic +%endif + +%patch501 -p1 -b .elem-progress +%patch502 -p1 -b .elem-progress-header +%patch503 -p1 -b .reinstall +%patch504 -p1 -b .g-libs +%patch505 -p1 -b .brp-python-bytecompile +%patch506 -p1 -b .fix-g-libs + +%if %{with int_bdb} +ln -s db-%{bdbver} db +%endif + +%build +%if %{without int_bdb} +#CPPFLAGS=-I%{_includedir}/db%{bdbver} +#LDFLAGS=-L%{_libdir}/db%{bdbver} +%endif +CPPFLAGS="$CPPFLAGS `pkg-config --cflags nss`" +CFLAGS="$RPM_OPT_FLAGS" +export CPPFLAGS CFLAGS LDFLAGS + +# Using configure macro has some unwanted side-effects on rpm platform +# setup, use the old-fashioned way for now only defining minimal paths. +./configure \ + --prefix=%{_usr} \ + --sysconfdir=%{_sysconfdir} \ + --localstatedir=%{_var} \ + --sharedstatedir=%{_var}/lib \ + --libdir=%{_libdir} \ + --build=%{_target_platform} \ + --host=%{_target_platform} \ + --with-vendor=redhat \ + %{!?with_int_bdb: --with-external-db} \ + %{!?with_plugins: --disable-plugins} \ + --with-lua \ + --with-selinux \ + --with-cap \ + --with-acl \ + --enable-python + +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT + +make DESTDIR="$RPM_BUILD_ROOT" install + +# remove all plugins except systemd_inhibit +rm -f ${RPM_BUILD_ROOT}%{_libdir}/rpm-plugins/{exec.so,sepolicy.so} + +# Save list of packages through cron +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily +install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm + +mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d +install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/rpm + +mkdir -p ${RPM_BUILD_ROOT}/usr/lib/tmpfiles.d +echo "r /var/lib/rpm/__db.*" > ${RPM_BUILD_ROOT}/usr/lib/tmpfiles.d/rpm.conf + +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm +mkdir -p $RPM_BUILD_ROOT%{rpmhome}/macros.d + +install -m 644 %{SOURCE10} ${RPM_BUILD_ROOT}%{rpmhome}/fileattrs/libsymlink.attr +mkdir -p ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions +install -m 644 %{SOURCE11} ${RPM_BUILD_ROOT}%{_datadir}/bash-completion/completions/rpm + +mkdir -p $RPM_BUILD_ROOT/var/lib/rpm +for dbi in \ + Basenames Conflictname Dirnames Group Installtid Name Obsoletename \ + Packages Providename Requirename Triggername Sha1header Sigmd5 \ + __db.001 __db.002 __db.003 __db.004 __db.005 __db.006 __db.007 \ + __db.008 __db.009 +do + touch $RPM_BUILD_ROOT/var/lib/rpm/$dbi +done + +# plant links to relevant db utils as rpmdb_foo for documention compatibility +%if %{without int_bdb} +for dbutil in dump load recover stat upgrade verify +do + ln -s ../../bin/%{dbprefix}_${dbutil} $RPM_BUILD_ROOT/%{rpmhome}/rpmdb_${dbutil} +done +%endif + +%find_lang %{name} + +find $RPM_BUILD_ROOT -name "*.la"|xargs rm -f + +# avoid dragging in tonne of perl libs for an unused script +chmod 0644 $RPM_BUILD_ROOT/%{rpmhome}/perldeps.pl + +# compress our ChangeLog, it's fairly big... +bzip2 -9 ChangeLog + +%clean +rm -rf $RPM_BUILD_ROOT + +%if %{with check} +%check +make check +[ "$(ls -A tests/rpmtests.dir)" ] && cat tests/rpmtests.log +%endif + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%post build-libs -p /sbin/ldconfig +%postun build-libs -p /sbin/ldconfig + +%posttrans +# XXX this is klunky and ugly, rpm itself should handle this +dbstat=/usr/lib/rpm/rpmdb_stat +if [ -x "$dbstat" ]; then + if "$dbstat" -e -h /var/lib/rpm 2>&1 | grep -q "doesn't match library version \| Invalid argument"; then + rm -f /var/lib/rpm/__db.* + fi +fi +exit 0 + +%files -f %{name}.lang +%defattr(-,root,root,-) +%doc GROUPS COPYING CREDITS ChangeLog.bz2 doc/manual/[a-z]* + +/usr/lib/tmpfiles.d/rpm.conf +%dir %{_sysconfdir}/rpm + +%attr(0755, root, root) %dir /var/lib/rpm +%attr(0644, root, root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/lib/rpm/* + +/bin/rpm +%{_bindir}/rpm2cpio +%{_bindir}/rpmdb +%{_bindir}/rpmkeys +%{_bindir}/rpmquery +%{_bindir}/rpmverify + +%{_mandir}/man8/rpm.8* +%{_mandir}/man8/rpmdb.8* +%{_mandir}/man8/rpmkeys.8* +%{_mandir}/man8/rpm2cpio.8* + +%{_datadir}/bash-completion/completions/rpm + +# XXX this places translated manuals to wrong package wrt eg rpmbuild +%lang(fr) %{_mandir}/fr/man[18]/*.[18]* +%lang(ko) %{_mandir}/ko/man[18]/*.[18]* +%lang(ja) %{_mandir}/ja/man[18]/*.[18]* +%lang(pl) %{_mandir}/pl/man[18]/*.[18]* +%lang(ru) %{_mandir}/ru/man[18]/*.[18]* +%lang(sk) %{_mandir}/sk/man[18]/*.[18]* + +%attr(0755, root, root) %dir %{rpmhome} +%{rpmhome}/macros +%{rpmhome}/macros.d +%{rpmhome}/rpmpopt* +%{rpmhome}/rpmrc + +%{rpmhome}/rpmdb_* +%{rpmhome}/rpm.daily +%{rpmhome}/rpm.log +%{rpmhome}/rpm.supp +%{rpmhome}/rpm2cpio.sh +%{rpmhome}/tgpg + +%{rpmhome}/platform + +%files libs +%defattr(-,root,root) +%{_libdir}/librpmio.so.* +%{_libdir}/librpm.so.* + +%if %{with plugins} +%files plugin-systemd-inhibit +%{_libdir}/rpm-plugins +%{_libdir}/rpm-plugins/systemd_inhibit.so +%{_mandir}/man8/rpm-plugin-systemd-inhibit.8* +%endif + +%files build-libs +%defattr(-,root,root) +%{_libdir}/librpmbuild.so.* +%{_libdir}/librpmsign.so.* + +%files build +%defattr(-,root,root) +%{_bindir}/rpmbuild +%{_bindir}/gendiff +%{_bindir}/rpmspec + +%{_mandir}/man1/gendiff.1* +%{_mandir}/man8/rpmbuild.8* +%{_mandir}/man8/rpmdeps.8* +%{_mandir}/man8/rpmspec.8* + +%{rpmhome}/brp-* +%{rpmhome}/check-* +%{rpmhome}/debugedit +%{rpmhome}/sepdebugcrcfix +%{rpmhome}/find-debuginfo.sh +%{rpmhome}/find-lang.sh +%{rpmhome}/*provides* +%{rpmhome}/*requires* +%{rpmhome}/*deps* +%{rpmhome}/*.prov +%{rpmhome}/*.req +%{rpmhome}/config.* +%{rpmhome}/mkinstalldirs +%{rpmhome}/macros.p* +%{rpmhome}/fileattrs + +%files sign +%defattr(-,root,root) +%{_bindir}/rpmsign +%{_mandir}/man8/rpmsign.8* + +%files python +%defattr(-,root,root) +%{python_sitearch}/rpm + +%files devel +%defattr(-,root,root) +%{_mandir}/man8/rpmgraph.8* +%{_bindir}/rpmgraph +%{_libdir}/librp*[a-z].so +%{_libdir}/pkgconfig/rpm.pc +%{_includedir}/rpm + +%files cron +%defattr(-,root,root) +%{_sysconfdir}/cron.daily/rpm +%config(noreplace) %{_sysconfdir}/logrotate.d/rpm + +%files apidocs +%defattr(-,root,root) +%doc COPYING doc/librpm/html/* + +%changelog +* Fri Oct 04 2019 Panu Matilainen - 4.11.3-43 +- Fix packages getting removed on failed update via dnf (#1710691) + +* Wed Aug 21 2019 Pavlina Moravcova Varekova - 4.11.3-42 +- Fix segfault on fingerprint symlink (#1660232) + +* Fri Aug 16 2019 Pavlina Moravcova Varekova - 4.11.3-41 +- Fix bogus if-condition in find-debuginfo.sh (#1720590) + +* Sun May 26 2019 Pavlina Moravcova Varekova - 4.11.3-40 +- Remove only special perl dependencies provided in the same file (#1570181) + +* Thu Mar 21 2019 Tomas Orsava - 4.11.3-39 +- Fix brp-python-bytecompile script to work with Python 3 packages (#1691402) + +* Thu Mar 21 2019 Pavlina Moravcova Varekova - 4.11.3-38 +- Add flag to use strip -g instead of full strip on DSOs (#1663264) + +* Wed Mar 20 2019 Pavlina Moravcova Varekova - 4.11.3-37 +- Use user and group of the rpmbuild process or root for sources (#1572772) + +* Thu Feb 28 2019 Pavlina Moravcova Varekova - 4.11.3-36 +- Add popt-based options --setcaps and --restore (#1550745) +- Improve hardlink handling in disk space calculation (#1491786) +- Remove perl dependencies that are provided in the same file (#1570181) + +* Tue Jun 19 2018 Pavlina Moravcova Varekova - 4.11.3-35 +- Correct "root_dir" output in audit event (#1555326) + +* Fri May 25 2018 Pavlina Moravcova Varekova - 4.11.3-34 +- Adjust --noghost documentation (#1395818) +- Provide audit events on update verification (#1555326) + +* Thu May 10 2018 Pavlina Moravcova Varekova - 4.11.3-33 +- Repair of --noghost option implementation (#1395818) +- Backport fix rpmSign() return value in case of failure (#1419590) +- Backport passing _find_debuginfo_opts -g to eu-strip for executables + (#1540653) + +* Mon Nov 13 2017 Panu Matilainen - 4.11.3-32 +- Backport weak dependency tag definitions (#1508538) + +* Mon Oct 30 2017 Panu Matilainen - 4.11.3-31 +- Backport missing infra for --noconfig option (#1406611) +- As a side-effect, this also makes --noghost work as intended + +* Fri Oct 13 2017 Florian Festi - 4.11.3-30 +- Respin to fix changelog + +* Fri Oct 13 2017 Florian Festi - 4.11.3-29 +- Fix coverity warnings in patch for #1441098 + +* Mon Oct 09 2017 Florian Festi - 4.11.3-28 +- Make sure files in /usr/src/debug are not world writable (RHBZ #1441098) +- Increase maximal header size (RHBZ #1434656) +- Increase buffer to be able to render Korean dates (RHBZ #1425231) +- Add --noconfig option (RHBZ #1406611) + +* Wed Aug 23 2017 Igor Gnatenko - 4.11.3-27 +- Make header available from RPMCALLBACK_ELEM_PROGRESS (RHBZ #1466649) + +* Wed Aug 02 2017 Igor Gnatenko - 4.11.3-26 +- Backport RPMCALLBACK_ELEM_PROGRESS (RHBZ #1466649) +- Backport reinstall feature (RHBZ #1466650) + +* Fri Mar 17 2017 Panu Matilainen - 4.11.3-25 +- Really fix #1371487 + +* Thu Mar 16 2017 Florian Festi - 4.11.3-24 +- Fix include in patch for #1343692 +- Disable patch for (#1371487) temporarily + +* Mon Mar 13 2017 Florian Festi - 4.11.3-22 +- Move rpm-plugin-systemd-inhibit man page to that package (#1360706) +- Fix off by one error in base64 code (#1341913) +- Add sources to lua to prevent %%autosetup failing in some cases (#1359084) +- Fix refcounting for Python hdr objects (#1358467) +- Perl dependecy generator: Skip blocks after variable definitions (#1378307) +- Verify signatures properly (#1371487) +- Export function in Python binding for yum (#1343692) + +* Tue Jul 26 2016 Florian Festi - 4.11.3-21 +- Fix --sign for rpmbuild with --quiet (#1293483) +- Adjusted fix for --noplugins option (#1264031) + +* Thu Jul 14 2016 Florian Festi - 4.11.3-20 +- Removed broken fix for #1293483 + +* Thu Apr 21 2016 Florian Festi - 4.11.3-18 +- Fixed failing upstream test 257 on big endian systems (#1264463) +- Fixed problems with perl.req script (#1320214, #1275551) +- Fixed race condition in rpm file deployment when updating an existing file + (#1320181) +- Move bdb warnings from stdin to stdout (#1297793) +- Add --justdb to the erase section of the man page, too (#1310561) +- Backport support for multi threaded xz compression (#1278924) +- Update config.guess (#1291377) +- Add --noplugins option (#1264031) +- Overwrite a file if it is not marked as config any more (#1290463) +- Add man page for systemd-inhibit plugin (#1265578) + +* Tue Dec 01 2015 Pavol Babincak - 4.11.3-17.2 +- Remove one more %%{_isa} from BuildRequires (#1286805) + +* Tue Dec 01 2015 Pavol Babincak - 4.11.3-17.1 +- Remove %%{_isa} from BuildRequires (#1286805) + +* Fri Sep 11 2015 Florian Festi - 4.11.3-17 +- Detect plugins by DSO file name. Needed for #1160401 + +* Thu Aug 20 2015 Florian Festi - 4.11.3-16 +- Add fix for the fix for #1225118 + +* Wed Aug 19 2015 Florian Festi - 4.11.3-15 +- Remove incompatible check for multiple separators in version or release + (#1250538) + +* Wed Aug 19 2015 Florian Festi - 4.11.3-14 +- Enable plugin system but disable collection plugins. Needed for + systemd-inhibit plugin (#1160401) +- Move systemd-inhibit plugin into its own sub packge + +* Tue Jul 21 2015 Florian Festi - 4.11.3-13 +- Don't show error message if log function fails because of broken pipe + (#1244687) + +* Wed Jul 08 2015 Florian Festi - 4.11.3-12 +- Dont eat newlines on parametrized macro invocations (#1225118) + +* Tue Jul 07 2015 Florian Festi - 4.11.3-11 +- Back port rpm-plugin-systemd-inhibit (#1160401) + +* Thu Jul 02 2015 Florian Festi - 4.11.3-10 +- Fix stripping and debuginfo creation of binaries for changed file output. + (#1206312) + +* Tue Jun 30 2015 Florian Festi - 4.11.3-9 +- Fix color skipping of multiple files with the same content (#1170119) + +* Mon Jun 29 2015 Florian Festi - 4.11.3-8 +- Add %make_build macro for hiding parallel-build magic from specs (#1221357) + +* Fri Jun 26 2015 Florian Festi - 4.11.3-7 +- Add deprecation warning to description of --addsign (#1165414) + +* Fri Jun 26 2015 Florian Festi - 4.11.3-6 +- Add bash completion (#1183032) + +* Fri Jun 26 2015 Florian Festi - 4.11.3-5 +- Fix producing bogus dependencies by perl.req (#1191121) + +* Thu Jun 25 2015 Florian Festi - 4.11.3-4 +- Clearly state that --setperms and --setugids are mutually exclusive + (#1192000) + +* Thu Jun 25 2015 Florian Festi - 4.11.3-3 +- If an error occurs during printing log message then print the error on stderr + (#1202753) + +* Thu Jun 25 2015 Florian Festi - 4.11.3-2 +- File mode from %%defattr is applied to directories with warning (#1204674) + +* Fri Jun 19 2015 Florian Festi - 4.11.3-1 +- Rebase to upstream release 4.11.3 (#1145970) + +* Mon Jan 12 2015 Florian Festi - 4.11.1-25 +- Check for malicious CPIO file name size (#1163061) +- Fixes CVE-2014-8118 + +* Thu Nov 13 2014 Florian Festi - 4.11.1-24 +- Fix race condidition where unchecked data is exposed in the file system + (#1163061) + +* Fri Oct 10 2014 Panu matilainen - 4.11.1-23 +- Really fix brp-python-bytecompile (#1083052) + +* Mon Sep 29 2014 Panu matilainen - 4.11.1-22 +- Actually apply the dirlink patch, doh. + +* Mon Sep 29 2014 Panu matilainen - 4.11.1-21 +- Handle directory replaced with a symlink to one in verify (#1101861) + +* Thu Sep 25 2014 Panu matilainen - 4.11.1-20 +- Byte-compile versioned python libdirs in non-root prefix too (#1083052) + +* Fri Apr 25 2014 Aldy Hernandez - 4.11.1-19 +- Handle ppc64le in libtool.m4. + +* Fri Apr 25 2014 Aldy Hernandez - 4.11.1-18 +- Import from rawhide: + * Wed Jan 15 2013 Panu Matilainen - 4.11.1-12 + - include ppc64le in %%power64 macro (#1052930) + +* Fri Apr 25 2014 Aldy Hernandez - 4.11.1-17 +- Import from rawhide: + * Tue Oct 01 2013 Panu Matilainen - 4.11.1-8 + - add support for ppc64le architecture + +* Mon Mar 24 2014 Panu Matilainen - 4.11.1-16 +- Fully reset file actions between rpmtsRun() calls (#1076552) + +* Wed Feb 19 2014 Panu Matilainen - 4.11.1-15 +- Make room for SHA224 in digest bundles (#1066494) + +* Tue Feb 18 2014 Panu Matilainen - 4.11.1-14 +- Fix incorrect header sort state on export bloating headers (#1061730) + +* Fri Jan 24 2014 Daniel Mach - 4.11.1-13 +- Mass rebuild 2014-01-24 + +* Thu Jan 16 2014 Panu Matilainen - 4.11.1-12 +- Make rpm-build depend on virtual system-rpm-config provide (#1048514) + +* Thu Jan 16 2014 Panu Matilainen - 4.11.1-11 +- Fix minidebuginfo generation on ppc64 (#1052415) + +* Fri Dec 27 2013 Daniel Mach - 4.11.1-10 +- Mass rebuild 2013-12-27 + +* Mon Sep 30 2013 Florian Festi - 4.11.1-9 + - Fix byteorder for 64 bit tags on big endian machines (#1012946) + - Better RPMSIGTAG_SIZE vs PMSIGTAG_LONGSIZE detection (#1012595) + +* Wed Sep 11 2013 Panu Matilainen - 4.11.1-8 +- Fix segfault on empty -p scriptlet body (#1004062) +- Add missing dependency on tar to rpm-build (#986539) + +* Thu Aug 29 2013 Panu Matilainen - 4.11.1-7 +- Fix relocation regression wrt unowned directories (#1001553) +- Fix build-time double-free wrt %%caps() on wildcard file entry (#1002089) +- Fix source URL in spec + +* Fri Aug 02 2013 Florian Festi - 4.11.1-6 + - Disable test suite as fakechroot is not longer in the distribution + +* Fri Aug 02 2013 Florian Festi - 4.11.1-5 +- Revert: Clarify man page about mutually exclusive options (#969505) +- Revert: Move translated rpmgraph man pages to devel sub package (#948861) + +* Thu Aug 01 2013 Florian Festi - 4.11.1-4 +- Clarify man page about mutually exclusive options (#969505) +- Move translated rpmgraph man pages to devel sub package (#948861) + +* Tue Jul 30 2013 Florian Festi - 4.11.1-3 +- Do not filter out lib64.* dependencies (#988373) + +* Fri Jul 05 2013 Panu Matilainen - 4.11.1-2 +- filter out non-library soname dependencies by default + +* Fri Jul 05 2013 Panu Matilainen - 4.11.1-1 +- update to 4.11.1 (http://rpm.org/wiki/Releases/4.11.1) +- drop upstreamed patches +- fix .gnu_debuglink CRC32 after dwz, buildrequire binutils-devel (#971119) +- ensure relocatable packages always get install-prefix(es) set (#979443) + +* Tue May 28 2013 Panu Matilainen - 4.11.0.1-2 +- check for stale locks when opening write-cursors (#860500, #962750...) +- serialize BDB environment open/close (#924417) + +* Mon Feb 04 2013 Panu Matilainen - 4.11.0.1-1 +- update to 4.11.0.1 (http://rpm.org/wiki/Releases/4.11.0.1) + +* Tue Jan 29 2013 Panu Matilainen - 4.11.0-0.beta1.3 +- revert yesterdays ghost-fix, it eats rpmdb's on upgrades + +* Mon Jan 28 2013 Panu Matilainen - 4.11.0-0.beta1.2 +- armv7hl and armv7hnl should not have -mthumb (#901901) +- fix duplicate directory ownership between rpm and rpm-build (#894201) +- fix regression on paths shared between a real file/dir and a ghost + +* Mon Dec 10 2012 Panu Matilainen - 4.11.0-0.beta1.1 +- update to 4.11 beta + +* Mon Nov 19 2012 Panu Matilainen - 4.10.90-0.git11989.3 +- package /usr/lib/rpm/macros.d directory (related to #846679) +- fixup a bunch of old incorrect dates in spec changelog + +* Sat Nov 17 2012 Panu Matilainen - 4.10.90-0.git11989.2 +- fix double-free on %caps in spec (#877512) + +* Thu Nov 15 2012 Panu Matilainen - 4.10.90-0.git11989.1 +- update to 4.11 (http://rpm.org/wiki/Releases/4.11.0) post-alpha snapshot +- drop/adjust patches as necessary + +* Thu Oct 11 2012 Panu Matilainen - 4.10.1-3 +- fix noarch __isa_* macro filter in installplatform (#865436) + +* Wed Oct 10 2012 Panu Matilainen - 4.10.1-2 +- account for intentionally skipped files when verifying hardlinks (#864622) + +* Wed Oct 03 2012 Panu Matilainen - 4.10.1-1 +- update to 4.10.1 ((http://rpm.org/wiki/Releases/4.10.1) + +* Mon Jul 30 2012 Panu Matilainen - 4.10.0-6 +- move our tmpfiles config to more politically correct location (#840192) + +* Sat Jul 21 2012 Fedora Release Engineering - 4.10.0-5.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Jul 02 2012 Panu Matilainen - 4.10.0-5 +- force _host_vendor to redhat to better match toolchain etc (#485203) + +* Thu Jun 28 2012 Panu Matilainen - 4.10.0-4 +- merge ppc64p7 related fixes that only went into f17 (#835978) + +* Wed Jun 27 2012 Panu Matilainen - 4.10.0-3 +- add support for minidebuginfo generation (#834073) + +* Mon Jun 25 2012 Panu Matilainen - 4.10.0-2 +- add dwarf compression support to debuginfo generation (#833311) + +* Thu May 24 2012 Panu Matilainen - 4.10.0-1 +- update to 4.10.0 final + +* Mon Apr 23 2012 Panu Matilainen - 4.10.0-0.beta1.1 +- update to 4.10.0-beta1 + +* Mon Apr 16 2012 Panu Matilainen - 4.9.90-0.git11536.1 +- newer git snapshot (#809402, #808750) +- adjust posttrans script wrt bdb string change (#803866, #805613) + +* Thu Apr 05 2012 Panu Matilainen - 4.9.90-0.git11519.1 +- newer git snapshot to keep patch-count down +- fixes CVE-2012-0060, CVE-2012-0061 and CVE-2012-0815 +- fix obsoletes in installing set getting matched on provides (#810077) + +* Wed Apr 04 2012 Jindrich Novy - 4.9.90-0.git11505.12 +- rebuild against new libdb + +* Tue Apr 03 2012 Jindrich Novy - 4.9.90-0.git11505.11 +- build with internal libdb to allow libdb build with higher soname + +* Fri Mar 30 2012 Panu Matilainen - 4.9.90-0.git11505.10 +- fix base arch macro generation (#808250) + +* Thu Mar 29 2012 Panu Matilainen - 4.9.90-0.git11505.9 +- accept files as command line arguments to rpmdeps again (#807767) + +* Mon Mar 26 2012 Panu Matilainen - 4.9.90-0.git11505.8 +- remove fake library provide hacks now that deltarpm got rebuilt + +* Fri Mar 23 2012 Panu Matilainen - 4.9.90-0.git11505.7 +- fix header data length calculation breakage + +* Thu Mar 22 2012 Panu Matilainen - 4.9.90-0.git11505.6 +- fix keyid size bogosity causing breakage on 32bit systems + +* Wed Mar 21 2012 Panu Matilainen - 4.9.90-0.git11505.5 +- add temporary fake library provides to get around deltarpm "bootstrap" + dependency (yes its dirty) + +* Wed Mar 21 2012 Panu Matilainen - 4.9.90-0.git11505.4 +- fix overzealous sanity check breaking posttrans scripts + +* Tue Mar 20 2012 Panu Matilainen - 4.9.90-0.git11505.3 +- fix bad interaction with yum's test-transaction and pretrans scripts + +* Tue Mar 20 2012 Jindrich Novy - 4.9.90-0.git11505.2 +- rebuild + +* Tue Mar 20 2012 Panu Matilainen - 4.9.90-0.git11505.1 +- update to 4.10.0 alpha (http://rpm.org/wiki/Releases/4.10.0) +- drop/adjust patches as necessary + +* Wed Mar 07 2012 Panu Matilainen - 4.9.1.2-14 +- fix backport thinko in the exclude patch + +* Wed Mar 07 2012 Panu Matilainen - 4.9.1.2-13 +- fix memory corruption on rpmdb size estimation (#766260) +- fix couple of memleaks in python bindings (#782147) +- fix regression in verify output formatting (#797964) +- dont process spec include in false branch of if (#782970) +- only warn on missing excluded files on build (#745629) +- dont free up file info sets on test transactions + +* Thu Feb 09 2012 Panu Matilainen - 4.9.1.2-12 +- switch back to smaller BDB cache default (#752897) + +* Sun Jan 15 2012 Dennis Gilmore - 4.9.1.2-11 +- always apply arm hfp macros, conditionally apply the logic to detect hfp + +* Tue Jan 10 2012 Panu Matilainen - 4.9.1.2-10 +- adjust perl and python detection rules for libmagic change (#772699) + +* Mon Jan 09 2012 Jindrich Novy - 4.9.1.2-9 +- recognize perl script as perl code (#772632) + +* Tue Dec 20 2011 Kay Sievers - 4.9.1.2-8 +- add temporary rpmlib patch to support filesystem transition + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Dec 02 2011 Panu Matilainen - 4.9.1.2-7 +- switch over to libdb, aka Berkeley DB 5.x + +* Thu Dec 01 2011 Panu Matilainen - 4.9.1.2-6 +- fix classification of ELF binaries with setuid/setgid bit (#758251) + +* Fri Nov 25 2011 Panu Matilainen - 4.9.1.2-5 +- adjust font detection rules for libmagic change (#757105) + +* Wed Nov 09 2011 Dennis Gilmore - 4.9.1.2-4 +- conditionally apply arm patch for hardfp on all arches but arm softfp ones + +* Fri Oct 28 2011 Panu Matilainen - 4.9.1.2-3 +- adjust db util prefix & dependency due to #749293 +- warn but dont fail the build if STABS encountered by debugedit (#725378) + +* Wed Oct 12 2011 Panu Matilainen - 4.9.1.2-2 +- try teaching find-lang about the new gnome help layout (#736523) + +* Thu Sep 29 2011 Panu Matilainen - 4.9.1.2-1 +- update to 4.9.1.2 (CVE-2011-3378) +- drop upstreamed rpmdb signal patch + +* Mon Sep 19 2011 Panu Matilainen - 4.9.1.1-3 +- fix signal blocking/unblocking regression on rpmdb open/close (#739492) + +* Mon Aug 08 2011 Adam Jackson 4.9.1.1-2 +- Add RPM_LD_FLAGS to build environment (#728974) + +* Tue Aug 02 2011 Panu Matilainen - 4.9.1.1-1 +- update to 4.9.1.1 + +* Tue Jul 19 2011 Panu Matilainen - 4.9.1-2 +- fix recursion of directories with trailing slash in file list (#722474) + +* Fri Jul 15 2011 Panu Matilainen - 4.9.1-1 +- update to 4.9.1 (http://rpm.org/wiki/Releases/4.9.1) +- drop no longer needed patches + +* Thu Jun 16 2011 Panu Matilainen - 4.9.0-10 +- rebuild to fix a missing interpreter dependency due to bug #712251 + +* Fri Jun 10 2011 Panu Matilainen - 4.9.0-9 +- fix crash if prep or changelog section in spec is empty (#706959) +- fix crash on macro which undefines itself +- fix script dependency generation with file 5.07 string changes (#712251) + +* Thu May 26 2011 Panu Matilainen - 4.9.0-8 +- add dwarf-4 support to debugedit (#707677) +- generate build-id symlinks for all filenames sharing a build-id (#641377) + +* Thu Apr 07 2011 Panu Matilainen - 4.9.0-7 +- add missing ldconfig calls to build-libs sub-package +- fix source url + +* Thu Apr 07 2011 Panu Matilainen - 4.9.0-6 +- revert the spec query change (#693338) for now, it breaks fedpkg + +* Tue Apr 05 2011 Panu Matilainen - 4.9.0-5 +- verify some properties of replaced and wrong-colored files (#528383) +- only list packages that would be generated on spec query (#693338) +- preferred color packages should be erased last (#680261) +- fix leaks when freeing a populated transaction set +- take file state into account for file dependencies + +* Tue Mar 22 2011 Panu Matilainen - 4.9.0-4 +- fix classification of elf executables with sticky bit set (#689182) + +* Wed Mar 16 2011 Jindirch Novy - 4.9.0-3 +- fix crash in package manifest check (#688091) + +* Fri Mar 04 2011 Panu Matilainen - 4.9.0-2 +- fix duplicate rpmsign binary in rpm main package dragging in build-libs + +* Wed Mar 02 2011 Panu Matilainen - 4.9.0-1 +- update to 4.9.0 final +- drop upstreamed patches + +* Tue Mar 01 2011 Panu Matilainen - 4.9.0-0.rc1.4 +- spec cosmetics clean up extra whitespace + group more logically +- wipe out BDB environment at boot via tmpfiles.d + +* Mon Feb 21 2011 Panu Matilainen - 4.9.0-0.rc1.3 +- fix erronous double cursor open, causing yum reinstall hang (#678644) + +* Mon Feb 21 2011 Panu Matilainen - 4.9.0-0.rc1.2 +- fix broken logic in depgen collector, hopefully curing #675002 + +* Tue Feb 15 2011 Panu Matilainen - 4.9.0-0.rc1.1 +- update to 4.9.0-rc1 +- drop upstream patches +- nss packaging has changed, buildrequire nss-softokn-freebl-devel + +* Wed Feb 09 2011 Fedora Release Engineering - 4.9.0-0.beta1.7.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Feb 07 2011 Panu Matilainen - 4.9.0-0.beta1.7 +- fix segfault when building more than one package at a time (#675565) + +* Sun Feb 06 2011 Panu Matilainen - 4.9.0-0.beta1.6 +- adjust ocaml rule for libmagic string change + +* Mon Jan 31 2011 Panu Matilainen - 4.9.0-0.beta1.5 +- dont try to remove environment files if private env used (related to #671200) +- unbreak mono dependency extraction (#673663) +- complain instead of silent abort if cwd is not readable (#672576) + +* Tue Jan 25 2011 Panu Matilainen - 4.9.0-0.beta1.4 +- add support for Requires(posttrans) dependencies + +* Fri Jan 21 2011 Panu Matilainen - 4.9.0-0.beta1.3 +- avoid division by zero in rpmdb size calculation (#671056) +- fix secondary index iteration returing duplicate at end (#671149) +- fix rebuilddb creating duplicate indexes for first header + +* Fri Jan 21 2011 Panu Matilainen - 4.9.0-0.beta1.2 +- permit queries from rpmdb on read-only media (#671200) + +* Tue Jan 18 2011 Panu Matilainen - 4.9.0-0.beta1.1 +- rpm 4.9.0-beta1 (http://rpm.org/wiki/Releases/4.9.0) + - drop no longer needed patches + - adjust requires + buildrequires to match current needs + - adjust rpmdb index ghosts to match the new release + - split librpmbuild and librpmsign to a separate rpm-build-libs package + - split rpmsign to its own package to allow signing without all the build goo + - build-conditionalize plugins, disabled for now + - gstreamer and printer dependency generation moving out + - handle .so symlink dependencies with fileattrs + - use gnupg2 for signing as that's what typically installed by default + +* Tue Jan 18 2011 Panu Matilainen - 4.8.1-7 +- bunch of spec tweaks, cleanups + corrections: + - shorten rpm-build filelist a bit with glob use, reorder for saner grouping + - missing isa in popt version dependency + - only add rpmdb_foo symlinks for actually relevant db_* utils + - drop no longer necessary file-devel dependency from rpm-devel + - drop sqlite backend build-conditional + - preliminaries for moving from db4 to libdb +- use gnupg2 for signing as that's more likely to be installed by default + +* Mon Oct 25 2010 Jindrich Novy - 4.8.1-6 +- rebuild with new xz-5.0.0 + +* Tue Aug 10 2010 Panu Matilainen - 4.8.1-5 +- create gdb index on debuginfo generation (#617166) +- rpm-build now requires /usr/bin/gdb-add-index for consistent index creation +- include COPYING in -apidocs for licensing guidelines compliance + +* Thu Jul 22 2010 David Malcolm - 4.8.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Fri Jul 02 2010 Panu Matilainen - 4.8.1-3 +- ugh, reversed condition braindamage in the font provide extractor "fix" + +* Wed Jun 30 2010 Panu Matilainen - 4.8.1-2 +- fix a potential getOutputFrom() error from font provide extraction +- debug-friendlier message to aid finding other similar cases (#565223) + +* Fri Jun 11 2010 Panu Matilainen - 4.8.1-1 +- update to 4.8.1 (http://rpm.org/wiki/Releases/4.8.1) +- drop no longer needed patches +- fix source url pointing to testing directory + +* Thu Jun 03 2010 Panu Matilainen - 4.8.0-19 +- also strip POSIX file capabilities from hardlinks on upgrade/erase (#598775) + +* Wed Jun 02 2010 Panu Matilainen - 4.8.0-18 +- remove s-bits on upgrade too (#598775) + +* Thu May 27 2010 Panu Matilainen - 4.8.0-17 +- fix segfault in spec parser (#597835) + +* Thu May 27 2010 Panu Matilainen - 4.8.0-16 +- adjust to new pkg-config behavior wrt private dependencies (#596433) +- rpm-build now requires pkgconfig >= 0.24 + +* Fri May 21 2010 Panu Matilainen - 4.8.0-15 +- handle non-existent dependency sets correctly in python (#593553) +- make find-lang look in all locale dirs (#584866) + +* Fri Apr 23 2010 Panu Matilainen - 4.8.0-14 +- lose dangling symlink to extinct (and useless) berkeley_db_svc (#585174) + +* Wed Mar 24 2010 Panu Matilainen - 4.8.0-13 +- fix python match iterator regression wrt boolean representation + +* Wed Mar 17 2010 Panu Matilainen - 4.8.0-12 +- unbreak find-lang --with-man from yesterdays braindamage + +* Tue Mar 16 2010 Panu Matilainen - 4.8.0-11 +- support single PPD providing driver for devices (#568351) +- merge the psdriver patch pile into one +- preserve empty lines in spec prep section (#573339) +- teach python bindings about RPMTRANS_FLAG_NOCONTEXTS (related to #573111) +- dont own localized man directories through find_lang (#569536) + +* Mon Feb 15 2010 Panu Matilainen - 4.8.0-10 +- drop bogus dependency on lzma, xz is used to handle the lzma format too + +* Fri Feb 05 2010 Panu Matilainen - 4.8.0-9 +- unbreak python(abi) requires generation (#562906) + +* Fri Feb 05 2010 Panu Matilainen - 4.8.0-8 +- more fixes to postscript provides extractor (#562228) +- avoid accessing unrelated mount points in disk space checking (#547548) +- fix disk space checking with erasures present in transaction (#561160) + +* Fri Feb 05 2010 Panu Matilainen - 4.8.0-7 +- couple of fixes to the postscript provides extractor (#538101) + +* Thu Feb 04 2010 Panu Matilainen - 4.8.0-6 +- extract provides for postscript printer drivers (#538101) + +* Wed Feb 03 2010 Panu Matilainen - 4.8.0-5 +- python byte-compilation fixes + improvements (#558997) + +* Sat Jan 30 2010 Panu Matilainen - 4.8.0-4 +- support parallel python versions in python dependency extractor (#532118) + +* Thu Jan 21 2010 Panu Matilainen - 4.8.0-3 +- fix segfault on failed url retrieval +- fix verification error code depending on verbosity level +- if anything in testsuite fails, dump out the log + +* Fri Jan 08 2010 Panu Matilainen - 4.8.0-2 +- put disttag back, accidentally nuked in 4.8.0 final update + +* Fri Jan 08 2010 Panu Matilainen - 4.8.0-1 +- update to 4.8.0 final (http://rpm.org/wiki/Releases/4.8.0) + +* Thu Jan 07 2010 Panu Matilainen - 4.8.0-0.beta1.6 +- pull out macro scoping "fix" for now, it breaks font package macros + +* Mon Jan 04 2010 Panu Matilainen - 4.8.0-0.beta1.5 +- always clear locally defined macros when they go out of scope + +* Thu Dec 17 2009 Panu Matilainen - 4.8.0-0.beta1.4 +- permit unexpanded macros when parsing spec (#547997) + +* Wed Dec 09 2009 Panu Matilainen - 4.8.0-0.beta1.3 +- fix a bunch of python refcount-errors causing major memory leaks + +* Mon Dec 07 2009 Panu Matilainen - 4.8.0-0.beta1.2 +- fix noise from python bytecompile on non-python packages (#539635) +- make all our -devel [build]requires isa-specific +- trim out superfluous -devel dependencies from rpm-devel + +* Mon Dec 07 2009 Panu Matilainen - 4.8.0-0.beta1.1 +- update to 4.8.0-beta1 (http://rpm.org/wiki/Releases/4.8.0) +- rpm-build conflicts with current ocaml-runtime + +* Fri Dec 04 2009 Panu Matilainen - 4.7.2-2 +- missing error exit code from signing password checking (#496754) +- dont fail build on unrecognized data files (#532489) +- dont try to parse subkeys and secret keys (#436812) +- fix chmod test on selinux, breaking %%{_fixperms} macro (#543035) + +* Wed Nov 25 2009 Panu Matilainen - 4.7.2-1 +- update to 4.7.2 (http://rpm.org/wiki/Releases/4.7.2) +- fixes #464750, #529214 + +* Wed Nov 18 2009 Jindrich Novy - 4.7.1-10 +- rebuild against BDB-4.8.24 + +* Wed Nov 18 2009 Jindrich Novy - 4.7.1-9 +- drop versioned dependency to BDB + +* Wed Oct 28 2009 Panu Matilainen - 4.7.1-8 +- support multiple python implementations in brp-python-bytecompile (#531117) +- make disk space problem reporting a bit saner (#517418) + +* Tue Oct 06 2009 Panu Matilainen - 4.7.1-7 +- fix build with BDB 4.8.x by removing XA "support" from BDB backend +- perl dep extractor heredoc parsing improvements (#524929) + +* Mon Sep 21 2009 Panu Matilainen - 4.7.1-6 +- use relative paths within db environment (related to #507309, #507309...) +- remove db environment on close in chrooted operation (related to above) +- initialize rpmlib earlier in rpm2cpio (#523260) +- fix file dependency tag extension formatting (#523282) + +* Tue Sep 15 2009 Panu Matilainen - 4.7.1-5 +- fix duplicate dependency filtering on build (#490378) +- permit absolute paths in file lists again (#521760) +- use permissions 444 for all .debug files (#522194) +- add support for optional bugurl tag (#512774) + +* Fri Aug 14 2009 Jesse Keating - 4.7.1-4 +- Patch to make geode appear as i686 (#517475) + +* Thu Aug 06 2009 Jindrich Novy - 4.7.1-3 +- rebuild because of the new xz + +* Sun Jul 26 2009 Fedora Release Engineering - 4.7.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Jul 21 2009 Panu Matilainen - 4.7.1-1 +- update to 4.7.1 ((http://rpm.org/wiki/Releases/4.7.1) +- fix source url + +* Mon Jul 20 2009 Bill Nottingham - 4.7.0-9 +- enable XZ support + +* Thu Jun 18 2009 Panu Matilainen - 4.7.0-8 +- updated OSGi dependency extractor (#506471) +- fix segfault in symlink fingerprinting (#505777) +- fix invalid memory access causing bogus file dependency errors (#506323) + +* Tue Jun 16 2009 Panu Matilainen - 4.7.0-7 +- add dwarf-3 support to debugedit (#505774) + +* Fri Jun 12 2009 Stepan Kasal - 4.7.0-6 +- require libcap >= 2.16 (#505596) + +* Wed Jun 03 2009 Panu Matilainen - 4.7.0-5 +- don't mess up problem altNEVR in python ts.check() (#501068) +- fix hardlink size calculation on build (#503020) + +* Thu May 14 2009 Panu Matilainen - 4.7.0-4 +- split cron-job into a sub-package to avoid silly deps on core rpm (#500722) +- rpm requires coreutils but not in %%post +- build with libcap and libacl +- fix pgp pubkey signature tag parsing + +* Tue Apr 21 2009 Panu Matilainen - 4.7.0-3 +- couple of merge-review fixes (#226377) + - eliminate bogus leftover rpm:rpm rpmdb ownership + - unescaped macro in changelog +- fix find-lang --with-kde with KDE3 (#466009) +- switch back to default file digest algorithm + +* Fri Apr 17 2009 Panu Matilainen - 4.7.0-2 +- file classification tweaks for text files (#494817) + - disable libmagic text token checks, it's way too error-prone + - consistently classify all text as such and include description + +* Thu Apr 16 2009 Panu Matilainen - 4.7.0-1 +- update to 4.7.0 final (http://rpm.org/wiki/Releases/4.7.0) +- fixes #494049, #495429 +- dont permit test-suite failure anymore + +* Thu Apr 09 2009 Panu Matilainen - 4.7.0-0.rc1.1 +- update to 4.7.0-rc1 +- fixes #493157, #493777, #493696, #491388, #487597, #493162 + +* Fri Apr 03 2009 Panu Matilainen - 4.7.0-0.beta1.9 +- fix recorded file state of otherwise skipped files (#492947) +- compress ChangeLog, drop old CHANGES file (#492440) + +* Thu Apr 2 2009 Tom "spot" Callaway - 4.7.0-0.beta1.8 +- Fix sparcv9v and sparc64v targets + +* Tue Mar 24 2009 Panu Matilainen - 4.7.0-0.beta1.7 +- prefer more specific types over generic "text" in classification (#491349) + +* Mon Mar 23 2009 Panu Matilainen - 4.7.0-0.beta1.6 +- with the fd leak gone, let libmagic look into compressed files again (#491596) + +* Mon Mar 23 2009 Panu Matilainen - 4.7.0-0.beta1.5 +- fix font provide generation on filenames with whitespace (#491597) + +* Thu Mar 12 2009 Panu Matilainen - 4.7.0-0.beta1.4 +- handle RSA V4 signatures (#436812) +- add alpha arch ISA-bits +- enable internal testsuite on build + +* Mon Mar 09 2009 Panu Matilainen - 4.7.0-0.beta1.3 +- fix _install_langs behavior (#489235) +- fix recording of file states into rpmdb on install + +* Sun Mar 08 2009 Panu Matilainen - 4.7.0-0.beta1.2 +- load macros before creating directories on src.rpm install (#489104) + +* Fri Mar 06 2009 Panu Matilainen - 4.7.0-0.beta1.1 +- update to 4.7.0-beta1 (http://rpm.org/wiki/Releases/4.7.0) + +* Fri Feb 27 2009 Panu Matilainen - 4.6.0-11 +- build rpm itself with md5 file digests for now to ensure upgradability + +* Thu Feb 26 2009 Panu Matilainen - 4.6.0-10 +- handle NULL passed as EVR in rpmdsSingle() again (#485616) + +* Wed Feb 25 2009 Panu Matilainen - 4.6.0-9 +- pull out python byte-compile syntax check for now + +* Mon Feb 23 2009 Panu Matilainen - 4.6.0-8 +- make -apidocs sub-package noarch +- fix source URL + +* Sat Feb 21 2009 Panu Matilainen - 4.6.0-7 +- loosen up restrictions on dependency names (#455119) +- handle inter-dependent pkg-config files for requires too (#473814) +- error/warn on elf binaries in noarch package in build + +* Fri Feb 20 2009 Panu Matilainen - 4.6.0-6 +- error out on uncompilable python code (Tim Waugh) + +* Tue Feb 17 2009 Jindrich Novy - 4.6.0-5 +- remove two offending hunks from anyarch patch causing that + RPMTAG_BUILDARCHS isn't written to SRPMs + +* Mon Feb 16 2009 Jindrich Novy - 4.6.0-4 +- inherit group tag from the main package (#470714) +- ignore BuildArch tags for anyarch actions (#442105) +- don't check package BuildRequires when doing --rmsource (#452477) +- don't fail because of missing sources when only spec removal + is requested (#472427) + +* Mon Feb 16 2009 Panu Matilainen - 4.6.0-3 +- updated fontconfig provide script - fc-query does all the hard work now + +* Mon Feb 09 2009 Panu Matilainen - 4.6.0-2 +- build against db 4.7.x + +* Fri Feb 06 2009 Panu Matilainen - 4.6.0-1 +- update to 4.6.0 final +- revert libmagic looking into compressed files for now, breaks ooffice build + +* Fri Feb 06 2009 Panu Matilainen - 4.6.0-0.rc4.5 +- enable fontconfig provides generation + +* Thu Feb 05 2009 Panu Matilainen - 4.6.0-0.rc4.4 +- fixup rpm translation lookup to match Fedora specspo (#436941) + +* Wed Feb 04 2009 Panu Matilainen - 4.6.0-0.rc4.3 +- extract mimehandler provides from .desktop files +- preliminaries for extracting font provides (not enabled yet) +- dont classify font metrics data as fonts +- only run script dep extraction once per file, duh + +* Sat Jan 31 2009 Panu Matilainen - 4.6.0-0.rc4.2 +- change platform sharedstatedir to something more sensible (#185862) +- add rpmdb_foo links to db utils for documentation compatibility + +* Fri Jan 30 2009 Panu Matilainen - 4.6.0-0.rc4.1 +- update to 4.6.0-rc4 +- fixes #475582, #478907, #476737, #479869, #476201 + +* Fri Dec 12 2008 Panu Matilainen - 4.6.0-0.rc3.2 +- add back defaultdocdir patch which hadn't been applied on 4.6.x branch yet + +* Fri Dec 12 2008 Panu Matilainen - 4.6.0-0.rc3.1 +- add dist-tag, rebuild + +* Tue Dec 09 2008 Panu Matilainen - 4.6.0-0.rc3.1 +- update to rpm 4.6.0-rc3 +- fixes #475214, #474550, #473239 + +* Wed Dec 3 2008 Jeremy Katz - 4.6.0-0.rc2.9 +- I built into the wrong place + +* Wed Dec 3 2008 Jeremy Katz - 4.6.0-0.rc2.8 +- python 2.6 rebuild again + +* Wed Dec 03 2008 Panu Matilainen +- make rpm-build require pkgconfig (#473978) + +* Tue Dec 02 2008 Panu Matilainen +- fix pkg-config provide generation when pc's depend on each other (#473814) + +* Mon Dec 01 2008 Jindrich Novy +- include rpmfileutil.h from rpmmacro.h, unbreaks + net-snmp (#473420) + +* Sun Nov 30 2008 Panu Matilainen +- rebuild for python 2.6 + +* Sat Nov 29 2008 Panu Matilainen +- update to 4.6.0-rc2 +- fixes #471820, #473167, #469355, #468319, #472507, #247374, #426672, #444661 +- enable automatic generation of pkg-config and libtool dependencies #465377 + +* Fri Oct 31 2008 Panu Matilainen +- adjust find-debuginfo for "file" output change (#468129) + +* Tue Oct 28 2008 Panu Matilainen +- Florian's improved fingerprinting hash algorithm from upstream + +* Sat Oct 25 2008 Panu Matilainen +- Make noarch sub-packages actually work +- Fix defaultdocdir logic in installplatform to avoid hardwiring mandir + +* Fri Oct 24 2008 Jindrich Novy +- update compat-db dependencies (#459710) + +* Wed Oct 22 2008 Panu Matilainen +- never add identical NEVRA to transaction more than once (#467822) + +* Sun Oct 19 2008 Panu Matilainen +- permit tab as macro argument separator (#467567) + +* Thu Oct 16 2008 Panu Matilainen +- update to 4.6.0-rc1 +- fixes #465586, #466597, #465409, #216221, #466503, #466009, #463447... +- avoid using %%configure macro for now, it has unwanted side-effects on rpm + +* Wed Oct 01 2008 Panu Matilainen +- update to official 4.5.90 alpha tarball +- a big pile of misc bugfixes + translation updates +- isa-macro generation fix for ppc (#464754) +- avoid pulling in pile of perl dependencies for an unused script +- handle both "invalid argument" and clear env version mismatch on posttrans + +* Thu Sep 25 2008 Jindrich Novy +- don't treat %%patch numberless if -P parameter is present (#463942) + +* Thu Sep 11 2008 Panu Matilainen +- add hack to support extracting gstreamer plugin provides (#438225) +- fix another macro argument handling regression (#461180) + +* Thu Sep 11 2008 Jindrich Novy +- create directory structure for rpmbuild prior to build if it doesn't exist (#455387) +- create _topdir if it doesn't exist when installing SRPM +- don't generate broken cpio in case of hardlink pointing on softlink, + thanks to pixel@mandriva.com + +* Sat Sep 06 2008 Jindrich Novy +- fail hard if patch isn't found (#461347) + +* Mon Sep 01 2008 Jindrich Novy +- fix parsing of boolean expressions in spec (#456103) + (unbreaks pam, jpilot and maybe other builds) + +* Tue Aug 26 2008 Jindrich Novy +- add support for noarch subpackages +- fix segfault in case of insufficient disk space detected (#460146) + +* Wed Aug 13 2008 Panu Matilainen +- 4.5.90-0.git8461.2 +- fix archivesize tag generation on ppc (#458817) + +* Fri Aug 08 2008 Panu Matilainen +- 4.5.90-0.git8461.1 +- new snapshot from upstream +- fixes #68290, #455972, #446202, #453364, #456708, #456103, #456321, #456913, + #458260, #458261 +- partial fix for #457360 + +* Thu Jul 31 2008 Florian Festi +- 4.5.90-0.git8427.1 +- new snapshot from upstream + +* Thu Jul 31 2008 Florian Festi +- 4.5.90-0.git8426.10 +- rpm-4.5.90-posttrans.patch +- use header from rpmdb in posttrans to make anaconda happy + +* Sat Jul 19 2008 Panu Matilainen +- 4.5.90-0.git8426.9 +- fix regression in patch number handling (#455872) + +* Tue Jul 15 2008 Panu Matilainen +- 4.5.90-0.git8426.8 +- fix regression in macro argument handling (#455333) + +* Mon Jul 14 2008 Panu Matilainen +- 4.5.90-0.git8426.7 +- fix mono dependency extraction (adjust for libmagic string change) + +* Sat Jul 12 2008 Panu Matilainen +- 4.5.90-0.git8426.6 +- fix type mismatch causing funky breakage on ppc64 + +* Fri Jul 11 2008 Panu Matilainen +- 4.5.90-0.git8426.5 +- flip back to external bdb +- fix tab vs spaces complaints from rpmlint +- add dep for lzma and require unzip instead of zip in build (#310694) +- add pkgconfig dependency to rpm-devel +- drop ISA-dependencies for initial introduction +- new snapshot from upstream for documentation fixes + +* Thu Jul 10 2008 Panu Matilainen +- 4.5.90-0.git8424.4 +- handle int vs external db in posttrans too + +* Wed Jul 09 2008 Panu Matilainen +- 4.5.90-0.git8424.3 +- require curl as external url helper + +* Wed Jul 09 2008 Panu Matilainen +- 4.5.90-0.git8424.2 +- add support for building with or without internal db + +* Wed Jul 09 2008 Panu Matilainen +- rpm 4.5.90-0.git8424.1 (alpha snapshot) +- adjust to build against Berkeley DB 4.5.20 from compat-db for now +- add posttrans to clean up db environment mismatch after upgrade +- forward-port devel autodeps patch + +* Tue Jul 08 2008 Panu Matilainen +- adjust for rpmdb index name change +- drop unnecessary vendor-macro patch for real +- add ISA-dependencies among rpm subpackages +- make lzma and sqlite deps conditional and disabled by default for now + +* Fri Feb 01 2008 Panu Matilainen +- spec largely rewritten, truncating changelog