Hello community,
here is the log from the commit of package rpm.3337 for openSUSE:13.1:Update checked in at 2014-12-27 21:05:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:13.1:Update/rpm.3337 (Old)
and /work/SRC/openSUSE:13.1:Update/.rpm.3337.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rpm.3337"
Changes:
--------
New Changes file:
--- /dev/null 2014-12-25 22:38:16.200041506 +0100
+++ /work/SRC/openSUSE:13.1:Update/.rpm.3337.new/python3-rpm.changes 2014-12-27 21:05:05.000000000 +0100
@@ -0,0 +1,33 @@
+-------------------------------------------------------------------
+Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de
+
+- update to rpm-4.11.1
+
+-------------------------------------------------------------------
+Wed Jan 2 14:25:09 UTC 2013 - dmueller@suse.com
+
+- Update to 4.10.2
+
+-------------------------------------------------------------------
+Sun Nov 4 08:54:25 UTC 2012 - coolo@suse.com
+
+- fix build
+
+-------------------------------------------------------------------
+Sat Sep 22 13:24:30 UTC 2012 - idonmez@suse.com
+
+- Update for rpm 4.10.0
+
+-------------------------------------------------------------------
+Tue Jan 17 10:29:20 UTC 2012 - saschpe@suse.de
+
+- Spec file cleanup:
+ * Don't rm -rf %{buildroot}
+ * Removed %clean section
+ * Removed authors from description
+
+-------------------------------------------------------------------
+Mon Jan 9 17:12:41 CET 2012 - dmueller@suse.de
+
+- Initial package
+
New Changes file:
--- /dev/null 2014-12-25 22:38:16.200041506 +0100
+++ /work/SRC/openSUSE:13.1:Update/.rpm.3337.new/rpm-python.changes 2014-12-27 21:05:06.000000000 +0100
@@ -0,0 +1,123 @@
+-------------------------------------------------------------------
+Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de
+
+- update to rpm-4.11.1
+
+-------------------------------------------------------------------
+Wed Jan 2 14:25:20 UTC 2013 - dmueller@suse.com
+
+- Update to 4.10.2
+
+-------------------------------------------------------------------
+Mon Apr 23 11:16:26 CEST 2012 - mls@suse.de
+
+- modified capsule api diff to match rpm upstream
+
+-------------------------------------------------------------------
+Wed Apr 11 16:54:02 UTC 2012 - klaussfreire@gmail.com
+
+- Fix usage of deprecated AsVoidPtr Python/C API,
+ replaced by Capsule API
+
+-------------------------------------------------------------------
+Tue Jan 17 10:28:42 UTC 2012 - saschpe@suse.de
+
+- Spec file cleanup:
+ * Don't rm -rf %{buildroot}
+ * Removed %clean section
+ * Removed authors from description
+
+-------------------------------------------------------------------
+Sun Dec 11 09:28:28 UTC 2011 - coolo@suse.com
+
+- add libtool as explicit buildrequire
+
+-------------------------------------------------------------------
+Wed Feb 23 14:01:41 CET 2011 - mls@suse.de
+
+- drop standard python directories from filelist [bnc#229189]
+
+-------------------------------------------------------------------
+Fri Oct 22 15:52:32 UTC 2010 - coolo@novell.com
+
+- adapt second spec file to changes done to rpm.spec
+
+-------------------------------------------------------------------
+Mon Oct 18 11:03:53 CEST 2010 - dmueller@suse.de
+
+- adapt buildrequires
+
+-------------------------------------------------------------------
+Thu Feb 12 16:52:26 CET 2009 - ro@suse.de
+
+- adapt buildrequires
+
+-------------------------------------------------------------------
+Wed Oct 8 11:24:22 CEST 2008 - cthiel@suse.de
+
+- added libelf-devel to BuildRequires to fix build
+
+-------------------------------------------------------------------
+Thu Sep 11 15:33:52 CEST 2008 - mls@suse.de
+
+- update to 4.4.2.3 to get rid of >50 patches
+
+-------------------------------------------------------------------
+Sat Aug 30 21:23:38 CEST 2008 - cthiel@suse.de
+
+- add libselinux-devel to BuildRequires
+
+-------------------------------------------------------------------
+Thu Aug 7 16:05:51 CEST 2008 - dmueller@suse.de
+
+- fix build against python 2.6
+
+-------------------------------------------------------------------
+Thu Mar 27 14:47:18 CET 2008 - coolo@suse.de
+
+- fix buildrequires
+
+-------------------------------------------------------------------
+Fri May 25 16:20:53 CEST 2007 - mls@suse.de
+
+- fix unicode queries
+
+-------------------------------------------------------------------
+Fri Mar 30 15:06:28 CEST 2007 - rguenther@suse.de
+
+- add ncurses-devel and zlib-devel BuildRequires.
+
+-------------------------------------------------------------------
+Wed Oct 18 22:59:02 CEST 2006 - mls@suse.de
+
+- use rpm.spec for building instead of duplication everything
+- delete superfluous .a and .la files [#202604]
+- create .pyc and .pyo files [#205711]
+
+-------------------------------------------------------------------
+Sun Oct 15 23:41:37 CEST 2006 - schwab@suse.de
+
+- Make sure config.rpath is present.
+
+-------------------------------------------------------------------
+Fri Sep 22 08:58:57 CEST 2006 - aj@suse.de
+
+- Fix for python2.5.
+
+-------------------------------------------------------------------
+Thu Sep 21 11:41:04 CEST 2006 - lnussel@suse.de
+
+- do not package beecrypt python bindings as libbeecrypt is not
+ packaged either
+- fix literal %{version} in Requires tag
+
+-------------------------------------------------------------------
+Thu Sep 21 10:58:42 CEST 2006 - lnussel@suse.de
+
+- fix build with python 2.5 by overriding autodetection
+
+-------------------------------------------------------------------
+Tue Sep 19 13:48:27 CEST 2006 - rguenther@suse.de
+
+- split from rpm package
+
New Changes file:
--- /dev/null 2014-12-25 22:38:16.200041506 +0100
+++ /work/SRC/openSUSE:13.1:Update/.rpm.3337.new/rpm.changes 2014-12-27 21:05:06.000000000 +0100
@@ -0,0 +1,3425 @@
+-------------------------------------------------------------------
+Wed Dec 10 17:45:35 CET 2014 - mls@suse.de
+
+- honor --noglob in install mode [bnc#892431]
+ new patch: installnoglob.diff
+- check for bad invalid name sizes [bnc#908128] [CVE-2014-8118]
+ new patch: cpionamesize.diff
+- create files with mode 0 [bnc#906803] [CVE-2013-6435]
+ new patch: unpackmode0.diff
+
+-------------------------------------------------------------------
+Thu Dec 19 15:52:43 CET 2013 - mls@suse.de
+
+- bump suse_version to 1310 [bnc#851877]
+- backport prefix handling fix [bnc#852310]
+ patch: installprefix.diff
+
+-------------------------------------------------------------------
+Fri Sep 27 15:13:45 CEST 2013 - mls@suse.de
+
+- add selfconflicts.diff: fix self-conflicts and self-obsoletes
+ handling for verify operations [bnc#838133]
+
+-------------------------------------------------------------------
+Tue Sep 24 10:36:15 UTC 2013 - mail@bernhard-voelker.de
+
+- replace obsoleted "find -perm +NNN" syntax [bnc#842004]
+ to "-perm /NNN" in debugsource-package.diff and
+ finddebuginfo.diff.
+
+-------------------------------------------------------------------
+Wed Sep 11 18:28:39 CEST 2013 - mls@suse.de
+
+- fix two bugs in the rpmstrPoolRehash() function:
+ adding strpoolrehash.diff and ignore_poolstr_dummy_entries.diff
+
+-------------------------------------------------------------------
+Thu Sep 5 12:01:51 UTC 2013 - schwab@linux-m68k.org
+
+- brp-compress-no-img.patch: don't compress image files
+
+-------------------------------------------------------------------
+Thu Aug 29 17:49:27 CEST 2013 - mls@suse.de
+
+- add beedigest.diff to plug memory leaks and support DSA signatures
+ with hashes other than sha-1 (already upstream)
+
+-------------------------------------------------------------------
+Mon Aug 5 15:45:38 UTC 2013 - dmueller@suse.com
+
+- weakdeps.diff: readd support for recommends, suggests, enhances
+ supplements
+
+-------------------------------------------------------------------
+Thu Aug 1 15:34:49 CEST 2013 - mls@suse.de
+
+- fix typo in .debug_gdb_scripts name [bnc#818502]
+
+-------------------------------------------------------------------
+Mon Jul 15 16:17:45 CEST 2013 - mls@suse.de
+
+- backport noposttrans.diff from rpm master [bnc#773575]
+
+-------------------------------------------------------------------
+Fri Jul 12 15:36:43 CEST 2013 - mls@suse.de
+
+- update to rpm-4.11.1
+ * fix bogus file conflict on symlink permissions
+ * fix replaced files not getting reported at all during verification
+ * fix explicit file conflicts in installed packages being ignored
+ * fix multiple corner cases in config file handling
+ * fix disk-space accounting bugs
+ * report replacing directories with non-directories as file conflict
+- package rpmdb_* database tools
+- get rid of kernel symbol requires/provides, instead add simple
+ package provides/requires like in Fedora
+- delete files.diff patch, it caused more harm than good
+
+-------------------------------------------------------------------
+Tue Jul 2 09:53:02 UTC 2013 - dmueller@suse.com
+
+- extend the armv7hl hack also to armv6hl
+
+-------------------------------------------------------------------
+Thu Jun 27 22:03:51 UTC 2013 - dmueller@suse.com
+
+- add support for armv6hl target
+
+-------------------------------------------------------------------
+Sun Jun 23 19:03:27 UTC 2013 - schwab@linux-m68k.org
+
+- psm-errno.patch: avoid losing errno from failures to unpack archive
+
+-------------------------------------------------------------------
+Thu Jun 20 13:47:46 UTC 2013 - coolo@suse.com
+
+- use gettext-devel instead of real package name gettext-tools
+ to use the (for bootstrapping) preferred gettext-tools-mini
+
+-------------------------------------------------------------------
+Thu Jun 20 09:46:47 UTC 2013 - coolo@suse.com
+
+- add systemd-rpm-macros to essential list
+
+-------------------------------------------------------------------
+Sun May 19 14:05:14 UTC 2013 - schwab@suse.de
+
+- auto-config-update-aarch64.diff: increase level to 8
+
+-------------------------------------------------------------------
+Wed May 8 22:25:09 UTC 2013 - schwab@suse.de
+
+- Remove unused files
+
+-------------------------------------------------------------------
+Wed May 8 14:56:15 UTC 2013 - dmueller@suse.com
+
+- auto-config-update-aarch64.diff:
+ * search up to 5 levels for interesting files to patch
+
+-------------------------------------------------------------------
+Mon Apr 22 22:00:14 UTC 2013 - dmueller@suse.com
+
+- add auto-config-update-aarch64.diff:
+ * optionally automatically update config.guess/sub during build
+
+-------------------------------------------------------------------
+Fri Apr 5 18:47:53 UTC 2013 - dmueller@suse.com
+
+- update to 4.10.3.1:
+ * Fix install-regression introduced in RPM 4.10.0 which can
+ cause creation of real files and directories skipped when
+ the path is shared with a %ghost.
+ * translation updates
+
+-------------------------------------------------------------------
+Fri Apr 5 12:39:12 UTC 2013 - idonmez@suse.com
+
+- Add Source URL, see https://en.opensuse.org/SourceUrls
+
+-------------------------------------------------------------------
+Sat Mar 30 13:53:48 UTC 2013 - coolo@suse.com
+
+- which is essential for man packages
+
+-------------------------------------------------------------------
+Mon Mar 25 13:38:45 UTC 2013 - schwab@suse.de
+
+- debugedit-aarch64.diff: handle aarch64 relocation
+
+-------------------------------------------------------------------
+Fri Feb 15 15:29:25 UTC 2013 - dmueller@suse.com
+
+- add ignore-auxv.diff:
+ * avoid auxv parsing for any platform other than powerpc
+- add config-guess-sub-update.diff:
+ * update config.guess/sub for aarch64 support
+- update rpmrc.diff, build.diff:
+ * Support aarch64
+
+-------------------------------------------------------------------
+Thu Jan 10 12:04:15 UTC 2013 - coolo@suse.com
+
+- remove the macros that were documented to be removed january 2013:
+ %run_permissions, use %set_permissions instead
+ %run_suseconfig, SuSEconfig is gone
+ %suse_update_config
+
+-------------------------------------------------------------------
+Wed Jan 2 13:46:17 UTC 2013 - dmueller@suse.com
+
+- update to 4.10.2 (bnc#796375):
+ * Fix missing error code on unparseable signature in packages,
+ regression introduced in rpm 4.10.0. This could result in packages
+ with malformed signature falling through signature checking.
+ * Fix missing error code on --import on bogus key file (RhBug:869667)
+ * Fix installation of packages containing skipped hardlinks (RhBug:864622)
+ * Fix --setperms regression introduced in rpm 4.10.0 (RhBug:881835)
+ * Fix locale dependent behavior in rpm2cpio.sh (RhBug:878363)
+ * Add --undefine cli switch for undefining macros (related to RhBug:876308)
+ * Fix warnings when building with gcc >= 4.7
+ * Permit key imports on transactions where signature checking is
+ disabled, regression of sorts introduced in 4.10.0 (RhBug:856225)
+ * Fix RPMPROB_FILTER_FORCERELOCATE aka --badreloc, regression introduced in
+ 4.9.0 (RhBug:828784)
+ * Verify files from non-installed packages again, regression introduced
+ in 4.9.0 (RhBug:826589)
+ * Fix large (> 4GB) package support, regression introduced in
+ 4.9.0 (RhBug:844936)
+ * Only create the first instance of a file shared between multiple
+ packages on install (speedup + improved verification timestamp behavior)
+ * Report config and missinok flags too in deptype format extension
+ * Fix relative path handling in --whatprovides query
+ * Add --noclean and --nocheck options to rpmbuild (RhBug:756531)
+ * Permit non-existent %ghost directories to be packaged (RhBug:839656)
+ * Dont silence patch by default (RhBug:678000, RhBug:773503)
+ * Accept "owner" as an alias to "user" %verify attribute (RhBug:838657)
++++ 3228 more lines (skipped)
++++ between /dev/null
++++ and /work/SRC/openSUSE:13.1:Update/.rpm.3337.new/rpm.changes
New:
----
RPM-HOWTO.tar.bz2
RPM-Tips.html.tar.bz2
assumeexec.diff
auto-config-update-aarch64.diff
autodeps.diff
baselibs.conf
beecrypt-4.1.2.diff
beecrypt-4.1.2.tar.bz2
beedigest.diff
brp-compress-no-img.patch
brp.diff
brpcompress.diff
build.diff
buildidprov.diff
checkfilesnoinfodir.diff
convertdb1static.diff
cpionamesize.diff
db-4.8.30.tar.bz2
db.diff
dbfsync.diff
dbprivate.diff
dbrointerruptable.diff
debug_gdb_scripts.diff
debugedit-canon-fix.diff
debugedit-comp-dir.diff
debugedit.diff
debuginfo-mono.patch
debuglink.diff
debugsource-package.diff
debugsubpkg.diff
disttag-macro.diff
extcond.diff
fileattrs.diff
finddebuginfo-absolute-links.diff
finddebuginfo.diff
findksyms.diff
findlang.diff
findsupplements.diff
firmware.diff
fontprovides.diff
getauxval.diff
headeradddb.diff
headerchk2.diff
helperenv.diff
ignore-auxv.diff
ignore_poolstr_dummy_entries.diff
initscriptsprov.diff
installnoglob.diff
installprefix.diff
langnoc.diff
lazystatfs.diff
localetag.diff
macrosin.diff
modalias-encode.diff
modalias-kernel_module.diff
modalias.diff
mono-find-requires.diff
nameversioncompare.diff
nobuildcolor.diff
nomagiccheck.diff
noposttrans.diff
noprereqdeprec.diff
perlprov.diff
platformin.diff
psm-errno.diff
python3-abi-kind.diff
python3-rpm.changes
python3-rpm.spec
pythondeps.diff
refreshtestarch.diff
remove-brp-strips.diff
remove-translations.diff
repackage-nomd5.diff
requires-ge-macro.diff
rpm-4.11.1.tar.bz2
rpm-deptracking.patch
rpm-gst-provides.patch
rpm-python.changes
rpm-python.spec
rpm-shorten-changelog.diff
rpm-suse_macros
rpm.changes
rpm.spec
rpmconfigcheck
rpmpopt.diff
rpmqpack.diff
rpmrc.diff
rpmrctests.diff
rpmsort
safeugid.diff
selfconflicts.diff
specfilemacro.diff
strpoolrehash.diff
suspendlock.diff
symset-table
sysconfig.services-rpm
taggedfileindex.diff
unpackmode0.diff
waitlock.diff
weakdeps.diff
whatrequires-doc.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-rpm.spec ++++++
#
# spec file for package python3-rpm
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python3-rpm
Version: 4.11.1
Release: 0
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0+
Group: System/Packages
Source99: rpm.spec
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua51-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python3-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: rpm = %{version}
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 3
%description
The python3-rpm 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.
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}
%install
mkdir -p %{buildroot}%{_prefix}/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
%make_install
find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python3*/site-packages/rpm/\* -print0 | xargs -0 rm
pushd %{buildroot}/%{_libdir}/python3*/site-packages/rpm
rm -f _rpmmodule.a _rpmmodule.la
python3 %{_libdir}/python3*/py_compile.py *.py
python3 -O %{_libdir}/python3*/py_compile.py *.py
popd
%files
%defattr(-,root,root)
%{_libdir}/python*/*/*
%changelog
++++++ rpm-python.spec ++++++
#
# spec file for package rpm-python
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm-python
Version: 4.11.1
Release: 0
#!BuildIgnore: rpmlint-Factory
Summary: Python Bindings for Manipulating RPM Packages
License: GPL-2.0+
Group: System/Packages
Source99: rpm.spec
BuildRequires: file-devel
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua51-devel
BuildRequires: ncurses-devel
BuildRequires: popt-devel
BuildRequires: python-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel
Requires: rpm = %{version}
%py_requires
%{expand:%(sed -n -e '/^Source:/,/^BuildRoot:/p' <%_sourcedir/rpm.spec)}
%global with_python 2
%description
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.
%prep
%{expand:%(sed -n -e '/^%%prep/,/^%%install/p' <%_sourcedir/rpm.spec | sed -e '1d' -e '$d')}
%install
mkdir -p %{buildroot}%{_prefix}/lib
# only installing in python/ does not work because rpm links against
# installed libs at install time
%make_install
find %{buildroot} -not -type d -and -not -path %{buildroot}%{_libdir}/python%{py_ver}/site-packages/rpm/\* -print0 | xargs -0 rm
pushd %{buildroot}/%py_sitedir/rpm
rm -f _rpmmodule.a _rpmmodule.la
python %py_libdir/py_compile.py *.py
python -O %py_libdir/py_compile.py *.py
popd
%files
%defattr(-,root,root)
%{_libdir}/python*/*/*
%changelog
++++++ rpm.spec ++++++
#
# spec file for package rpm
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: rpm
BuildRequires: binutils
BuildRequires: bzip2
BuildRequires: file-devel
BuildRequires: findutils
BuildRequires: gcc
BuildRequires: gettext-devel
BuildRequires: glibc-devel
BuildRequires: gzip
BuildRequires: libacl-devel
BuildRequires: libbz2-devel
BuildRequires: libcap-devel
BuildRequires: libelf-devel
BuildRequires: libselinux-devel
BuildRequires: libsemanage-devel
BuildRequires: libtool
BuildRequires: lua51-devel
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: patch
BuildRequires: perl-base
BuildRequires: popt-devel
BuildRequires: rpm-build
BuildRequires: xz-devel
BuildRequires: zlib-devel
#!BuildIgnore: rpmlint-Factory
Provides: rpminst
PreReq: %fillup_prereq
Summary: The RPM Package Manager
License: GPL-2.0+
Group: System/Packages
Version: 4.11.1
Release: 0
Source: http://rpm.org/releases/rpm-4.11.x/rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
Source4: rpm-suse_macros
Source5: rpmsort
Source6: symset-table
Source8: rpmconfigcheck
Source9: sysconfig.services-rpm
Source10: beecrypt-4.1.2.tar.bz2
Source11: db-4.8.30.tar.bz2
Source12: baselibs.conf
Patch1: beecrypt-4.1.2.diff
Patch2: db.diff
# quilt patches start here
Patch11: debugedit.diff
Patch13: ignore-auxv.diff
Patch12: localetag.diff
Patch14: nameversioncompare.diff
Patch15: dbfsync.diff
Patch16: dbrointerruptable.diff
Patch17: extcond.diff
Patch18: refreshtestarch.diff
Patch19: rpmrctests.diff
Patch20: waitlock.diff
Patch21: suspendlock.diff
Patch22: weakdeps.diff
Patch23: autodeps.diff
Patch24: brp.diff
Patch25: brpcompress.diff
Patch26: checkfilesnoinfodir.diff
Patch27: finddebuginfo.diff
Patch28: findksyms.diff
Patch29: findlang.diff
Patch30: macrosin.diff
Patch31: modalias.diff
Patch32: platformin.diff
Patch33: rpmpopt.diff
Patch34: rpmrc.diff
Patch35: taggedfileindex.diff
Patch36: rpmqpack.diff
Patch37: convertdb1static.diff
Patch38: build.diff
Patch39: modalias-kernel_module.diff
Patch41: debugedit-comp-dir.diff
Patch42: perlprov.diff
Patch43: rpm-shorten-changelog.diff
Patch44: debugsource-package.diff
Patch45: whatrequires-doc.diff
Patch46: remove-brp-strips.diff
Patch47: requires-ge-macro.diff
Patch48: debugedit-canon-fix.diff
Patch49: finddebuginfo-absolute-links.diff
Patch50: firmware.diff
Patch51: specfilemacro.diff
Patch52: modalias-encode.diff
Patch53: disttag-macro.diff
Patch54: buildidprov.diff
Patch55: debugsubpkg.diff
Patch56: debuglink.diff
Patch57: debuginfo-mono.patch
Patch58: lazystatfs.diff
Patch59: repackage-nomd5.diff
Patch60: safeugid.diff
Patch61: noprereqdeprec.diff
Patch62: pythondeps.diff
Patch63: fontprovides.diff
Patch64: rpm-gst-provides.patch
Patch65: initscriptsprov.diff
Patch66: remove-translations.diff
Patch67: headeradddb.diff
Patch68: dbprivate.diff
Patch69: nobuildcolor.diff
Patch70: fileattrs.diff
Patch71: nomagiccheck.diff
Patch72: findsupplements.diff
Patch73: assumeexec.diff
Patch74: mono-find-requires.diff
Patch75: rpm-deptracking.patch
Patch76: python3-abi-kind.diff
Patch77: langnoc.diff
Patch78: headerchk2.diff
Patch79: helperenv.diff
Patch80: psm-errno.diff
Patch81: getauxval.diff
Patch82: noposttrans.diff
Patch83: debug_gdb_scripts.diff
Patch84: beedigest.diff
Patch85: brp-compress-no-img.patch
Patch86: strpoolrehash.diff
Patch87: ignore_poolstr_dummy_entries.diff
Patch88: selfconflicts.diff
Patch89: installprefix.diff
Patch90: installnoglob.diff
Patch91: cpionamesize.diff
Patch92: unpackmode0.diff
Patch6464: auto-config-update-aarch64.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
%define _binary_payload w9.bzdio
%description
RPM Package Manager is the main tool for managing the software packages
of the SuSE Linux distribution.
RPM can be used to install and remove software packages. With rpm, it
is easy to update packages. RPM keeps track of all these manipulations
in a central database. This way it is possible to get an overview of
all installed packages. RPM also supports database queries.
%package devel
Summary: Include Files and Libraries mandatory for Development
Group: System/Packages
Requires: rpm = %{version}
# for people confusing the one with the other
Recommends: rpm-build = %{version}
Requires: popt-devel
%description devel
This package contains the RPM C library and header files. These
development files will simplify the process of writing programs which
manipulate RPM packages and databases and are intended to make it
easier to create graphical package managers or any other tools that
need an intimate knowledge of RPM packages in order to function.
%package build
Summary: Tools and Scripts to create rpm packages
Group: System/Packages
Requires: rpm = %{version}
Provides: rpm:%_bindir/rpmbuild
Provides: rpmbuild
# SUSE's build essentials
Requires: binutils
Requires: bzip2
Requires: coreutils
Requires: diffutils
Requires: file
Requires: findutils
Requires: gawk
Requires: gcc
Requires: gettext-tools
Requires: glibc-devel
Requires: glibc-locale
Requires: grep
Requires: gzip
Requires: make
Requires: net-tools
Requires: patch
Requires: perl-base
Requires: sed
Requires: systemd-rpm-macros
Requires: tar
Requires: util-linux
Requires: which
Requires: xz
# drop candidates
Requires: cpio
Requires: file
%description build
If you want to build a rpm, you need this package. It provides rpmbuild
and requires some packages that are usually required
%prep
%setup -q -n rpm-%{version}
rm -rf sqlite
rm -rf beecrypt
tar xjf %{SOURCE10}
tar xjf %{SOURCE11}
ln -s db-4.8.30 db
ln -s beecrypt-4.1.2 beecrypt
chmod -R u+w db/*
rm -f rpmdb/db.h
%patch -P 1 -P 2
%patch -P 11 -P 12 -P 13 -P 14 -P 15 -P 16 -P 17 -P 18 -P 19
%patch -P 20 -P 21 -P 22 -P 23 -P 24 -P 25 -P 26 -P 27 -P 28 -P 29
%patch -P 30 -P 31 -P 32 -P 33 -P 34 -P 35 -P 36 -P 37 -P 38 -P 39
%patch -P 41 -P 42 -P 43 -P 44 -P 45 -P 46 -P 47 -P 48 -P 49
%patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59
%patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69
%patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79
%patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 -P 86 -P 87 -P 88 -P 89
%patch -P 90 -P 91 -P 92
%ifarch aarch64
%patch6464
%endif
cp config.guess config.sub db/dist/
cp config.guess config.sub beecrypt/
#chmod 755 scripts/find-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov
#chmod 755 scripts/debuginfo.prov
tar -xjvf %{SOURCE1}
tar -xjvf %{SOURCE2}
if [ -s /etc/rpm/suse_macros ]; then
cp -a /etc/rpm/suse_macros %{SOURCE4}
fi
cp -a %{SOURCE4} suse_macros
rm -f m4/libtool.m4
rm -f m4/lt*.m4
%build
export CFLAGS="%{optflags} -ffunction-sections"
export LDFLAGS="-Wl,-Bsymbolic-functions -ffunction-sections"
%ifarch alpha
export CFLAGS="-g -O0 -fno-strict-aliasing -ffunction-sections"
%endif
%ifarch %arm
BUILDTARGET="--build=%{_target_cpu}-suse-linux-gnueabi"
%else
BUILDTARGET="--build=%{_target_cpu}-suse-linux"
%endif
#cp -p /usr/share/gettext/config.rpath .
cp autogen.sh beecrypt
pushd beecrypt
./autogen.sh --disable-dependency-tracking --with-pic --without-python $BUILDTARGET
make %{?_smp_mflags}
popd
export PYTHON=python%{with_python}
autoreconf -fi
sed -i -e 's,{PYTHON_VERSION}mu,{PYTHON_VERSION}mu python${PYTHON_VERSION}m,' configure
./configure --disable-dependency-tracking --prefix=%{_prefix} --mandir=%{_mandir} --infodir=%{_infodir} \
--libdir=%{_libdir} --sysconfdir=/etc --localstatedir=/var --with-lua \
--with-vendor=suse \
--with-selinux --with-internal-beecrypt \
--with-acl --with-cap --enable-shared %{?with_python: --enable-python} $BUILDTARGET
rm po/de.gmo
make %{?_smp_mflags}
make convertdb1
%install
mkdir -p %{buildroot}/usr/lib
mkdir -p %{buildroot}/usr/share/locale
ln -s ../share/locale %{buildroot}/usr/lib/locale
%make_install
install -m 755 convertdb1 %{buildroot}/usr/lib/rpm
install -m 644 db3/db.h %{buildroot}/usr/include/rpm
# remove .la file and the static variant of libpopt
# have to remove the dependency from other .la files as well
for f in %{buildroot}/%{_libdir}/*.la; do
sed -i -e "s,/%_lib/libpopt.la,-lpopt,g" $f
done
mkdir -p %{buildroot}/etc/init.d
install -m 755 %{SOURCE8} %{buildroot}/etc/init.d
mkdir -p %{buildroot}/usr/sbin
ln -sf ../../etc/init.d/rpmconfigcheck %{buildroot}/usr/sbin/rcrpmconfigcheck
cp -a suse_macros %{buildroot}/usr/lib/rpm
mkdir -p %{buildroot}/usr/lib/rpm/suse
ln -s ../suse_macros %{buildroot}/usr/lib/rpm/suse/macros
for d in BUILD RPMS SOURCES SPECS SRPMS BUILDROOT ; do
mkdir -p %{buildroot}/usr/src/packages/$d
chmod 755 %{buildroot}/usr/src/packages/$d
done
for d in %{buildroot}/usr/lib/rpm/platform/*-linux/macros ; do
dd=${d%%-linux/macros}
dd=${dd##*/}
mkdir %{buildroot}/usr/src/packages/RPMS/$dd
chmod 755 %{buildroot}/usr/src/packages/RPMS/$dd
done
mkdir -p %{buildroot}/var/lib/rpm
gzip -9 %{buildroot}/%{_mandir}/man[18]/*.[18]
export RPM_BUILD_ROOT
%ifarch s390x
[ -f scripts/brp-%_arch-linux ] && sh scripts/brp-%_arch-linux
%endif
chmod 755 doc/manual
rm -rf doc/manual/Makefile*
rm -f %{buildroot}/usr/lib/rpmpopt
rm -rf %{buildroot}%{_mandir}/{fr,ja,ko,pl,ru,sk}
rm -f %{buildroot}%{_prefix}/share/locale/de/LC_MESSAGES/rpm.mo
mkdir -p %{buildroot}/var/adm/fillup-templates
install -c -m0644 %{SOURCE9} %{buildroot}/var/adm/fillup-templates/
rm -f %{buildroot}/usr/lib/rpm/cpanflute %{buildroot}/usr/lib/rpm/cpanflute2
install -m 755 %{SOURCE5} %{buildroot}/usr/lib/rpm
install -m 755 %{SOURCE6} %{buildroot}/usr/lib/rpm
install -m 755 scripts/find-supplements{,.ksyms} %{buildroot}/usr/lib/rpm
install -m 755 scripts/firmware.prov %{buildroot}/usr/lib/rpm
install -m 755 scripts/debuginfo.prov %{buildroot}/usr/lib/rpm
rm -f %{buildroot}/usr/lib/locale %{buildroot}/usr/lib/rpmrc
mkdir -p %{buildroot}/etc/rpm
chmod 755 %{buildroot}/etc/rpm
# remove some nonsense or non-working scripts
pushd %{buildroot}/usr/lib/rpm/
for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
do
rm -f $f
done
for i in /usr/share/automake-*/*; do
if test -f "$i" && test -f "${i##*/}"; then
rm -f "${i##*/}"
fi
done
popd
%ifarch aarch64
install -m 755 config.guess %{buildroot}/usr/lib/rpm
install -m 755 config.sub %{buildroot}/usr/lib/rpm
%endif
gzip -9 CHANGES
rm -rf %{buildroot}/%{_libdir}/python%{py_ver}
rm -f %{buildroot}%{_libdir}/*.la
rm -f %{buildroot}%{_libdir}/rpm-plugins/*.la
sh %{buildroot}/usr/lib/rpm/find-lang.sh %{buildroot} rpm
# On arm the kernel architecture is ignored. Not the best idea, but lets stay compatible with other distros
%ifarch armv7hl armv6hl
# rpm is using the host_cpu as default for the platform, but armv6/7hl is not known by the kernel.
# so we need to enforce the platform here.
echo -n "%{_target_cpu}-suse-linux-gnueabi" > %{buildroot}/etc/rpm/platform
%endif
%post
%{fillup_only -an services}
test -f var/lib/rpm/Packages || rpmdb --initdb
if test -s var/lib/rpm/packages.rpm ; then
echo "converting rpm-3 database to rpm-4 format..."
usr/lib/rpm/convertdb1 var/lib/rpm/packages.rpm
mv -f var/lib/rpm/packages.rpm var/lib/rpm/packages.rpm3
rm -f var/lib/rpm/conflictsindex.rpm var/lib/rpm/fileindex.rpm var/lib/rpm/groupindex.rpm var/lib/rpm/nameindex.rpm var/lib/rpm/providesindex.rpm var/lib/rpm/requiredby.rpm var/lib/rpm/triggerindex.rpm
fi
# delete no longer maintained databases
rm -f var/lib/rpm/Filemd5s var/lib/rpm/Filedigests var/lib/rpm/Requireversion var/lib/rpm/Provideversion
%files -f rpm.lang
%defattr(-,root,root)
%doc CHANGES.gz COPYING GROUPS
%doc doc/manual
%doc RPM-HOWTO RPM-Tips
/etc/rpm
/bin/rpm
/usr/bin/*
%exclude /usr/bin/rpmbuild
/etc/init.d/rpmconfigcheck
/usr/sbin/rcrpmconfigcheck
/usr/lib/rpm
%{_libdir}/rpm-plugins
%{_libdir}/librpm.so.*
%{_libdir}/librpmbuild.so.*
%{_libdir}/librpmio.so.*
%{_libdir}/librpmsign.so.*
%doc %{_mandir}/man[18]/*.[18]*
%dir /var/lib/rpm
%dir %attr(755,root,root) /usr/src/packages/BUILD
%dir %attr(755,root,root) /usr/src/packages/SPECS
%dir %attr(755,root,root) /usr/src/packages/SOURCES
%dir %attr(755,root,root) /usr/src/packages/SRPMS
%dir %attr(755,root,root) /usr/src/packages/RPMS
%dir %attr(755,root,root) /usr/src/packages/BUILDROOT
%dir %attr(755,root,root) /usr/src/packages/RPMS/*
/var/adm/fillup-templates/sysconfig.services-rpm
%files build
%defattr(-,root,root)
/usr/bin/rpmbuild
%files devel
%defattr(644,root,root,755)
/usr/include/rpm
%{_libdir}/librpm.so
%{_libdir}/librpmbuild.so
%{_libdir}/librpmio.so
%{_libdir}/librpmsign.so
%{_libdir}/pkgconfig/rpm.pc
%changelog
++++++ assumeexec.diff ++++++
--- tools/elfdeps.c.orig 2013-01-30 15:33:12.000000000 +0000
+++ tools/elfdeps.c 2013-07-12 12:21:47.000000000 +0000
@@ -15,6 +15,7 @@
int filter_private = 0;
int soname_only = 0;
int fake_soname = 1;
+int assume_exec = 0;
typedef struct elfInfo_s {
Elf *elf;
@@ -235,7 +236,7 @@ static int processFile(const char *fn, i
if (ehdr->e_type == ET_DYN || ehdr->e_type == ET_EXEC) {
ei->marker = mkmarker(ehdr);
ei->isDSO = (ehdr->e_type == ET_DYN);
- ei->isExec = (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
+ ei->isExec = assume_exec || (st.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH));
processSections(ei);
}
@@ -292,6 +293,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 },
+ { "assume-exec", 0, POPT_ARG_VAL, &assume_exec, -1, NULL, NULL },
POPT_AUTOHELP
POPT_TABLEEND
};
++++++ auto-config-update-aarch64.diff ++++++
Index: build/parseBuildInstallClean.c
===================================================================
--- build/parseBuildInstallClean.c.orig
+++ build/parseBuildInstallClean.c
@@ -46,7 +46,21 @@ int parseBuildInstallClean(rpmSpec spec,
} else if (rc < 0) {
goto exit;
}
-
+
+ if (parsePart == PART_BUILD) {
+ char* buf = strdup(
+ "ref=/usr/lib/rpm\n"
+ "for s in guess sub; do\n"
+ " for c in $(find -maxdepth 8 -name \"config.$s\"); do\n"
+ " grep -q config-patches@ $c || continue\n"
+ " grep -q aarch64 $c || install -m 755 $ref/config.$s $c\n"
+ " done\n"
+ "done\n"
+ );
+ appendLineStringBuf(*sbp, buf);
+ free(buf);
+ }
+
while (! (nextPart = isPart(spec->line))) {
appendStringBuf(*sbp, spec->line);
if ((rc = readLine(spec, STRIP_NOTHING)) > 0) {
++++++ autodeps.diff ++++++
--- ./autodeps/linux.prov.orig 2011-07-12 11:28:13.000000000 +0000
+++ ./autodeps/linux.prov 2011-07-18 16:47:39.000000000 +0000
@@ -2,60 +2,72 @@
# This script reads filenames from STDIN and outputs any relevant provides
# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
-filelist=`sed "s/['\"]/\\\&/g"`
-
-solist=$(echo $filelist | grep "\\.so" | grep -v "^/lib/ld.so" | \
- xargs file -L 2>/dev/null | grep "ELF.*shared object" | cut -d: -f1)
+solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
+ tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
+ cut -d: -f1))
pythonlist=
tcllist=
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
#
# --- Alpha does not mark 64bit dependencies
case `uname -m` in
- alpha*) mark64="" ;;
- *) mark64="()(64bit)" ;;
+ alpha*) mark64=false ;;
+ *) mark64=true ;;
esac
#
# --- Library sonames and weak symbol versions (from glibc).
-for f in $solist; do
- soname=$(objdump -p $f | awk '/SONAME/ {print $2}')
+for f in "${solist[@]}"; do
+ soname=$(objdump -p "$f" | awk '/SONAME/ {print $2}')
+ [ -n "$soname" -a -L "$f" ] && continue
+ [ -z "$soname" ] && soname="${f##*/}"
- lib64=`if file -L $f 2>/dev/null | \
- grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- if [ "$soname" != "" ]; then
- if [ ! -L $f ]; then
- echo $soname$lib64
- objdump -p $f | awk '
- BEGIN { START=0 ; }
- /Version definitions:/ { START=1; }
- /^[0-9]/ && (START==1) { print $4; }
- /^$/ { START=0; }
- ' | \
- grep -v $soname | \
- while read symbol ; do
- echo "$soname($symbol)`echo $lib64 | sed 's/()//'`"
- done
- fi
+ if $mark64 && file -L "$f" 2>/dev/null | grep "ELF 64-bit" >/dev/null; then
+ lib64="()(64bit)" slib64="(64bit)"
else
- echo ${f##*/}$lib64
+ lib64= slib64=
fi
+ echo "$soname$lib64"
+ objdump -p "$f" | awk '
+ BEGIN { START=0 ; }
+ /Version definitions:/ { START=1; }
+ /^[0-9]/ && (START==1) { print $4; }
+ /^$/ { START=0; }
+ ' | \
+ while read symbol ; do
+ echo "$soname($symbol)$slib64"
+ done
done | sort -u
#
# --- Perl modules.
[ -x /usr/lib/rpm/perl.prov ] &&
- echo $filelist | tr '[:blank:]' \\n | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
+ printf "%s\n" "${filelist[@]}" | grep '\.pm$' | /usr/lib/rpm/perl.prov | sort -u
#
# --- Python modules.
[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.prov | sort -u
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.prov | sort -u
#
# --- Tcl modules.
[ -x /usr/lib/rpm/tcl.prov -a -n "$tcllist" ] &&
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.prov | sort -u
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u
+
+#
+# --- Mono exes/dlls
+: ${MONO_PREFIX=/usr}
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-provides || echo "WARNING: MONO RPM PROVIDES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
+fi
+
+#
+# --- Kernel module exported symbols
+[ -x /usr/lib/rpm/find-provides.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
exit 0
--- ./autodeps/linux.req.orig 2011-07-15 09:32:41.000000000 +0000
+++ ./autodeps/linux.req 2011-07-18 16:51:24.000000000 +0000
@@ -18,20 +18,21 @@ fi
#
# --- Grab the file manifest and classify files.
-#filelist=`sed "s/['\"]/\\\&/g"`
-filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
-exelist=`echo $filelist | xargs -r file | \
+#filelist=`sed "s/[]['\"*?{}]/\\\\\&/g"`
+filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+exelist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
grep -Ev ":.* (commands|script)[, ]" | \
- grep ":.*executable" | cut -d: -f1`
-scriptlist=`echo $filelist | xargs -r file | \
- grep -E ":.* (commands|script)[, ]" | cut -d: -f1`
-liblist=`echo $filelist | xargs -r file | \
- grep ":.*shared object" | cut -d : -f1`
+ grep ":.*executable" | cut -d: -f1))
+scriptlist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ grep -E ":.* (commands|script)[, ]" | cut -d: -f1))
+liblist=($(printf "%s\0" "${filelist[@]}" | xargs -0 -r file | \
+ grep ":.*shared object" | cut -d : -f1))
-interplist=
-perllist=
-pythonlist=
-tcllist=
+interplist=()
+perllist=()
+pythonlist=()
+tcllist=()
+monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
#
# --- Alpha does not mark 64bit dependencies
@@ -43,12 +44,12 @@ esac
if [ "$needed" -eq 0 ]; then
#
# --- Executable dependency sonames.
- for f in $exelist; do
- [ -r $f -a -x $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+ for f in "${exelist[@]}"; do
+ [ -r "$f" -a -x "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
+ ldd "$f" | awk '/=>/ {
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -57,12 +58,12 @@ if [ "$needed" -eq 0 ]; then
#
# --- Library dependency sonames.
- for f in $liblist; do
- [ -r $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+ for f in "${liblist[@]}"; do
+ [ -r "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- ldd $f | awk '/=>/ {
- if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /libredhat-kernel.so/) {
+ ldd "$f" | awk '/=>/ {
+ if ($1 !~ /libNoVersion.so/ && $1 !~ /4[um]lib.so/ && $1 !~ /linux-gate.so/) {
gsub(/'\''"/,"\\&",$1);
printf "%s'$lib64'\n", $1
}
@@ -72,30 +73,30 @@ fi
#
# --- Script interpreters.
-for f in $scriptlist; do
- [ -r $f -a -x $f ] || continue
- interp=`head -n 1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1`
- interplist="$interplist $interp"
+for f in "${scriptlist[@]}"; do
+ [ -r "$f" -a -x "$f" ] || continue
+ interp=`head -n 1 "$f" | sed -ne 's/^\#\![ ]*//p' | cut -d" " -f1`
+ interplist=("${interplist[@]}" "$interp")
case $interp in
- */perl) perllist="$perllist $f" ;;
+ */perl) perllist=("${perllist[@]}" "$f") ;;
esac
done
-[ -n "$interplist" ] && { echo "$interplist" | tr '[:blank:]' \\n | sort -u ; }
+[ -n "$interplist" ] && { printf "%s\n" "${interplist[@]}" | sort -u ; }
#
# --- Add perl module files to perllist.
-for f in $filelist; do
- [ -r $f -a "${f%.pm}" != "${f}" ] && perllist="$perllist $f"
+for f in "${filelist[@]}"; do
+ [ -r "$f" -a "${f%.pm}" != "${f}" ] && perllist=("${perllist[@]}" "$f")
done
#
# --- Weak symbol versions (from glibc).
[ -n "$mark64" ] && mark64="(64bit)"
-for f in $liblist $exelist ; do
- [ -r $f ] || continue
- lib64=`if file -L $f 2>/dev/null | \
+for f in "${liblist[@]}" "${exelist[@]}" ; do
+ [ -r "$f" ] || continue
+ lib64=`if file -L "$f" 2>/dev/null | \
grep "ELF 64-bit" >/dev/null; then echo "$mark64"; fi`
- objdump -p $f | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
+ objdump -p "$f" | awk 'BEGIN { START=0; LIBNAME=""; needed='$needed'; }
/^$/ { START=0; }
/^Dynamic Section:$/ { START=1; }
(START==1) && /NEEDED/ {
@@ -112,7 +113,7 @@ for f in $liblist $exelist ; do
sub(/:/, "", $3);
LIBNAME=$3;
}
- (START==2) && (LIBNAME!="") && ($4!="") && (($4~/^GLIBC_*/) || ($4~/^GCC_*/)) {
+ (START==2) && (LIBNAME!="") && ($4!="") {
print LIBNAME "(" $4 ")'$lib64'";
}
'
@@ -120,17 +121,29 @@ done | sort -u
#
# --- Perl modules.
-[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
- echo $perllist | tr '[:blank:]' \\n | /usr/lib/rpm/perl.req | sort -u
+#[ -x /usr/lib/rpm/perl.req -a -n "$perllist" ] && \
+# printf "%s\n" "${perllist[@]}" | /usr/lib/rpm/perl.req | sort -u
#
# --- Python modules.
[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
- echo $pythonlist | tr '[:blank:]' \\n | /usr/lib/rpm/python.req | sort -u
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.req | sort -u
#
# --- Tcl modules.
[ -x /usr/lib/rpm/tcl.req -a -n "$tcllist" ] && \
- echo $tcllist | tr '[:blank:]' \\n | /usr/lib/rpm/tcl.req | sort -u
+ printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.req | sort -u
+
+#
+# --- Mono exes/dlls
+: ${MONO_PREFIX=/usr}
+if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
+ printf "%s\n" "${monolist[@]}" | MONO_PATH=$MONO_PREFIX/lib${MONO_PATH:+:$MONO_PATH} prefix=$MONO_PREFIX $MONO_PREFIX/bin/mono-find-requires || echo "WARNING: MONO RPM REQUIRES WERE NOT GENERATED FOR THIS BUILD!!" 1>&2
+fi
+
+#
+# --- Kernel module imported symbols
+[ -x ${0%/*}/find-requires.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
exit 0
++++++ baselibs.conf ++++++
rpm
arch ppc package rpm-devel
arch sparcv9 package rpm-devel
++++++ beecrypt-4.1.2.diff ++++++
--- beecrypt-4.1.2/Makefile.am.orig 2004-12-22 07:06:31.000000000 +0000
+++ beecrypt-4.1.2/Makefile.am 2006-11-24 14:08:27.000000000 +0000
@@ -49,7 +49,7 @@ libaltdir=$(prefix)/lib@LIBALT@
libalt_LTLIBRARIES = libbeecrypt.la
-libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c rsa.c rsakp.c rsapk.c sha1.c sha256.c sha384.c sha512.c sha_k.c timestamp.c cppglue.cxx
+libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhaes.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha256.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c rsa.c rsakp.c rsapk.c sha1.c sha256.c sha384.c sha512.c sha_k.c timestamp.c
libbeecrypt_la_DEPENDENCIES = $(BEECRYPT_OBJECTS)
libbeecrypt_la_LIBADD = aesopt.lo blowfishopt.lo mpopt.lo sha1opt.lo
libbeecrypt_la_LDFLAGS = -no-undefined -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_LT_REVISION):$(LIBBEECRYPT_LT_AGE)
@@ -62,5 +62,11 @@ EXTRA_DIST = BENCHMARKS BUGS CONTRIBUTOR
DISTCLEANFILES = mpopt.s aesopt.s blowfishopt.s sha1opt.s
+BUILT_SOURCES = listobjs
+
+.PHONY: listobjs
+listobjs:
+ @echo $(libbeecrypt_la_OBJECTS) $(libbeecrypt_la_LIBADD) > $@
+
bench:
(cd tests && $(MAKE) $(AM_MAKEFLAGS) bench)
--- beecrypt-4.1.2/base64.c.orig 2004-12-19 20:21:04.000000000 +0000
+++ beecrypt-4.1.2/base64.c 2006-11-24 14:08:27.000000000 +0000
@@ -253,7 +253,6 @@ char* b64encode(const void* data, size_t
unsigned c;
if (s == NULL) return NULL;
- if (*s == '\0') return calloc(1, sizeof(*t));
if (ns == 0) ns = strlen((const char*) s);
nt = ((ns + 2) / 3) * 4;
--- beecrypt-4.1.2/c++/io/DataOutputStream.cxx.orig 2004-11-04 12:38:15.000000000 +0000
+++ beecrypt-4.1.2/c++/io/DataOutputStream.cxx 2006-11-24 14:09:35.000000000 +0000
@@ -126,8 +126,8 @@ void DataOutputStream::writeLong(javalon
void DataOutputStream::writeChar(javaint v) throw (IOException)
{
_lock.lock();
- out.write((v >> 8) && 0xff);
- out.write((v ) && 0xff);
+ out.write((v >> 8) & 0xff);
+ out.write((v ) & 0xff);
written += 2;
_lock.unlock();
}
++++++ beedigest.diff ++++++
--- rpmio/digest.h.orig 2013-08-27 14:26:38.260872601 +0000
+++ rpmio/digest.h 2013-08-27 14:26:47.404872585 +0000
@@ -5,8 +5,7 @@
typedef struct pgpDigAlg_s * pgpDigAlg;
-typedef int (*setmpifunc)(pgpDigAlg digp,
- int num, const uint8_t *p, const uint8_t *pend);
+typedef int (*setmpifunc)(pgpDigAlg digp, int num, const uint8_t *p);
typedef int (*verifyfunc)(pgpDigAlg pgpkey, pgpDigAlg pgpsig,
uint8_t *hash, size_t hashlen, int hash_algo);
typedef void (*freefunc)(pgpDigAlg digp);
--- rpmio/digest_beecrypt.c.orig 2013-08-27 14:26:38.260872601 +0000
+++ rpmio/digest_beecrypt.c 2013-08-29 15:45:42.754558355 +0000
@@ -198,66 +198,6 @@ int rpmDigestFinal(DIGEST_CTX ctx, void
return 0;
}
-/**************************** helpers ************************************/
-
-static inline char * pgpHexCvt(char *t, const byte *s, int nbytes)
-{
- static char hex[] = "0123456789abcdef";
- while (nbytes-- > 0) {
- unsigned int i;
- i = *s++;
- *t++ = hex[ (i >> 4) & 0xf ];
- *t++ = hex[ (i ) & 0xf ];
- }
- *t = '\0';
- return t;
-}
-
-static const char * pgpMpiHex(const byte *p, const byte *pend)
-{
- static char prbuf[2048];
- char *t = prbuf;
- int nbytes = pgpMpiLen(p) - 2;
- if (nbytes > 1024 || nbytes > pend - (p + 2))
- return NULL;
- t = pgpHexCvt(t, p+2, nbytes);
- return prbuf;
-}
-
-static int pgpHexSet(int lbits, mpnumber * mpn, const byte * p, const byte * pend)
-{
- unsigned int mbits = pgpMpiBits(p);
- unsigned int nbits;
- unsigned int nbytes;
- char *t;
- unsigned int ix;
-
- nbits = (lbits > mbits ? lbits : mbits);
- nbytes = ((nbits + 7) >> 3);
- t = xmalloc(2*nbytes+1);
- ix = 2 * ((nbits - mbits) >> 3);
-
- if (ix > 0) memset(t, (int)'0', ix);
- strcpy(t+ix, pgpMpiHex(p, pend));
- (void) mpnsethex(mpn, t);
- t = _free(t);
- return 0;
-}
-
-static void pgpFreeSigRSADSA(pgpDigAlg sa)
-{
- if (sa->data)
- free(sa->data);
- sa->data = 0;
-}
-
-static void pgpFreeKeyRSADSA(pgpDigAlg sa)
-{
- if (sa->data)
- free(sa->data);
- sa->data = 0;
-}
-
/****************************** RSA **************************************/
@@ -267,45 +207,73 @@ struct pgpDigSigRSA_s {
struct pgpDigKeyRSA_s {
rsapk rsa_pk;
+ int nbytes;
};
-static int pgpSetSigMpiRSA(pgpDigAlg pgpsig, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetSigMpiRSA(pgpDigAlg pgpsig, int num, const uint8_t *p)
{
struct pgpDigSigRSA_s *sig = pgpsig->data;
+ int mlen = pgpMpiLen(p) - 2;
int rc = 1;
+ if (!sig)
+ sig = pgpsig->data = xcalloc(1, sizeof(*sig));
+
switch (num) {
case 0:
- sig = pgpsig->data = xcalloc(1, sizeof(*sig));
- (void) mpnsethex(&sig->c, pgpMpiHex(p, pend));
- rc = 0;
+ if (!mpnsetbin(&sig->c, p + 2, mlen))
+ rc = 0;
break;
}
return rc;
}
-static int pgpSetKeyMpiRSA(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetKeyMpiRSA(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
struct pgpDigKeyRSA_s *key = pgpkey->data;
+ int mlen = pgpMpiLen(p) - 2;
int rc = 1;
if (!key)
key = pgpkey->data = xcalloc(1, sizeof(*key));
+
switch (num) {
case 0:
- (void) mpbsethex(&key->rsa_pk.n, pgpMpiHex(p, pend));
- rc = 0;
+ key->nbytes = mlen;
+ if (!mpbsetbin(&key->rsa_pk.n, p + 2, mlen))
+ rc = 0;
break;
case 1:
- (void) mpnsethex(&key->rsa_pk.e, pgpMpiHex(p, pend));
- rc = 0;
+ if (!mpnsetbin(&key->rsa_pk.e, p + 2, mlen))
+ rc = 0;
break;
}
return rc;
}
+static int pkcs1pad(mpnumber *rsahm, int nbytes, const char *prefix, uint8_t *hash, size_t hashlen)
+{
+ int datalen = strlen(prefix) / 2 + hashlen;
+ byte *buf, *bp;
+ int rc = 1;
+
+ if (nbytes < 4 + datalen)
+ return 1;
+ buf = xmalloc(nbytes);
+ memset(buf, 0xff, nbytes);
+ buf[0] = 0x00;
+ buf[1] = 0x01;
+ bp = buf + nbytes - datalen;
+ bp[-1] = 0;
+ for (; *prefix; prefix += 2)
+ *bp++ = (rnibble(prefix[0]) << 4) | rnibble(prefix[1]);
+ memcpy(bp, hash, hashlen);
+ if (!mpnsetbin(rsahm, buf, nbytes))
+ rc = 0;
+ buf = _free(buf);
+ return rc;
+}
+
static int pgpVerifySigRSA(pgpDigAlg pgpkey, pgpDigAlg pgpsig, uint8_t *hash, size_t hashlen, int hash_algo)
{
struct pgpDigKeyRSA_s *key = pgpkey->data;
@@ -340,28 +308,10 @@ static int pgpVerifySigRSA(pgpDigAlg pgp
return 1;
}
- /* Generate RSA modulus parameter. */
- { unsigned int nbits = MP_WORDS_TO_BITS(sig->c.size);
- unsigned int nb = (nbits + 7) >> 3;
- byte *buf, *bp;
+ memset(&rsahm, 0, sizeof(rsahm));
+ if (pkcs1pad(&rsahm, key->nbytes, prefix, hash, hashlen) != 0)
+ return 1;
- if (nb < 3)
- return 1;
- buf = xmalloc(nb);
- memset(buf, 0xff, nb);
- buf[0] = 0x00;
- buf[1] = 0x01;
- bp = buf + nb - strlen(prefix)/2 - hashlen - 1;
- if (bp < buf)
- return 1;
- *bp++ = 0;
- for (; *prefix; prefix += 2)
- *bp++ = (rnibble(prefix[0]) << 4) | rnibble(prefix[1]);
- memcpy(bp, hash, hashlen);
- mpnzero(&rsahm);
- (void) mpnsetbin(&rsahm, buf, nb);
- buf = _free(buf);
- }
#if HAVE_BEECRYPT_API_H
rc = rsavrfy(&key->rsa_pk.n, &key->rsa_pk.e, &sig->c, &rsahm) == 1 ? 0 : 1;
#else
@@ -371,6 +321,25 @@ static int pgpVerifySigRSA(pgpDigAlg pgp
return rc;
}
+static void pgpFreeSigRSA(pgpDigAlg pgpsig)
+{
+ struct pgpDigSigRSA_s *sig = pgpsig->data;
+ if (sig) {
+ mpnfree(&sig->c);
+ pgpsig->data = _free(sig);
+ }
+}
+
+static void pgpFreeKeyRSA(pgpDigAlg pgpkey)
+{
+ struct pgpDigKeyRSA_s *key = pgpkey->data;
+ if (key) {
+ mpbfree(&key->rsa_pk.n);
+ mpnfree(&key->rsa_pk.e);
+ pgpkey->data = _free(key);
+ }
+}
+
/****************************** DSA **************************************/
@@ -384,30 +353,35 @@ struct pgpDigKeyDSA_s {
mpbarrett q;
mpnumber g;
mpnumber y;
+ int qbytes;
};
-static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num, const uint8_t *p)
{
struct pgpDigSigDSA_s *sig = pgpsig->data;
+ int mlen = pgpMpiLen(p) - 2;
int rc = 1;
+ if (!sig)
+ sig = pgpsig->data = xcalloc(1, sizeof(*sig));
+
switch (num) {
case 0:
- sig = pgpsig->data = xcalloc(1, sizeof(*sig));
- rc = pgpHexSet(160, &sig->r, p, pend);
+ if (!mpnsetbin(&sig->r, p + 2, mlen))
+ rc = 0;
break;
case 1:
- rc = pgpHexSet(160, &sig->s, p, pend);
+ if (!mpnsetbin(&sig->s, p + 2, mlen))
+ rc = 0;
break;
}
return rc;
}
-static int pgpSetKeyMpiDSA(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetKeyMpiDSA(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
struct pgpDigKeyDSA_s *key = pgpkey->data;
+ int mlen = pgpMpiLen(p) - 2;
int rc = 1;
if (!key)
@@ -415,20 +389,21 @@ static int pgpSetKeyMpiDSA(pgpDigAlg pgp
switch (num) {
case 0:
- mpbsethex(&key->p, pgpMpiHex(p, pend));
- rc = 0;
+ if (!mpbsetbin(&key->p, p + 2, mlen))
+ rc = 0;
break;
case 1:
- mpbsethex(&key->q, pgpMpiHex(p, pend));
- rc = 0;
+ key->qbytes = mlen;
+ if (!mpbsetbin(&key->q, p + 2, mlen))
+ rc = 0;
break;
case 2:
- mpnsethex(&key->g, pgpMpiHex(p, pend));
- rc = 0;
+ if (!mpnsetbin(&key->g, p + 2, mlen))
+ rc = 0;
break;
case 3:
- mpnsethex(&key->y, pgpMpiHex(p, pend));
- rc = 0;
+ if (!mpnsetbin(&key->y, p + 2, mlen))
+ rc = 0;
break;
}
return rc;
@@ -441,17 +416,41 @@ static int pgpVerifySigDSA(pgpDigAlg pgp
mpnumber hm;
int rc = 1;
- if (sig && key) {
+ if (sig && key && hashlen >= key->qbytes) {
mpnzero(&hm);
- mpnsetbin(&hm, hash, hashlen);
+ mpnsetbin(&hm, hash, key->qbytes);
rc = dsavrfy(&key->p, &key->q, &key->g, &hm, &key->y, &sig->r, &sig->s) == 1 ? 0 : 1;
mpnfree(&hm);
}
return rc;
}
-static int pgpSetMpiNULL(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static void pgpFreeSigDSA(pgpDigAlg pgpsig)
+{
+ struct pgpDigSigDSA_s *sig = pgpsig->data;
+ if (sig) {
+ mpnfree(&sig->r);
+ mpnfree(&sig->s);
+ pgpsig->data = _free(sig);
+ }
+}
+
+static void pgpFreeKeyDSA(pgpDigAlg pgpkey)
+{
+ struct pgpDigKeyDSA_s *key = pgpkey->data;
+ if (key) {
+ mpbfree(&key->p);
+ mpbfree(&key->q);
+ mpnfree(&key->g);
+ mpnfree(&key->y);
+ pgpkey->data = _free(key);
+ }
+}
+
+
+/****************************** NULL **************************************/
+
+static int pgpSetMpiNULL(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
return 1;
}
@@ -469,12 +468,12 @@ pgpDigAlg pgpPubkeyNew(int algo)
switch (algo) {
case PGPPUBKEYALGO_RSA:
ka->setmpi = pgpSetKeyMpiRSA;
- ka->free = pgpFreeKeyRSADSA;
+ ka->free = pgpFreeKeyRSA;
ka->mpis = 2;
break;
case PGPPUBKEYALGO_DSA:
ka->setmpi = pgpSetKeyMpiDSA;
- ka->free = pgpFreeKeyRSADSA;
+ ka->free = pgpFreeKeyDSA;
ka->mpis = 4;
break;
default:
@@ -495,13 +494,13 @@ pgpDigAlg pgpSignatureNew(int algo)
switch (algo) {
case PGPPUBKEYALGO_RSA:
sa->setmpi = pgpSetSigMpiRSA;
- sa->free = pgpFreeSigRSADSA;
+ sa->free = pgpFreeSigRSA;
sa->verify = pgpVerifySigRSA;
sa->mpis = 1;
break;
case PGPPUBKEYALGO_DSA:
sa->setmpi = pgpSetSigMpiDSA;
- sa->free = pgpFreeSigRSADSA;
+ sa->free = pgpFreeSigDSA;
sa->verify = pgpVerifySigDSA;
sa->mpis = 2;
break;
--- rpmio/digest_nss.c.orig 2013-08-27 14:26:38.260872601 +0000
+++ rpmio/digest_nss.c 2013-08-27 14:26:47.405872585 +0000
@@ -224,8 +224,7 @@ static SECOidTag getHashAlg(unsigned int
return SEC_OID_UNKNOWN;
}
-static int pgpMpiSet(unsigned int lbits, uint8_t *dest,
- const uint8_t * p, const uint8_t * pend)
+static int pgpMpiSet(unsigned int lbits, uint8_t *dest, const uint8_t * p)
{
unsigned int mbits = pgpMpiBits(p);
unsigned int nbits;
@@ -233,9 +232,6 @@ static int pgpMpiSet(unsigned int lbits,
uint8_t *t = dest;
unsigned int ix;
- if ((p + ((mbits+7) >> 3)) > pend)
- return 1;
-
if (mbits > lbits)
return 1;
@@ -250,14 +246,10 @@ static int pgpMpiSet(unsigned int lbits,
return 0;
}
-static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item,
- const uint8_t *p, const uint8_t *pend)
+static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item, const uint8_t *p)
{
size_t nbytes = pgpMpiLen(p)-2;
- if (p + nbytes + 2 > pend)
- return NULL;
-
if (item == NULL) {
if ((item=SECITEM_AllocItem(arena, item, nbytes)) == NULL)
return item;
@@ -313,8 +305,7 @@ static SECKEYPublicKey *pgpNewPublicKey(
#define DSA1_Q_BITS DSA_Q_BITS
#endif
-static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetSigMpiDSA(pgpDigAlg pgpsig, int num, const uint8_t *p)
{
SECItem *sig = pgpsig->data;
int lbits = DSA1_Q_BITS;
@@ -325,11 +316,11 @@ static int pgpSetSigMpiDSA(pgpDigAlg pgp
sig = pgpsig->data = SECITEM_AllocItem(NULL, NULL, DSA1_SIGNATURE_LEN);
if (sig) {
memset(sig->data, 0, DSA1_SIGNATURE_LEN);
- rc = pgpMpiSet(lbits, sig->data, p, pend);
+ rc = pgpMpiSet(lbits, sig->data, p);
}
break;
case 1:
- if (sig && pgpMpiSet(lbits, sig->data+DSA1_SUBPRIME_LEN, p, pend) == 0) {
+ if (sig && pgpMpiSet(lbits, sig->data+DSA1_SUBPRIME_LEN, p) == 0) {
SECItem *signew = SECITEM_AllocItem(NULL, NULL, 0);
if (signew && DSAU_EncodeDerSig(signew, sig) == SECSuccess) {
SECITEM_FreeItem(sig, PR_TRUE);
@@ -343,8 +334,7 @@ static int pgpSetSigMpiDSA(pgpDigAlg pgp
return rc;
}
-static int pgpSetKeyMpiDSA(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetKeyMpiDSA(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
SECItem *mpi = NULL;
SECKEYPublicKey *key = pgpkey->data;
@@ -355,16 +345,16 @@ static int pgpSetKeyMpiDSA(pgpDigAlg pgp
if (key) {
switch (num) {
case 0:
- mpi = pgpMpiItem(key->arena, &key->u.dsa.params.prime, p, pend);
+ mpi = pgpMpiItem(key->arena, &key->u.dsa.params.prime, p);
break;
case 1:
- mpi = pgpMpiItem(key->arena, &key->u.dsa.params.subPrime, p, pend);
+ mpi = pgpMpiItem(key->arena, &key->u.dsa.params.subPrime, p);
break;
case 2:
- mpi = pgpMpiItem(key->arena, &key->u.dsa.params.base, p, pend);
+ mpi = pgpMpiItem(key->arena, &key->u.dsa.params.base, p);
break;
case 3:
- mpi = pgpMpiItem(key->arena, &key->u.dsa.publicValue, p, pend);
+ mpi = pgpMpiItem(key->arena, &key->u.dsa.publicValue, p);
break;
}
}
@@ -389,21 +379,19 @@ static int pgpVerifySigDSA(pgpDigAlg pgp
return (rc != SECSuccess);
}
-static int pgpSetSigMpiRSA(pgpDigAlg pgpsig, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetSigMpiRSA(pgpDigAlg pgpsig, int num, const uint8_t *p)
{
SECItem *sigitem = NULL;
if (num == 0) {
- sigitem = pgpMpiItem(NULL, pgpsig->data, p, pend);
+ sigitem = pgpMpiItem(NULL, pgpsig->data, p);
if (sigitem)
pgpsig->data = sigitem;
}
return (sigitem == NULL);
}
-static int pgpSetKeyMpiRSA(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetKeyMpiRSA(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
SECItem *kitem = NULL;
SECKEYPublicKey *key = pgpkey->data;
@@ -414,10 +402,10 @@ static int pgpSetKeyMpiRSA(pgpDigAlg pgp
if (key) {
switch (num) {
case 0:
- kitem = pgpMpiItem(key->arena, &key->u.rsa.modulus, p, pend);
+ kitem = pgpMpiItem(key->arena, &key->u.rsa.modulus, p);
break;
case 1:
- kitem = pgpMpiItem(key->arena, &key->u.rsa.publicExponent, p, pend);
+ kitem = pgpMpiItem(key->arena, &key->u.rsa.publicExponent, p);
break;
}
}
@@ -472,8 +460,7 @@ static void pgpFreeKeyRSADSA(pgpDigAlg k
ka->data = NULL;
}
-static int pgpSetMpiNULL(pgpDigAlg pgpkey, int num,
- const uint8_t *p, const uint8_t *pend)
+static int pgpSetMpiNULL(pgpDigAlg pgpkey, int num, const uint8_t *p)
{
return 1;
}
--- rpmio/rpmpgp.c.orig 2013-08-27 14:26:38.260872601 +0000
+++ rpmio/rpmpgp.c 2013-08-29 15:48:33.394558053 +0000
@@ -499,11 +499,15 @@ static int pgpPrtSigParams(pgpTag tag, u
int i;
pgpDigAlg sigalg = pgpSignatureNew(pubkey_algo);
- for (i = 0; p < pend && i < sigalg->mpis; i++, p += pgpMpiLen(p)) {
+ for (i = 0; i < sigalg->mpis && p + 2 <= pend; i++) {
+ int mpil = pgpMpiLen(p);
+ if (p + mpil > pend)
+ break;
if (sigtype == PGPSIGTYPE_BINARY || sigtype == PGPSIGTYPE_TEXT) {
- if (sigalg->setmpi(sigalg, i, p, pend))
+ if (sigalg->setmpi(sigalg, i, p))
break;
}
+ p += mpil;
}
/* Does the size and number of MPI's match our expectations? */
@@ -650,9 +654,13 @@ static int pgpPrtPubkeyParams(uint8_t pu
int i;
pgpDigAlg keyalg = pgpPubkeyNew(pubkey_algo);
- for (i = 0; p < pend && i < keyalg->mpis; i++, p += pgpMpiLen(p)) {
- if (keyalg->setmpi(keyalg, i, p, pend))
+ for (i = 0; i < keyalg->mpis && p + 2 <= pend; i++) {
+ int mpil = pgpMpiLen(p);
+ if (p + mpil > pend)
+ break;
+ if (keyalg->setmpi(keyalg, i, p))
break;
+ p += mpil;
}
/* Does the size and number of MPI's match our expectations? */
++++++ brp-compress-no-img.patch ++++++
--- scripts/brp-compress 2013-09-02 19:00:09.000000000 +0200
+++ scripts/brp-compress 2013-09-02 19:03:12.000000000 +0200
@@ -47,6 +47,7 @@ do
find $d -type f ! -name dir | while read f
do
[ -f "$f" ] || continue
+ case $(file "$f") in *"image data"*) continue;; esac
case "$f" in
*.gz|*.Z) gunzip "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
++++++ brp.diff ++++++
--- ./scripts/Makefile.am.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./scripts/Makefile.am 2012-06-01 11:39:13.000000000 +0000
@@ -25,6 +25,7 @@ EXTRA_DIST = \
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
brp-strip brp-strip-comment-note brp-python-hardlink \
+ brp-suse \
brp-strip-shared brp-strip-static-archive \
check-files check-prereqs \
check-buildroot check-rpaths check-rpaths-worker \
--- ./scripts/brp-strip-comment-note.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./scripts/brp-strip-comment-note 2012-06-01 11:39:13.000000000 +0000
@@ -16,6 +16,8 @@ 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" | \
+ grep -v ' shared object,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
note="-R .note"
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
--- ./scripts/brp-strip.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./scripts/brp-strip 2012-06-01 11:39:13.000000000 +0000
@@ -15,6 +15,7 @@ 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,' | \
+ grep -v '/lib/modules/' | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
$STRIP -g "$f" || :
done
--- ./scripts/brp-suse.orig 2012-06-01 11:39:13.000000000 +0000
+++ ./scripts/brp-suse 2012-06-01 11:39:13.000000000 +0000
@@ -0,0 +1,13 @@
+#! /bin/sh
+
+# If using normal root, avoid changing anything:
+if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
+ exit 0
+fi
+
+for script in /usr/lib/rpm/brp-suse.d/brp*; do
+ if test -x "$script"; then
+ echo "calling $script"
+ $script || exit 1
+ fi
+done
++++++ brpcompress.diff ++++++
--- ./scripts/brp-compress.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/brp-compress 2011-05-11 14:44:21.000000000 +0000
@@ -5,51 +5,78 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD
exit 0
fi
+LC_ALL=
+LANG=
+LC_TIME=POSIX
+
cd "$RPM_BUILD_ROOT"
# Compress man pages
COMPRESS="gzip -9 -n"
COMPRESS_EXT=.gz
+function check_for_hard_link
+{
+ dir=$1
+ b=$2
+
+ inode=`ls -i $b | awk '{ print $1 }'`
+ others=`find $dir -type f -inum $inode`
+ for afile in $others ; do
+ [ "$afile" != "$b" ] && rm -f "$afile"
+ done
+
+ case $b in
+ *.Z|*.gz) gunzip $b ;;
+ *.bz2) bunzip2 $b ;;
+ *.xz|*.lzma) unxz $b ;;
+ esac
+
+ type=${b##*.}
+ for afile in $others ; do
+ [ "${afile%.$type}" != "${b%.$type}" ] && ln ${b%.$type} ${afile%.$type}
+ done
+}
+
for d in ./usr/man/man* ./usr/man/*/man* ./usr/info \
./usr/share/man/man* ./usr/share/man/*/man* ./usr/share/info \
./usr/kerberos/man ./usr/X11R6/man/man* ./usr/lib/perl5/man/man* \
./usr/share/doc/*/man/man* ./usr/lib/*/man/man*
do
[ -d $d ] || continue
- for f in `find $d -type f ! -name dir`
+ find $d -type f ! -name dir | while read f
do
[ -f "$f" ] || continue
case "$f" in
- *.gz|*.Z) gunzip -f $f; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
- *.bz2) bunzip2 -f $f; b=`echo $f | sed -e 's/\.bz2$//'`;;
- *.xz|*.lzma) unxz -f $f; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
- *) b=$f;;
+ *.gz|*.Z) gunzip "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(gz\|Z\)$//'`;;
+ *.bz2) bunzip2 "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.bz2$//'`;;
+ *.xz|*.lzma) unxz "$f" || check_for_hard_link $d "$f"; b=`echo $f | sed -e 's/\.\(xz\|lzma\)$//'`;;
+ *) b="$f";;
esac
- $COMPRESS $b /dev/null || {
+ $COMPRESS "$b" /dev/null || {
inode=`ls -i $b | awk '{ print $1 }'`
others=`find $d -type f -inum $inode`
if [ -n "$others" ]; then
for afile in $others ; do
- [ "$afile" != "$b" ] && rm -f $afile
+ [ "$afile" != "$b" ] && rm -f "$afile"
done
- $COMPRESS -f $b
+ $COMPRESS -f "$b"
for afile in $others ; do
- [ "$afile" != "$b" ] && ln $b$COMPRESS_EXT $afile$COMPRESS_EXT
+ [ "$afile" != "$b" ] && ln "$b$COMPRESS_EXT" "$afile$COMPRESS_EXT"
done
else
- $COMPRESS -f $b
+ $COMPRESS -f "$b"
fi
}
done
- for f in `find $d -type l`
+ find $d -type l | while read f
do
- l=`ls -l $f | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
- rm -f $f
- b=`echo $f | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`
- ln -sf $l$COMPRESS_EXT $b$COMPRESS_EXT
+ l="`ls -l "$f" | sed -e 's/.* -> //' -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ rm -f "$f"
+ b="`echo "$f" | sed -e 's/\.\(gz\|Z\|bz2\|xz\|lzma\)$//'`"
+ ln -sf "$l$COMPRESS_EXT" "$b$COMPRESS_EXT"
done
done
++++++ build.diff ++++++
--- db3/configure
+++ db3/configure
@@ -10,9 +10,9 @@
# XXX edit CFLAGS= ... out of invocation args ???
ARGS="`echo $* | sed -e 's% [^ ]*CFLAGS=[^ ]*%%' -e 's% -[^-][^ ]*%%g' -e 's% --param=[^ ]*%%g' -e 's%--cache-file=.*$%%'`"
-CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure $ARGS \
+CC="$CC" CFLAGS="$CFLAGS" $db_dist/configure \
--enable-shared --enable-static \
- --with-uniquename=_rpmdb --srcdir=$db_dist
+ --with-uniquename=_rpmdb --srcdir=$db_dist $ARGS
mv Makefile Makefile.orig
cat Makefile.orig | sed -e '/^install[:-]/c\
--- installplatform
+++ installplatform
@@ -118,6 +118,11 @@
PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
[ -d $PPD ] || mkdir -p $PPD
+ if [ "$VENDOR" = suse ] ; then
+ # suse doesn't do colors
+ CANONCOLOR=0
+ fi
+
cat $PLATFORM \
| sed -e "s,@RPMRC_OPTFLAGS@,$RPMRC_OPTFLAGS," \
-e "s,@RPMCANONARCH@,$CANONARCH,g" \
++++++ buildidprov.diff ++++++
From: Jan Blunck
Subject: Let debuginfo packages provide the build-id
This patch lets debuginfo packages provide build-id like follows:
debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517
Users can therefore ask zypper to install the correct debuginfo package with:
zypper install -C "debuginfo(build-id) = c63cb23876c5fa85f36beaff58f8557e1bf22517"
--- ./autodeps/linux.prov.orig 2011-05-11 15:58:28.000000000 +0000
+++ ./autodeps/linux.prov 2011-05-11 15:59:31.000000000 +0000
@@ -5,6 +5,9 @@
IFS=$'\n'
filelist=($(cat))
+debuginfolist=($(printf "%s\n" "${filelist[@]}" | grep "/usr/lib/debug/"))
+filelist=($(printf "%s\n" "${filelist[@]}" | grep -v "/usr/lib/debug/"))
+
solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
cut -d: -f1))
@@ -71,6 +74,11 @@ done | sort -u
printf "%s\n" "${firmwarelist[@]}" | /usr/lib/rpm/firmware.prov | sort -u
#
+# --- debuginfo files
+[ -x /usr/lib/rpm/debuginfo.prov -a -n "$debuginfolist" ] &&
+ printf "%s\n" "${debuginfolist[@]}" | /usr/lib/rpm/debuginfo.prov | sort -u
+
+#
# --- Mono exes/dlls
: ${MONO_PREFIX=/usr}
if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
--- ./macros.in.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:31.000000000 +0000
@@ -182,7 +182,8 @@
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
-AutoReqProv: 0\
+AutoReq: 0\
+AutoProv: 1\
#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
--- ./scripts/debuginfo.prov.orig 2011-05-11 15:59:31.000000000 +0000
+++ ./scripts/debuginfo.prov 2011-05-11 15:59:31.000000000 +0000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+while read instfile ; do
+ case $instfile in
+ */usr/lib/debug/.build-id/*.debug)
+ if [ -f "$instfile" ] ; then
+ BUILDID=$(echo $instfile | sed -ne 's|.*/usr/lib/debug/.build-id/\([0-9a-f]*\)/\([0-9a-f]*\)\.debug|\1\2|p')
+ echo "debuginfo(build-id) = $BUILDID"
+ fi
+ ;;
+ esac
+done
++++++ checkfilesnoinfodir.diff ++++++
Exclude /usr/share/info/dir from check-files. Probably only
interesting for SUSE.
--- scripts/check-files.orig 2013-06-10 15:55:10.000000000 +0000
+++ scripts/check-files 2013-07-12 11:45:37.000000000 +0000
@@ -28,5 +28,5 @@ trap "rm -f \"${FILES_DISK}\"" 0 2 3 5 1
# Find non-directory files in the build root and compare to the manifest.
# TODO: regex chars in last sed(1) expression should be escaped
find "${RPM_BUILD_ROOT}" -type f -o -type l | LC_ALL=C sort > "${FILES_DISK}"
-LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n 's|^< '"${RPM_BUILD_ROOT}"'\(.*\)$| \1|gp'
+LC_ALL=C sort | diff -d "${FILES_DISK}" - | sed -n -e 's|^< '"${RPM_BUILD_ROOT}"'/usr/share/info/dir$||' -e 's|^< '"${RPM_BUILD_ROOT}"'\(.*\)$| \1|gp'
++++++ convertdb1static.diff ++++++
Build convertdb1, too.
--- ./Makefile.am.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:18:21.000000000 +0000
@@ -174,6 +174,10 @@ bin_PROGRAMS += rpmqpack
rpmqpack_SOURCES = rpmqpack.c
rpmqpack_LDADD = lib/librpm.la
+bin_PROGRAMS += convertdb1
+convertdb1_SOURCES = tools/convertdb1.c
+convertdb1_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- tools/convertdb1.c.orig 2011-05-12 13:31:37.000000000 +0000
+++ tools/convertdb1.c 2011-05-12 13:31:28.000000000 +0000
@@ -0,0 +1,351 @@
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+const char *__progname;
+#else
+#include
+#include
+#include
+#endif
+
+#include
+#include
+#include
+#include
+#include
+
+#define FA_MAGIC 0x02050920
+
+struct faFileHeader{
+ unsigned int magic;
+ unsigned int firstFree;
+};
+
+struct faHeader {
+ unsigned int size;
+ unsigned int freeNext; /* offset of the next free block, 0 if none */
+ unsigned int freePrev;
+ unsigned int isFree;
+
+ /* note that the u16's appear last for alignment/space reasons */
+};
+
+
+static int fadFileSize;
+
+static ssize_t Pread(FD_t fd, void * buf, size_t count, off_t offset) {
+ if (Fseek(fd, offset, SEEK_SET) < 0)
+ return -1;
+ return Fread(buf, sizeof(char), count, fd);
+}
+
+static FD_t fadOpen(const char * path)
+{
+ struct faFileHeader newHdr;
+ FD_t fd;
+ struct stat stb;
+
+ fd = Fopen(path, "r.fdio");
+ if (!fd || Ferror(fd))
+ return NULL;
+
+ if (fstat(Fileno(fd), &stb)) {
+ Fclose(fd);
+ return NULL;
+ }
+ fadFileSize = stb.st_size;
+
+ /* is this file brand new? */
+ if (fadFileSize == 0) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (Pread(fd, &newHdr, sizeof(newHdr), 0) != sizeof(newHdr)) {
+ Fclose(fd);
+ return NULL;
+ }
+ if (newHdr.magic != FA_MAGIC) {
+ Fclose(fd);
+ return NULL;
+ }
+ /*@-refcounttrans@*/ return fd /*@=refcounttrans@*/ ;
+}
+
+static int fadNextOffset(FD_t fd, unsigned int lastOffset)
+{
+ struct faHeader header;
+ int offset;
+
+ offset = (lastOffset)
+ ? (lastOffset - sizeof(header))
+ : sizeof(struct faFileHeader);
+
+ if (offset >= fadFileSize)
+ return 0;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!lastOffset && !header.isFree)
+ return (offset + sizeof(header));
+
+ do {
+ offset += header.size;
+
+ if (Pread(fd, &header, sizeof(header), offset) != sizeof(header))
+ return 0;
+
+ if (!header.isFree) break;
+ } while (offset < fadFileSize && header.isFree);
+
+ if (offset < fadFileSize) {
+ /* Sanity check this to make sure we're not going in loops */
+ offset += sizeof(header);
+
+ if (offset <= lastOffset) return -1;
+
+ return offset;
+ } else
+ return 0;
+}
+
+static int fadFirstOffset(FD_t fd)
+{
+ return fadNextOffset(fd, 0);
+}
+
+/*@-boundsread@*/
+static int dncmp(const void * a, const void * b)
+ /*@*/
+{
+ const char *const * first = a;
+ const char *const * second = b;
+ return strcmp(*first, *second);
+}
+/*@=boundsread@*/
+
+static void compressFilelist(Header h)
+{
+ struct rpmtd_s fileNames;
+ char ** dirNames;
+ const char ** baseNames;
+ uint32_t * dirIndexes;
+ rpm_count_t count;
+ int xx, i;
+ int dirIndex = -1;
+
+ /*
+ * This assumes the file list is already sorted, and begins with a
+ * single '/'. That assumption isn't critical, but it makes things go
+ * a bit faster.
+ */
+
+ if (headerIsEntry(h, RPMTAG_DIRNAMES)) {
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+ return; /* Already converted. */
+ }
+
+ if (!headerGet(h, RPMTAG_OLDFILENAMES, &fileNames, HEADERGET_MINMEM))
+ return;
+ count = rpmtdCount(&fileNames);
+ if (count < 1)
+ return;
+
+ dirNames = xmalloc(sizeof(*dirNames) * count); /* worst case */
+ baseNames = xmalloc(sizeof(*dirNames) * count);
+ dirIndexes = xmalloc(sizeof(*dirIndexes) * count);
+
+ /* HACK. Source RPM, so just do things differently */
+ { const char *fn = rpmtdGetString(&fileNames);
+ if (fn && *fn != '/') {
+ dirIndex = 0;
+ dirNames[dirIndex] = xstrdup("");
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ dirIndexes[i] = dirIndex;
+ baseNames[i] = rpmtdGetString(&fileNames);
+ }
+ goto exit;
+ }
+ }
+
+ while ((i = rpmtdNext(&fileNames)) >= 0) {
+ char ** needle;
+ char savechar;
+ char * baseName;
+ size_t len;
+ const char *filename = rpmtdGetString(&fileNames);
+
+ if (filename == NULL) /* XXX can't happen */
+ continue;
+ baseName = strrchr(filename, '/') + 1;
+ len = baseName - filename;
+ needle = dirNames;
+ savechar = *baseName;
+ *baseName = '\0';
+ if (dirIndex < 0 ||
+ (needle = bsearch(&filename, dirNames, dirIndex + 1, sizeof(dirNames[0]), dncmp)) == NULL) {
+ char *s = xmalloc(len + 1);
+ rstrlcpy(s, filename, len + 1);
+ dirIndexes[i] = ++dirIndex;
+ dirNames[dirIndex] = s;
+ } else
+ dirIndexes[i] = needle - dirNames;
+
+ *baseName = savechar;
+ baseNames[i] = baseName;
+ }
+
+exit:
+ if (count > 0) {
+ headerPutUint32(h, RPMTAG_DIRINDEXES, dirIndexes, count);
+ headerPutStringArray(h, RPMTAG_BASENAMES, baseNames, count);
+ headerPutStringArray(h, RPMTAG_DIRNAMES,
+ (const char **) dirNames, dirIndex + 1);
+ }
+
+ rpmtdFreeData(&fileNames);
+ for (i = 0; i <= dirIndex; i++) {
+ free(dirNames[i]);
+ }
+ free(dirNames);
+ free(baseNames);
+ free(dirIndexes);
+
+ xx = headerDel(h, RPMTAG_OLDFILENAMES);
+}
+
+/*
+ * Up to rpm 3.0.4, packages implicitly provided their own name-version-release.
+ * Retrofit an explicit "Provides: name = epoch:version-release.
+ */
+static void providePackageNVR(Header h)
+{
+ const char *name;
+ char *pEVR;
+ rpmsenseFlags pFlags = RPMSENSE_EQUAL;
+ int bingo = 1;
+ struct rpmtd_s pnames;
+ rpmds hds, nvrds;
+
+ /* Generate provides for this package name-version-release. */
+ pEVR = headerGetEVR(h, &name);
+ if (!(name && pEVR))
+ return;
+
+ /*
+ * Rpm prior to 3.0.3 does not have versioned provides.
+ * If no provides at all are available, we can just add.
+ */
+ if (!headerGet(h, RPMTAG_PROVIDENAME, &pnames, HEADERGET_MINMEM)) {
+ goto exit;
+ }
+
+ /*
+ * Otherwise, fill in entries on legacy packages.
+ */
+ if (!headerIsEntry(h, RPMTAG_PROVIDEVERSION)) {
+ while (rpmtdNext(&pnames) >= 0) {
+ rpmsenseFlags fdummy = RPMSENSE_ANY;
+
+ headerPutString(h, RPMTAG_PROVIDEVERSION, "");
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &fdummy, 1);
+ }
+ goto exit;
+ }
+
+ /* see if we already have this provide */
+ hds = rpmdsNew(h, RPMTAG_PROVIDENAME, 0);
+ nvrds = rpmdsSingle(RPMTAG_PROVIDENAME, name, pEVR, pFlags);
+ if (rpmdsFind(hds, nvrds) >= 0) {
+ bingo = 0;
+ }
+ rpmdsFree(hds);
+ rpmdsFree(nvrds);
+
+exit:
+ if (bingo) {
+ const char *evr = pEVR;
+ headerPutString(h, RPMTAG_PROVIDENAME, name);
+ headerPutString(h, RPMTAG_PROVIDEVERSION, evr);
+ headerPutUint32(h, RPMTAG_PROVIDEFLAGS, &pFlags, 1);
+ }
+ rpmtdFreeData(&pnames);
+ free(pEVR);
+}
+/*@=bounds@*/
+
+static rpmdb db;
+
+int
+main(int argc, char ** argv)
+{
+ FD_t fd;
+ int offset;
+ Header h;
+ const char *name;
+ const char *version;
+ const char *release;
+ rpmts ts;
+
+ if (argc != 2)
+ {
+ fprintf(stderr, "usage: %s \n", argv[0]);
+ exit(1);
+ }
+ if ((fd = fadOpen(argv[1])) == 0)
+ {
+ fprintf(stderr, "could not open %s\n", argv[1]);
+ exit(1);
+ }
+ rpmInitMacros(NULL, "/usr/lib/rpm/macros");
+
+ /* speed things up */
+ (void) rpmDefineMacro(NULL, "_rpmdb_rebuild %{nil}", -1);
+
+ ts = rpmtsCreate();
+
+ if (rpmtsOpenDB(ts, O_RDWR)) {
+ fprintf(stderr, "could not open rpm database\n");
+ exit(1);
+ }
+
+ for (offset = fadFirstOffset(fd); offset; offset = fadNextOffset(fd, offset))
+ {
+ rpmdbMatchIterator mi;
+
+ /* have to use lseek instead of Fseek because headerRead
+ * uses low level IO
+ */
+ if (lseek(Fileno(fd), (off_t)offset, SEEK_SET) == -1)
+ {
+ perror("lseek");
+ continue;
+ }
+ h = headerRead(fd, HEADER_MAGIC_NO);
+ if (!h)
+ continue;
+ compressFilelist(h);
+ providePackageNVR(h);
+ headerNVR(h, &name, &version, &release);
+ mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0);
+ rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_DEFAULT, version);
+ rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_DEFAULT, release);
+ if (rpmdbNextIterator(mi))
+ {
+ printf("%s-%s-%s is already in database\n", name, version, release);
+ rpmdbFreeIterator(mi);
+ headerFree(h);
+ continue;
+ }
+ rpmdbFreeIterator(mi);
+ if (rpmtsHeaderAddDB(ts, h))
+ {
+ fprintf(stderr, "could not add %s-%s-%s!\n", name, version, release);
+ }
+ headerFree(h);
+ }
+ Fclose(fd);
+ rpmtsCloseDB(ts);
+ rpmtsFree(ts);
+ return 0;
+}
+
++++++ cpionamesize.diff ++++++
--- ./lib/cpio.c.orig 2014-12-11 14:51:11.149327450 +0000
+++ ./lib/cpio.c 2014-12-11 14:53:21.493772955 +0000
@@ -296,6 +296,8 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, ch
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);
++++++ db.diff ++++++
--- db/db/db.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db.c 2011-05-12 11:38:59.000000000 +0000
@@ -646,6 +646,8 @@ __env_mpool(dbp, fname, flags)
MAKE_INMEM(dbp);
return (ret);
}
+ if (LF_ISSET(DB_NOFSYNC) && mpf->mfp)
+ F_SET(mpf->mfp, MP_NOFSYNC);
/*
* Set the open flag. We use it to mean that the dbp has gone
--- db/db/db_iface.c.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/db/db_iface.c 2011-05-12 11:21:32.000000000 +0000
@@ -1230,6 +1230,7 @@ __db_open_arg(dbp, txn, fname, dname, ty
#define OKFLAGS \
(DB_AUTO_COMMIT | DB_CREATE | DB_EXCL | DB_FCNTL_LOCKING | \
DB_MULTIVERSION | DB_NOMMAP | DB_NO_AUTO_COMMIT | DB_RDONLY | \
+ DB_NOFSYNC | \
DB_RDWRMASTER | DB_READ_UNCOMMITTED | DB_THREAD | DB_TRUNCATE)
if ((ret = __db_fchk(env, "DB->open", flags, OKFLAGS)) != 0)
return (ret);
--- db/dbinc/mp.h.orig 2010-04-12 20:25:22.000000000 +0000
+++ db/dbinc/mp.h 2011-05-12 12:01:32.000000000 +0000
@@ -467,6 +467,7 @@ struct __mpoolfile {
#define MP_FAKE_UOC 0x080 /* Unlink_on_close field: fake flag. */
#define MP_NOT_DURABLE 0x100 /* File is not durable. */
#define MP_TEMP 0x200 /* Backing file is a temporary. */
+#define MP_NOFSYNC 0x400 /* Don't fsync */
u_int32_t flags;
};
--- db/dbinc_auto/api_flags.in.orig 2011-05-12 11:40:57.000000000 +0000
+++ db/dbinc_auto/api_flags.in 2011-05-12 11:55:10.000000000 +0000
@@ -83,6 +83,7 @@
#define DB_NOORDERCHK 0x00000002
#define DB_NOPANIC 0x00000800
#define DB_NO_AUTO_COMMIT 0x00001000
+#define DB_NOFSYNC 0x00040000
#define DB_ODDFILESIZE 0x00000080
#define DB_ORDERCHKONLY 0x00000004
#define DB_OVERWRITE 0x00001000
--- db/dist/s_config.orig 2010-04-12 20:25:23.000000000 +0000
+++ db/dist/s_config 2011-05-12 12:00:34.000000000 +0000
@@ -8,7 +8,8 @@ trap 'rm -f aclocal.m4 ; exit 0' 0 1 2 3
. ./RELEASE
echo "autoconf: building aclocal.m4..."
-cat aclocal/*.m4 aclocal_java/*.m4 > aclocal.m4
+cat aclocal/*.m4 aclocal_java/*.m4 > acinclude.m4
+aclocal
echo "autoconf: running autoheader to build config.hin..."
rm -f config.hin
--- db/mp/mp_sync.c.orig 2010-04-12 20:25:34.000000000 +0000
+++ db/mp/mp_sync.c 2011-05-12 11:36:58.000000000 +0000
@@ -578,7 +578,7 @@ done: /*
if (ret == 0 && required_write) {
if (dbmfp == NULL)
ret = __memp_sync_files(env);
- else
+ else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
}
@@ -665,7 +665,7 @@ __memp_sync_file(env, mfp, argp, countp,
"%s: unable to flush", (char *)
R_ADDR(dbmp->reginfo, mfp->path_off));
}
- } else
+ } else if (!F_ISSET(dbmfp->mfp, MP_NOFSYNC))
ret = __os_fsync(env, dbmfp->fhp);
/*
@@ -801,6 +801,8 @@ __memp_mf_sync(dbmp, mfp, locked)
COMPQUIET(hp, NULL);
env = dbmp->env;
+ if (F_ISSET(mfp, MP_NOFSYNC))
+ return 0;
/*
* We need to be holding the hash lock: we're using the path name
* and __memp_nameop might try and rename the file.
++++++ dbfsync.diff ++++++
Support a database-local fsync setting. Needs berkeley db patch.
--- ./lib/backend/dbconfig.c.orig 2011-01-03 13:57:41.000000000 +0000
+++ ./lib/backend/dbconfig.c 2011-05-10 17:00:29.000000000 +0000
@@ -58,8 +58,10 @@ static const struct poptOption rdbOption
{ "mp_size", 0,POPT_ARG_INT, &staticcfg.db_cachesize, 0,
NULL, NULL },
+#if 0
{ "nofsync", 0,POPT_ARG_NONE, &staticcfg.db_no_fsync, 0,
NULL, NULL },
+#endif
/* Per-dbi options */
{ "nommap", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOMMAP,
@@ -69,6 +71,8 @@ static const struct poptOption rdbOption
NULL, NULL },
{ "lockdbfd", 0,POPT_ARG_NONE, &staticdbi.dbi_lockdbfd, 0,
NULL, NULL },
+ { "nofsync", 0,POPT_BIT_SET, &staticdbi.dbi_oflags, DB_NOFSYNC,
+ NULL, NULL },
POPT_TABLEEND
};
++++++ dbprivate.diff ++++++
Always use DB_PRIVATE. Unfortunately no longer configurable
in the macros file.
--- ./lib/backend/db3.c.orig 2013-07-12 12:09:45.000000000 +0000
+++ ./lib/backend/db3.c 2013-07-12 12:11:07.000000000 +0000
@@ -164,7 +164,7 @@ static int db_init(rpmdb rdb, const char
int lockfd = -1;
struct dbConfig_s * cfg = &rdb->cfg;
/* This is our setup, thou shall not have other setups before us */
- uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB);
+ uint32_t eflags = (DB_CREATE|DB_INIT_MPOOL|DB_INIT_CDB|DB_PRIVATE);
if (rdb->db_dbenv != NULL) {
rdb->db_opens++;
++++++ dbrointerruptable.diff ++++++
--- ./lib/rpmdb.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./lib/rpmdb.c 2013-07-12 11:28:22.000000000 +0000
@@ -730,10 +730,12 @@ int rpmdbClose(rpmdb db)
{
rpmdb * prev, next;
int rc = 0;
+ int dbmode;
if (db == NULL)
goto exit;
+ dbmode = db->db_mode;
(void) rpmdbUnlink(db);
if (db->nrefs > 0)
@@ -761,7 +763,7 @@ int rpmdbClose(rpmdb db)
db = _free(db);
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (dbmode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(-SIGHUP, NULL);
(void) rpmsqEnable(-SIGINT, NULL);
(void) rpmsqEnable(-SIGTERM, NULL);
@@ -830,7 +832,7 @@ static int openDatabase(const char * pre
/* Try to ensure db home exists, error out if we can't even create */
rc = rpmioMkpath(rpmdbHome(db), 0755, getuid(), getgid());
if (rc == 0) {
- if (rpmdbRock == NULL) {
+ if (rpmdbRock == NULL && (db->db_mode & (O_RDWR|O_WRONLY)) != 0) {
(void) rpmsqEnable(SIGHUP, NULL);
(void) rpmsqEnable(SIGINT, NULL);
(void) rpmsqEnable(SIGTERM, NULL);
++++++ debug_gdb_scripts.diff ++++++
--- tools/debugedit.c.orig 2013-08-01 13:32:47.885854357 +0000
+++ tools/debugedit.c 2013-08-01 13:33:37.028854270 +0000
@@ -270,7 +270,7 @@ static struct
{ ".debug_ranges", NULL, NULL, 0, 0, 0 },
{ ".debug_types", NULL, NULL, 0, 0, 0 },
{ ".debug_macro", NULL, NULL, 0, 0, 0 },
- { ".debug_gdb_script", NULL, NULL, 0, 0, 0 },
+ { ".debug_gdb_scripts", NULL, NULL, 0, 0, 0 },
{ NULL, NULL, NULL, 0, 0, 0 }
};
++++++ debugedit-canon-fix.diff ++++++
--- ./tools/debugedit.c.orig 2011-07-18 16:53:12.000000000 +0000
+++ ./tools/debugedit.c 2011-07-18 17:15:27.000000000 +0000
@@ -162,7 +162,7 @@ strptr (DSO *dso, int sec, off_t offset)
{
if (data->d_buf
&& offset >= data->d_off
- && offset < data->d_off + data->d_size)
+ && offset < data->d_off + (off_t)data->d_size)
return (const char *) data->d_buf + (offset - data->d_off);
}
}
@@ -503,9 +503,10 @@ static int
edit_dwarf2_line (DSO *dso, uint32_t off, char *comp_dir, int phase)
{
unsigned char *ptr = debug_sections[DEBUG_LINE].data, *dir;
- unsigned char **dirt;
+ char **dirt;
unsigned char *endsec = ptr + debug_sections[DEBUG_LINE].size;
unsigned char *endcu, *endprol;
+ char line_base;
unsigned char opcode_base;
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
@@ -549,6 +550,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
return 1;
}
+ line_base = (char) (ptr[2 + (value >= 4)] & 0xff);
opcode_base = ptr[4 + (value >= 4)];
ptr = dir = ptr + 4 + (value >= 4) + opcode_base;
@@ -560,13 +562,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
++value;
}
- dirt = (unsigned char **) alloca (value * sizeof (unsigned char *));
+ dirt = (char **) alloca (value * sizeof (unsigned char *));
dirt[0] = (unsigned char *) ".";
dirt_cnt = 1;
ptr = dir;
while (*ptr != 0)
{
- dirt[dirt_cnt++] = ptr;
+ dirt[dirt_cnt++] = (char *)ptr;
ptr = (unsigned char *) strchr ((char *)ptr, 0) + 1;
}
ptr++;
@@ -679,7 +681,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (dest_dir)
{
- unsigned char *srcptr, *buf = NULL;
+ char *srcptr, *buf = NULL;
size_t base_len = strlen (base_dir);
size_t dest_len = strlen (dest_dir);
size_t shrank = 0;
@@ -693,11 +695,14 @@ edit_dwarf2_line (DSO *dso, uint32_t off
ptr = dir;
}
else
- ptr = srcptr = dir;
+ {
+ ptr = dir;
+ srcptr = (char *)dir;
+ }
while (*srcptr != 0)
{
size_t len = strlen ((char *)srcptr) + 1;
- const unsigned char *readptr = srcptr;
+ const char *readptr = srcptr;
char *orig = strdup ((const char *) srcptr);
@@ -724,10 +729,13 @@ edit_dwarf2_line (DSO *dso, uint32_t off
if (shrank > 0)
{
- if (--shrank == 0)
+ --shrank;
+#if 0
+ if (shrank == 0)
error (EXIT_FAILURE, 0,
"canonicalization unexpectedly shrank by one character");
else
+#endif
{
memset (ptr, 'X', shrank);
ptr += shrank;
@@ -763,21 +771,26 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
dirty_section (DEBUG_STR);
}
- else if (ptr != srcptr)
+ else if ((char *)ptr != srcptr)
memmove (ptr, srcptr, len);
srcptr += len;
ptr += len;
- dir = srcptr;
+ dir = (unsigned char *)srcptr;
read_uleb128 (srcptr);
read_uleb128 (srcptr);
read_uleb128 (srcptr);
if (ptr != dir)
- memmove (ptr, dir, srcptr - dir);
- ptr += srcptr - dir;
+ memmove (ptr, dir, (unsigned char *)srcptr - dir);
+ ptr += (unsigned char *)srcptr - dir;
}
*ptr = '\0';
free (buf);
}
+
+ ptr++;
+ /* fill the rest until the line number program starts with NOP opcode */
+ memset(ptr, opcode_base - line_base, endprol - ptr);
+ /* don't touch the line number program */
return 0;
}
++++++ debugedit-comp-dir.diff ++++++
Include compilation directory in source file list if used.
--- ./tools/debugedit.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./tools/debugedit.c 2011-05-11 15:31:31.000000000 +0000
@@ -503,6 +503,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
uint32_t value, dirt_cnt;
size_t comp_dir_len = strlen (comp_dir);
size_t abs_file_cnt = 0, abs_dir_cnt = 0;
+ int comp_dir_used = 0;
if (phase != 0)
return 0;
@@ -611,6 +612,7 @@ edit_dwarf2_line (DSO *dso, uint32_t off
memcpy (p, dirt[value], dir_len);
p[dir_len] = '/';
memcpy (p + dir_len + 1, file, file_len + 1);
+ comp_dir_used = 1;
}
canonicalize_path (s, s);
if (list_file_fd != -1)
@@ -644,6 +646,30 @@ edit_dwarf2_line (DSO *dso, uint32_t off
}
++ptr;
+ if (comp_dir_used && list_file_fd != -1
+ && (base_dir == NULL || has_prefix (comp_dir, base_dir)))
+ {
+ char *p;
+ size_t size;
+ ssize_t ret;
+
+ size = comp_dir_len + 1;
+ p = comp_dir;
+ if (base_dir)
+ {
+ p += strlen (base_dir);
+ size -= strlen (base_dir);
+ }
+ while (size > 0)
+ {
+ ret = write (list_file_fd, p, size);
+ if (ret == -1)
+ break;
+ size -= ret;
+ p += ret;
+ }
+ }
+
if (dest_dir)
{
unsigned char *srcptr, *buf = NULL;
++++++ debugedit.diff ++++++
Make debugedit build without dwarf.h
--- ./Makefile.am.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./Makefile.am 2012-06-01 10:05:04.000000000 +0000
@@ -149,7 +149,6 @@ rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_P
if LIBELF
-if LIBDWARF
rpmconfig_SCRIPTS += scripts/find-debuginfo.sh
rpmlibexec_PROGRAMS += debugedit
@@ -162,7 +161,6 @@ elfdeps_SOURCES = tools/elfdeps.c
elfdeps_LDADD = rpmio/librpmio.la
elfdeps_LDADD += @WITH_LIBELF_LIB@ @WITH_POPT_LIB@
endif
-endif
rpmlibexec_PROGRAMS += rpmdeps
rpmdeps_SOURCES = tools/rpmdeps.c
--- ./tools/debugedit.c.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./tools/debugedit.c 2012-06-01 10:05:04.000000000 +0000
@@ -37,7 +37,37 @@
#include
#include
-#include
+
+
+/* some defines taken from the dwarf standard */
+
+#define DW_TAG_compile_unit 0x11
+
+#define DW_AT_name 0x03
+#define DW_AT_stmt_list 0x10
+#define DW_AT_comp_dir 0x1b
+
+#define DW_FORM_addr 0x01
+#define DW_FORM_block2 0x03
+#define DW_FORM_block4 0x04
+#define DW_FORM_data2 0x05
+#define DW_FORM_data4 0x06
+#define DW_FORM_data8 0x07
+#define DW_FORM_string 0x08
+#define DW_FORM_block 0x09
+#define DW_FORM_block1 0x0a
+#define DW_FORM_data1 0x0b
+#define DW_FORM_flag 0x0c
+#define DW_FORM_sdata 0x0d
+#define DW_FORM_strp 0x0e
+#define DW_FORM_udata 0x0f
+#define DW_FORM_ref_addr 0x10
+#define DW_FORM_ref1 0x11
+#define DW_FORM_ref2 0x12
+#define DW_FORM_ref4 0x13
+#define DW_FORM_ref8 0x14
+#define DW_FORM_ref_udata 0x15
+#define DW_FORM_indirect 0x16
#include
#include
++++++ debuginfo-mono.patch ++++++
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 16:10:22.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:48.000000000 +0000
@@ -211,6 +211,17 @@ while read nlinks inum f; do
;;
*) continue ;;
esac
+ # double check that we really have an ELF file,
+ # to handle monodevelop-debugger-gdb and monodevelop-debugger-mdb
+ ftype=`/usr/bin/file $f | cut -d: -f2-`
+ case $ftype in
+ *ELF*) ;;
+ *)
+ echo "$f is not an ELF file, skipping"
+ continue
+ ;;
+ esac
+
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
++++++ debuglink.diff ++++++
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 15:59:44.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 16:10:22.000000000 +0000
@@ -186,7 +186,8 @@ make_id_link()
get_debugfn()
{
dn=$(dirname "${1#$RPM_BUILD_ROOT}")
- bn=$(basename "$1" .debug).debug
+# Do not strip existing .debug suffixes
+ bn=$(basename "$1").debug
debugdn=${debugdir}${dn}
debugfn=${debugdn}/${bn}
++++++ debugsource-package.diff ++++++
Subject: Split sources for debugging into separate -debugsource package
At the moment the -debuginfo package also include the sources where used to
build the binary. The patches moves them into a separate package -debugsource.
--- ./macros.in.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./macros.in 2011-05-11 15:36:05.000000000 +0000
@@ -190,6 +190,18 @@ Debug information is useful when develop
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
+\
+%package debugsource\
+Summary: Debug sources for package %{name}\
+Group: Development/Debug\
+AutoReqProv: 0\
+Requires: %{name}-debuginfo = %{version}-%{release}\
+%description debugsource\
+This package provides debug sources for package %{name}.\
+Debug sources are useful when developing applications that use this\
+package or when debugging this package.\
+%files debugsource -f debugsources.list\
+%defattr(-,root,root)\
%{nil}
%_defaultdocdir %{_datadir}/doc/packages
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 14:46:18.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:36:05.000000000 +0000
@@ -187,8 +187,8 @@ set -o pipefail
strict_error=ERROR
$strict || strict_error=WARNING
-# Strip ELF binaries
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+# Strip ELF binaries (and no static libraries)
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z |
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
@@ -300,10 +300,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
(cd "${RPM_BUILD_ROOT}/usr"
test ! -d lib/debug || find lib/debug ! -type d
- test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
) | sed 's,^,/usr/,' >> "$LISTFILE"
fi
+: > "$SOURCEFILE"
+if [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
+ (cd "${RPM_BUILD_ROOT}/usr"
+ test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
+ ) | sed 's,^,/usr/,' >> "$SOURCEFILE"
+fi
+
# Append to $1 only the lines from stdin not already in the file.
append_uniq()
{
++++++ debugsubpkg.diff ++++++
Create a debuginfo package for each subpackage.
Index: build/files.c
===================================================================
--- build/files.c.orig
+++ build/files.c
@@ -21,6 +21,10 @@
#include
#include
+#if HAVE_GELF_H
+#include
+#endif
+
#include "rpmio/rpmio_internal.h" /* XXX rpmioSlurp */
#include "misc/fts.h"
#include "lib/cpio.h"
@@ -2097,13 +2101,237 @@ exit:
return rc;
}
+#if HAVE_GELF_H && HAVE_LIBELF
+/* Query the build-id from the ELF file NAME and store it in the newly
+ allocated *build_id array of size *build_id_size. Returns -1 on
+ error. */
+
+int
+getELFBuildId (const char *name,
+ unsigned char **id, size_t *id_size)
+{
+ int fd, i;
+ Elf *elf;
+ GElf_Ehdr ehdr;
+ Elf_Data *build_id = NULL;
+ size_t build_id_offset = 0, build_id_size = 0;
+
+ /* Now query the build-id of the file and add the
+ corresponding links in the .build-id tree.
+ The following code is based on tools/debugedit.c. */
+ fd = open (name, O_RDONLY);
+ if (fd < 0)
+ return -1;
+ elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
+ if (elf == NULL)
+ {
+ fprintf (stderr, "cannot open ELF file: %s",
+ elf_errmsg (-1));
+ close (fd);
+ return -1;
+ }
+ if (elf_kind (elf) != ELF_K_ELF
+ || gelf_getehdr (elf, &ehdr) == NULL
+ || (ehdr.e_type != ET_DYN
+ && ehdr.e_type != ET_EXEC
+ && ehdr.e_type != ET_REL))
+ {
+ elf_end (elf);
+ close (fd);
+ return -1;
+ }
+ for (i = 0; i < ehdr.e_shnum; ++i)
+ {
+ Elf_Scn *s = elf_getscn (elf, i);
+ GElf_Shdr shdr;
+ Elf_Data *data;
+ Elf32_Nhdr nh;
+ Elf_Data dst =
+ {
+ .d_version = EV_CURRENT, .d_type = ELF_T_NHDR,
+ .d_buf = &nh, .d_size = sizeof nh
+ };
+ Elf_Data src = dst;
+
+ gelf_getshdr (s, &shdr);
+ if (shdr.sh_type != SHT_NOTE
+ || !(shdr.sh_flags & SHF_ALLOC))
+ continue;
+
+ /* Look for a build-ID note here. */
+ data = elf_rawdata (s, NULL);
+ src.d_buf = data->d_buf;
+ assert (sizeof (Elf32_Nhdr) == sizeof (Elf64_Nhdr));
+ while (data->d_buf + data->d_size - src.d_buf > (int) sizeof nh
+ && elf32_xlatetom (&dst, &src, ehdr.e_ident[EI_DATA]))
+ {
+ Elf32_Word len = sizeof nh + nh.n_namesz;
+ len = (len + 3) & ~3;
+
+ if (nh.n_namesz == sizeof "GNU" && nh.n_type == 3
+ && !memcmp (src.d_buf + sizeof nh, "GNU", sizeof "GNU"))
+ {
+ build_id = data;
+ build_id_offset = src.d_buf + len - data->d_buf;
+ build_id_size = nh.n_descsz;
+ break;
+ }
+
+ len += nh.n_descsz;
+ len = (len + 3) & ~3;
+ src.d_buf += len;
+ }
+
+ if (build_id != NULL)
+ break;
+ }
+
+ if (build_id == NULL)
+ return -1;
+
+ *id = malloc (build_id_size);
+ *id_size = build_id_size;
+ memcpy (*id, build_id->d_buf + build_id_offset, build_id_size);
+
+ elf_end (elf);
+ close (fd);
+
+ return 0;
+}
+
+
+static rpmTag copyTagsForDebug[] = {
+ RPMTAG_EPOCH,
+ RPMTAG_VERSION,
+ RPMTAG_RELEASE,
+ RPMTAG_LICENSE,
+ RPMTAG_PACKAGER,
+ RPMTAG_DISTRIBUTION,
+ RPMTAG_DISTURL,
+ RPMTAG_VENDOR,
+ RPMTAG_ICON,
+ RPMTAG_URL,
+ RPMTAG_CHANGELOGTIME,
+ RPMTAG_CHANGELOGNAME,
+ RPMTAG_CHANGELOGTEXT,
+ RPMTAG_PREFIXES,
+ RPMTAG_RHNPLATFORM,
+ RPMTAG_OS,
+ RPMTAG_DISTTAG,
+ RPMTAG_CVSID,
+ RPMTAG_ARCH,
+ 0
+};
+
+static void addDebuginfoPackage(rpmSpec spec, Package pkg, char *buildroot)
+{
+ const char *a;
+
+ elf_version(EV_CURRENT);
+ a = headerGetString(pkg->header, RPMTAG_ARCH);
+ if (strcmp(a, "noarch") != 0 && strcmp(a, "src") != 0 && strcmp(a, "nosrc") != 0)
+ {
+ Package dbg;
+ rpmfi fi = pkg->cpioList;
+ char tmp[1024];
+ const char *name;
+ ARGV_t files = NULL;
+ int seen_build_id = 0;
+
+ /* Check if the current package has files with debug info
+ and record them. */
+ fi = rpmfiInit (fi, 0);
+ while (rpmfiNext (fi) >= 0)
+ {
+ const char *base;
+ int i;
+ unsigned char *build_id;
+ size_t build_id_size = 0;
+ struct stat sbuf;
+
+ name = rpmfiFN (fi);
+ /* Skip leading buildroot. */
+ base = name + strlen (buildroot);
+ /* Pre-pend %buildroot/usr/lib/debug and append .debug. */
+ snprintf (tmp, 1024, "%s/usr/lib/debug%s.debug",
+ buildroot, base);
+ /* If that file exists we have debug information for it. */
+ if (access (tmp, F_OK) != 0)
+ continue;
+
+ /* Append the file list preamble. */
+ if (!files)
+ {
+ argvAdd(&files, "%defattr(-,root,root)");
+ argvAdd(&files, "%dir /usr/lib/debug");
+ }
+ /* Add the files main debug-info file. */
+ snprintf (tmp, 1024, "/usr/lib/debug/%s.debug", base);
+ argvAdd(&files, tmp);
+
+ /* Do not bother to check build-ids for symbolic links.
+ We'll handle them for the link target. */
+ if (lstat (name, &sbuf) == -1
+ || S_ISLNK (sbuf.st_mode))
+ continue;
+
+ /* Try to gather the build-id from the binary. */
+ if (getELFBuildId (name, &build_id, &build_id_size) == -1)
+ continue;
+
+ /* If we see build-id links for the first time add the
+ directory. */
+ if (!seen_build_id)
+ argvAdd(&files, "%dir /usr/lib/debug/.build-id");
+
+ /* From the build-id construct the two links pointing back
+ to the debug information file and the binary. */
+ snprintf (tmp, 1024, "/usr/lib/debug/.build-id/%02x/",
+ build_id[0]);
+ for (i = 1; i < build_id_size; ++i)
+ sprintf (tmp + strlen (tmp), "%02x", build_id[i]);
+ argvAdd(&files, tmp);
+ sprintf (tmp + strlen (tmp), ".debug");
+ argvAdd(&files, tmp);
+
+ free (build_id);
+ }
+
+ /* If there are debuginfo files for this package add a
+ new debuginfo package. */
+ if (files)
+ {
+ dbg = newPackage(NULL, spec->pool, &spec->packages);
+ headerNVR (pkg->header, &name, NULL, NULL);
+ /* Set name, summary and group. */
+ snprintf (tmp, 1024, "%s-debuginfo", name);
+ headerPutString(dbg->header, RPMTAG_NAME, tmp);
+ snprintf (tmp, 1024, "Debug information for package %s", name);
+ headerPutString(dbg->header, RPMTAG_SUMMARY, tmp);
+ snprintf (tmp, 1024, "This package provides debug information for package %s.\n"
+ "Debug information is useful when developing applications that use this\n"
+ "package or when debugging this package.", name);
+ headerPutString(dbg->header, RPMTAG_DESCRIPTION, tmp);
+ headerPutString(dbg->header, RPMTAG_GROUP, "Development/Debug");
+ /* Inherit other tags from parent. */
+ headerCopyTags (pkg->header, dbg->header, copyTagsForDebug);
+
+ /* Build up the files list. */
+ dbg->fileList = files;
+ }
+ }
+}
+#endif
+
rpmRC processBinaryFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
int installSpecialDoc, int test)
{
Package pkg;
rpmRC rc = RPMRC_OK;
+ char *buildroot;
check_fileList = newStringBuf();
+ buildroot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL);
genSourceRpmName(spec);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
@@ -2119,8 +2347,12 @@ rpmRC processBinaryFiles(rpmSpec spec, r
rpmlog(RPMLOG_NOTICE, _("Processing files: %s\n"), nvr);
free(nvr);
- if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK ||
- (rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
+ if ((rc = processPackageFiles(spec, pkgFlags, pkg, installSpecialDoc, test)) != RPMRC_OK)
+ goto exit;
+#if HAVE_GELF_H && HAVE_LIBELF
+ addDebuginfoPackage(spec, pkg, buildroot);
+#endif
+ if ((rc = rpmfcGenerateDepends(spec, pkg)) != RPMRC_OK)
goto exit;
a = headerGetString(pkg->header, RPMTAG_ARCH);
Index: macros.in
===================================================================
--- macros.in.orig
+++ macros.in
@@ -182,24 +182,10 @@
# Template for debug information sub-package.
%debug_package \
%global __debug_package 1\
-%package debuginfo\
-Summary: Debug information for package %{name}\
-Group: Development/Debug\
-AutoReq: 0\
-AutoProv: 1\
-#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
-%description debuginfo\
-This package provides debug information for package %{name}.\
-Debug information is useful when developing applications that use this\
-package or when debugging this package.\
-%files debuginfo -f debugfiles.list\
-%defattr(-,root,root)\
-\
%package debugsource\
Summary: Debug sources for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
-Requires: %{name}-debuginfo = %{version}-%{release}\
%description debugsource\
This package provides debug sources for package %{name}.\
Debug sources are useful when developing applications that use this\
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -149,6 +149,11 @@ debug_link()
# Provide .2, .3, ... symlinks to all filename instances of this build-id.
make_id_dup_link()
{
+ # See https://bugzilla.redhat.com/show_bug.cgi?id=641377 for the reasoning,
+ # but it has seveal drawbacks as we would need to split the .1 suffixes into
+ # different subpackages and it's about impossible to predict the number
+ # -> perhaps later
+ return
local id="$1" file="$2" idfile
local n=1
@@ -311,19 +316,11 @@ while read nlinks inum f; do
fi
done || exit
-# 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 |
-while read f
-do
- t=$(readlink -m "$f").debug
- f=${f#$RPM_BUILD_ROOT}
- t=${t#$RPM_BUILD_ROOT}
- if [ -f "$debugdir$t" ]; then
- echo "symlinked /usr/lib/debug$t to /usr/lib/debug${f}.debug"
- debug_link "/usr/lib/debug$t" "${f}.debug"
- fi
-done
+# We used to make a .debug symlink for each symlink whose target
+# has a .debug file to that file. This is not necessary because
+# the debuglink section contains only the destination of those links.
+# Creating those links anyway results in debuginfo packages for
+# devel packages just because of the .so symlinks in them.
if [ -s "$SOURCEFILE" ]; then
mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug"
++++++ disttag-macro.diff ++++++
Hmm, SUSE doesn't use it, so what's the purpose of this patch?
--- ./build/parsePreamble.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 15:59:08.000000000 +0000
@@ -485,6 +485,7 @@ static struct optionalTag {
{ RPMTAG_PACKAGER, "%{packager}" },
{ RPMTAG_DISTRIBUTION, "%{distribution}" },
{ RPMTAG_DISTURL, "%{disturl}" },
+ { RPMTAG_DISTTAG, "%{disttag}" },
{ RPMTAG_BUGURL, "%{bugurl}" },
{ -1, NULL }
};
--- ./macros.in.orig 2011-05-11 15:38:44.000000000 +0000
+++ ./macros.in 2011-05-11 15:59:08.000000000 +0000
@@ -279,6 +279,16 @@ package or when debugging this package.\
#
#%bugurl
+# Configurable distribution tag, same as Disttag: tag in a specfile.
+# The tag will be used to supply reliable information to tools like
+# rpmfind.
+#
+# Note: You should not configure with disturl (or build packages with
+# the Disttag: tag) unless you are willing to supply content in a
+# yet-to-be-determined format at the tag specified.
+#
+#%disttag
+
# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
# marked as %doc should be installed.
#%_excludedocs
++++++ extcond.diff ++++++
This patch supports an extension in the condition evaluation.
If the condition is a format and returns an nonempty string, it is
assumed to be true.
This mechanism is used by the weakdeps patch to filter the
"RPMSENSE_STRONG" flag.
--- ./lib/headerfmt.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/headerfmt.c 2011-05-10 17:06:49.000000000 +0000
@@ -568,8 +568,12 @@ static int parseExpression(headerSprintf
*endPtr = chptr;
+ token->u.cond.tag.type = NULL;
+ token->u.cond.tag.format = "";
token->type = PTOK_COND;
+ if ((token->u.cond.tag.type = strchr(str, ':')) != 0)
+ *token->u.cond.tag.type++ = 0;
(void) findTag(hsa, token, str);
return 0;
@@ -657,6 +661,7 @@ static char * singleSprintf(headerSprint
int i, j, found;
rpm_count_t count, numElements;
sprintfToken spft;
+ sprintfTag stag;
int condNumFormats;
size_t need;
@@ -687,6 +692,18 @@ static char * singleSprintf(headerSprint
headerIsEntry(hsa->h, token->u.cond.tag.tag)) {
spft = token->u.cond.ifFormat;
condNumFormats = token->u.cond.numIfTokens;
+ if (token->u.cond.tag.fmt) {
+ /* check if format creates output */
+ size_t vallen = hsa->vallen;
+ formatValue(hsa, &token->u.cond.tag, element);
+ if (hsa->vallen == vallen) {
+ spft = token->u.cond.elseFormat;
+ condNumFormats = token->u.cond.numElseTokens;
+ } else {
+ hsa->vallen = vallen;
+ hsa->val[hsa->vallen] = 0;
+ }
+ }
} else {
spft = token->u.cond.elseFormat;
condNumFormats = token->u.cond.numElseTokens;
@@ -710,10 +727,13 @@ static char * singleSprintf(headerSprint
for (i = 0; i < token->u.array.numTokens; i++, spft++)
{
rpmtd td = NULL;
- if (spft->type != PTOK_TAG ||
- spft->u.tag.justOne) continue;
+ if (spft->type != PTOK_TAG && spft->type != PTOK_COND)
+ continue;
+ stag = (spft->type == PTOK_COND ? &spft->u.cond.tag : &spft->u.tag);
+ if (stag->justOne)
+ continue;
- if (!(td = getData(hsa, spft->u.tag.tag))) {
+ if (!(td = getData(hsa, stag->tag))) {
continue;
}
++++++ fileattrs.diff ++++++
--- ./fileattrs/Makefile.am.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./fileattrs/Makefile.am 2012-06-01 13:39:16.000000000 +0000
@@ -6,6 +6,7 @@ fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
desktop.attr elf.attr font.attr libtool.attr perl.attr perllib.attr \
- pkgconfig.attr python.attr ocaml.attr script.attr mono.attr
+ pkgconfig.attr python.attr ocaml.attr script.attr mono.attr \
+ debuginfo.attr elflib.attr firmware.attr ksyms.attr sysvinit.attr
EXTRA_DIST = $(fattrs_DATA)
--- ./fileattrs/debuginfo.attr.orig 2012-06-01 13:39:16.000000000 +0000
+++ ./fileattrs/debuginfo.attr 2012-06-01 13:39:16.000000000 +0000
@@ -0,0 +1,2 @@
+%__debuginfo_provides %{_rpmconfigdir}/debuginfo.prov
+%__debuginfo_path ^/usr/lib/debug/
--- ./fileattrs/elf.attr.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./fileattrs/elf.attr 2012-06-01 13:40:16.000000000 +0000
@@ -1,4 +1,5 @@
%__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
%__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
-%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
+%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*executable
%__elf_flags exeonly
+%__elf_exclude_path ^/usr/lib/debug/
--- ./fileattrs/elflib.attr.orig 2012-06-01 13:39:16.000000000 +0000
+++ ./fileattrs/elflib.attr 2012-06-01 13:39:16.000000000 +0000
@@ -0,0 +1,4 @@
+%__elflib_provides %{_rpmconfigdir}/elfdeps --assume-exec --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_requires %{_rpmconfigdir}/elfdeps --assume-exec --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
+%__elflib_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*shared object
+%__elflib_exclude_path ^/usr/lib/debug/
--- ./fileattrs/firmware.attr.orig 2012-06-01 13:39:16.000000000 +0000
+++ ./fileattrs/firmware.attr 2012-06-01 13:39:16.000000000 +0000
@@ -0,0 +1,2 @@
+%__firmware_provides %{_rpmconfigdir}/firmware.prov
+%__firmware_path /lib/firmware/
--- ./fileattrs/ksyms.attr.orig 2012-06-01 13:39:16.000000000 +0000
+++ ./fileattrs/ksyms.attr 2012-06-01 13:39:16.000000000 +0000
@@ -0,0 +1,4 @@
+%__ksyms_provides %{_rpmconfigdir}/find-provides.ksyms %name
+%__ksyms_requires %{_rpmconfigdir}/find-requires.ksyms %name
+%__ksyms_supplements %{_rpmconfigdir}/find-supplements.ksyms %name
+%__ksyms_path (/lib/modules/.*\.ko(\.gz)?)|(/boot/vmlinu[xz].*)$
--- ./fileattrs/perl.attr.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./fileattrs/perl.attr 2012-06-01 13:39:16.000000000 +0000
@@ -1,3 +1,4 @@
-%__perl_requires %{_rpmconfigdir}/perl.req
+# disabled for now
+#%__perl_requires %{_rpmconfigdir}/perl.req
%__perl_magic ^.*[Pp]erl .*$
%__perl_flags exeonly
--- ./fileattrs/perllib.attr.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./fileattrs/perllib.attr 2012-06-01 13:39:16.000000000 +0000
@@ -1,3 +1,4 @@
%__perllib_provides %{_rpmconfigdir}/perl.prov
-%__perllib_requires %{_rpmconfigdir}/perl.req
+#disabled for now
+#%__perllib_requires %{_rpmconfigdir}/perl.req
%__perllib_magic ^Perl[[:digit:]] module source.*
--- ./fileattrs/sysvinit.attr.orig 2012-06-01 13:39:16.000000000 +0000
+++ ./fileattrs/sysvinit.attr 2012-06-01 13:39:16.000000000 +0000
@@ -0,0 +1,2 @@
+%__sysvinit_provides %{_rpmconfigdir}/sysvinitdeps.sh --provides
+%__sysvinit_path ^/etc/init\.d/
++++++ finddebuginfo-absolute-links.diff ++++++
From: Jan Blunck
Subject: Do the symbolic links right in the first place
Since brp-symlink relinks symbolic links to enforce a certain policy we should
do it right in the first place. So this patch changes find-debuginfo.sh scripts
behavior to reflect that policy.
Signed-off-by: Jan Blunck
--- ./scripts/find-debuginfo.sh.orig 2012-06-01 13:12:04.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2012-06-01 13:12:17.000000000 +0000
@@ -133,7 +133,17 @@ debug_link()
local l="/usr/lib/debug$2"
local t="$1"
echo >> "$LINKSFILE" "$l $t"
- link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+
+ # this should correspond to what brp-symlink is doing
+ case $t in
+ /usr*)
+ link_relative "$t" "$l" "$RPM_BUILD_ROOT"
+ ;;
+ *)
+ mkdir -p "$(dirname "$RPM_BUILD_ROOT$l")" && \
+ ln -snf "$t" "$RPM_BUILD_ROOT$l"
+ ;;
+ esac
}
# Provide .2, .3, ... symlinks to all filename instances of this build-id.
@@ -186,8 +196,8 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
- if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
+ if cmp -s "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ||
+ elfcmp "$RPM_BUILD_ROOT$other" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
++++++ finddebuginfo.diff ++++++
--- ./scripts/find-debuginfo.sh.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./scripts/find-debuginfo.sh 2012-06-01 12:26:12.000000000 +0000
@@ -153,6 +153,20 @@ make_id_dup_link()
debug_link "$file" "/$idfile"
}
+# Compare two binaries but ignore the .note.gnu.build-id section
+elfcmp()
+{
+ local tmp1=$(mktemp -t ${1##*/}.XXXXXX)
+ local tmp2=$(mktemp -t ${2##*/}.XXXXXX)
+
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $1 $tmp1
+ objcopy -R .note.gnu.build-id -R .gnu_debuglink $2 $tmp2
+ cmp -s $tmp1 $tmp2
+ local res=$?
+ rm -f $tmp1 $tmp2
+ return $res
+}
+
# Make a build-id symlink for id $1 with suffix $3 to file $2.
make_id_link()
{
@@ -173,7 +187,7 @@ make_id_link()
local other=$(readlink -m "$root_idfile")
other=${other#$RPM_BUILD_ROOT}
if cmp -s "$root_idfile" "$RPM_BUILD_ROOT$file" ||
- eu-elfcmp -q "$root_idfile" "$RPM_BUILD_ROOT$file" 2> /dev/null; then
+ elfcmp "$root_idfile" "$RPM_BUILD_ROOT$file" ; then
# Two copies. Maybe one has to be setuid or something.
echo >&2 "*** WARNING: identical binaries are copied, not linked:"
echo >&2 " $file"
@@ -202,12 +216,18 @@ strict_error=ERROR
$strict || strict_error=WARNING
# Strip ELF binaries
-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' |
-xargs --no-run-if-empty stat -c '%h %D_%i %n' |
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
+xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
while read nlinks inum f; do
+ case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
+ *debuglink*) continue ;;
+ *debug*) ;;
+ *gnu.version*)
+ echo "WARNING: "`echo $f | sed -e "s,^$RPM_BUILD_ROOT/*,/,"`" is already stripped!"
+ continue
+ ;;
+ *) continue ;;
+ esac
get_debugfn "$f"
[ -f "${debugfn}" ] && continue
@@ -231,8 +251,11 @@ while read nlinks inum f; do
fi
echo "extracting debug info from $f"
- id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug \
- -i -l "$SOURCEFILE" "$f") || exit
+ mode=$(stat -c %a "$f")
+ chmod +w "$f"
+ id=$($(DEBUGEDIT=$(which debugedit 2>/dev/null); \
+ echo ${DEBUGEDIT:-/usr/lib/rpm/debugedit}) -b "$RPM_BUILD_DIR" \
+ -d /usr/src/debug -i -l "$SOURCEFILE" "$f") || exit
if [ $nlinks -gt 1 ]; then
eval linkedid_$inum=\$id
fi
@@ -252,13 +275,25 @@ while read nlinks inum f; do
esac
mkdir -p "${debugdn}"
- if test -w "$f"; then
- strip_to_debug "${debugfn}" "$f"
- else
- chmod u+w "$f"
- strip_to_debug "${debugfn}" "$f"
- chmod u-w "$f"
- fi
+ objcopy --only-keep-debug $f $debugfn || :
+ (
+ shopt -s extglob
+ strip_option="--strip-all"
+ case "$f" in
+ *.ko)
+ strip_option="--strip-debug" ;;
+ *$STRIP_KEEP_SYMTAB*)
+ if test -n "$STRIP_KEEP_SYMTAB"; then
+ strip_option="--strip-debug"
+ fi
+ ;;
+ esac
+ if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
+ strip_option=
+ fi
+ objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
+ chmod $mode $f
+ ) || :
if [ -n "$id" ]; then
make_id_link "$id" "$dn/$(basename $f)"
@@ -287,12 +322,14 @@ if [ -s "$SOURCEFILE" ]; then
# stupid cpio creates new directories in mode 0700, fixup
find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 |
xargs --no-run-if-empty -0 chmod a+rx
+ find "${RPM_BUILD_ROOT}/usr/src/debug" -type f -print0 |
+ xargs --no-run-if-empty -0 chmod a+r
fi
if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then
((nout > 0)) ||
test ! -d "${RPM_BUILD_ROOT}/usr/lib" ||
- (cd "${RPM_BUILD_ROOT}/usr/lib"; find debug -type d) |
+ (cd "${RPM_BUILD_ROOT}/usr/lib"; test ! -d debug || find debug -type d) |
sed 's,^,%dir /usr/lib/,' >> "$LISTFILE"
(cd "${RPM_BUILD_ROOT}/usr"
++++++ findksyms.diff ++++++
SUSE specific kernel provides/requires scripts
--- scripts/find-provides.ksyms.orig 2013-07-12 14:08:40.000000000 +0000
+++ scripts/find-provides.ksyms 2013-07-12 14:08:54.000000000 +0000
@@ -0,0 +1,17 @@
+#! /bin/bash
+
+IFS=$'\n'
+
+while read f; do
+ test -e "$f" || continue
+ case "$f" in
+ *.debug)
+ ;;
+ */boot/vmlinu[xz]-*)
+ flavor=${f##*/vmlinu[xz]-}
+ flavor=${flavor%.gz}
+ echo "kernel-uname-r = $flavor"
+ ;;
+ esac
+done \
+| sort -u
--- scripts/find-requires.ksyms.orig 2013-07-12 14:08:45.000000000 +0000
+++ scripts/find-requires.ksyms 2013-07-12 14:08:33.000000000 +0000
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+IFS=$'\n'
+
+while read f; do
+ test -e "$f" || continue
+ case "$f" in
+ */lib/modules/*/*.ko | */lib/modules/*/*.ko.gz)
+ flavor=${f#*/lib/modules/}
+ flavor=${flavor%%/*}
+ echo "kernel-uname-r = $flavor"
+ ;;
+ esac
+done \
+| sort -u
--- scripts/Makefile.am
+++ scripts/Makefile.am
@@ -15,6 +15,7 @@
rpmdb_loadcvt rpm.daily rpm.log rpm.supp rpm2cpio.sh \
tcl.req tgpg vpkg-provides.sh \
find-requires.php find-provides.php \
+ find-requires.ksyms find-provides.ksyms \
find-php-provides find-php-requires \
mono-find-requires mono-find-provides \
ocaml-find-requires.sh ocaml-find-provides.sh \
@@ -30,6 +31,7 @@
check-buildroot check-rpaths check-rpaths-worker \
find-lang.sh \
perl.prov perl.req perldeps.pl pythondeps.sh osgideps.pl \
+ find-requires.ksyms find-provides.ksyms \
mono-find-requires mono-find-provides \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
++++++ findlang.diff ++++++
--- ./scripts/find-lang.sh.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./scripts/find-lang.sh 2012-06-01 12:35:41.000000000 +0000
@@ -28,10 +28,10 @@ the top of the tree containing the files
PACKAGE_NAME is the %{name} of the package. This should also be
the basename of the .mo files. the output is written to
PACKAGE_NAME.lang unless \$3 is given in which case output is written
-to \$3.
+to \$3 (note that \$3 is appended to if given).
Additional options:
- --with-gnome find GNOME help files
- --with-kde find KDE help files
+ --without-gnome do not find GNOME help files
+ --without-kde do not find KDE help files
--with-qt find Qt translation files
--with-man find localized man pages
--all-name match all package/domain names
@@ -54,8 +54,8 @@ else NAME=$1
fi
shift
-GNOME=#
-KDE=#
+GNOME=
+KDE=
QT=#
MAN=#
MO=
@@ -73,6 +73,14 @@ while test $# -gt 0 ; do
KDE=
shift
;;
+ --without-gnome )
+ GNOME=#
+ shift
+ ;;
+ --without-kde )
+ KDE=#
+ shift
+ ;;
--with-qt )
QT=
shift
@@ -97,13 +105,19 @@ while test $# -gt 0 ; do
esac
done
+if ! test -s $MO_NAME ; then
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
+fi
+MO_NAME_NEW=$MO_NAME.tmp.$$
+rm -f $MO_NAME_NEW
+
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' > $MO_NAME
+/^$/d' > $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
@@ -111,27 +125,27 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
s:^\([^%].*\)::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f|sed '
s:'"$TOP_DIR"'::
@@ -139,7 +153,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
if [ x"$KDE3_HTML" != x -a -d "$TOP_DIR$KDE3_HTML" ]; then
@@ -151,7 +165,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
@@ -164,7 +178,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
fi
find "$TOP_DIR" -type f -o -type l|sed '
@@ -176,7 +190,7 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
@@ -184,17 +198,22 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
s:%lang(C) ::
-/^$/d' >> $MO_NAME
+/^$/d' >> $MO_NAME_NEW
-if ! grep -q / $MO_NAME; then
+if ! grep -q / $MO_NAME_NEW; then
echo "No translations found for ${NAME} in ${TOP_DIR}"
+ rm -f $MO_NAME_NEW
exit 1
fi
+
+sort -u $MO_NAME_NEW >> $MO_NAME
+rm -f $MO_NAME_NEW
+
exit 0
++++++ findsupplements.diff ++++++
Add support for supplements to the internal dependency generator.
--- ./build/rpmfc.c.orig 2013-07-12 12:18:29.000000000 +0000
+++ ./build/rpmfc.c 2013-07-12 12:18:48.000000000 +0000
@@ -58,6 +58,7 @@ struct rpmfc_s {
rpmds provides; /*!< (no. provides) package provides */
rpmds requires; /*!< (no. requires) package requires */
+ rpmds supplements; /*!< (no. supplements) package supplements */
};
struct rpmfcTokens_s {
@@ -546,6 +547,22 @@ static int rpmfcHelperRequires(rpmfc fc,
return 0;
}
+/**
+ * Run per-interpreter Supplements: dependency helper.
+ * @param fc file classifier
+ * @param nsdep class name for interpreter (e.g. "perl")
+ * @return 0
+ */
+static int rpmfcHelperSupplements(rpmfc fc, const char * nsdep)
+{
+ if (fc->skipReq)
+ return 0;
+
+ rpmfcHelper(fc, nsdep, "supplements", &fc->supplements, RPMSENSE_FIND_REQUIRES|RPMSENSE_STRONG|RPMSENSE_MISSINGOK, RPMTAG_ENHANCESNAME);
+
+ return 0;
+}
+
/* Only used for elf coloring and controlling RPMTAG_FILECLASS inclusion now */
static const struct rpmfcTokens_s rpmfcTokens[] = {
{ "directory", RPMFC_INCLUDE },
@@ -763,6 +780,7 @@ rpmfc rpmfcFree(rpmfc fc)
rpmdsFree(fc->provides);
rpmdsFree(fc->requires);
+ rpmdsFree(fc->supplements);
memset(fc, 0, sizeof(*fc)); /* trash and burn */
free(fc);
}
@@ -794,6 +812,11 @@ rpmds rpmfcRequires(rpmfc fc)
return (fc != NULL ? fc->requires : NULL);
}
+rpmds rpmfcSupplements(rpmfc fc)
+{
+ return (fc != NULL ? fc->supplements : NULL);
+}
+
rpmRC rpmfcApply(rpmfc fc)
{
const char * s;
@@ -814,6 +837,7 @@ rpmRC rpmfcApply(rpmfc fc)
for (ARGV_t fattr = fc->fattrs[fc->ix]; fattr && *fattr; fattr++) {
rpmfcHelperProvides(fc, *fattr);
rpmfcHelperRequires(fc, *fattr);
+ rpmfcHelperSupplements(fc, *fattr);
}
}
/* No more additions after this, freeze pool to minimize memory use */
@@ -858,6 +882,11 @@ rpmRC rpmfcApply(rpmfc fc)
dix = rpmdsFind(fc->requires, ds);
rpmdsFree(ds);
break;
+ case 'S':
+ ds = rpmdsSingle(RPMTAG_ENHANCESNAME, N, EVR, Flags);
+ dix = rpmdsFind(fc->supplements, ds);
+ ds = rpmdsFree(ds);
+ break;
}
if (dix < 0)
@@ -1341,6 +1370,18 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
}
}
+ /* Add Supplements: */
+ if (!fc->skipReq) {
+ rpmds pi = rpmdsInit(fc->supplements);
+ while (rpmdsNext(pi) >= 0) {
+ rpmsenseFlags flags = rpmdsFlags(pi);
+
+ headerPutString(pkg->header, RPMTAG_ENHANCESNAME, rpmdsN(pi));
+ headerPutString(pkg->header, RPMTAG_ENHANCESVERSION, rpmdsEVR(pi));
+ headerPutUint32(pkg->header, RPMTAG_ENHANCESFLAGS, &flags, 1);
+ }
+ }
+
/* Add dependency dictionary(#dependencies) */
if (rpmtdFromArgi(&td, RPMTAG_DEPENDSDICT, fc->ddictx)) {
headerPut(pkg->header, &td, HEADERPUT_DEFAULT);
--- ./build/rpmfc.h.orig 2012-11-18 08:21:06.000000000 +0000
+++ ./build/rpmfc.h 2013-07-12 12:18:48.000000000 +0000
@@ -106,6 +106,13 @@ rpmds rpmfcProvides(rpmfc fc);
*/
rpmds rpmfcRequires(rpmfc fc);
+/** \ingroup rpmfc
+ * Retrieve file classification supplements
+ * @param fc file classifier
+ * @return rpmds dependency set of fc requires
+ */
+rpmds rpmfcSupplements(rpmfc fc);
+
#ifdef __cplusplus
}
#endif
++++++ firmware.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:28:10.000000000 +0200
+++ autodeps/linux.prov 2011-06-08 13:28:51.755445342 +0200
@@ -11,6 +11,7 @@ solist=($(printf "%s\n" "${filelist[@]}"
pythonlist=
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
+firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
#
# --- Alpha does not mark 64bit dependencies
@@ -59,6 +60,11 @@ done | sort -u
printf "%s\n" "${tcllist[@]}" | /usr/lib/rpm/tcl.prov | sort -u
#
+# --- firmware files
+[ -x /usr/lib/rpm/firmware.prov -a -n "$firmwarelist" ] &&
+ printf "%s\n" "${firmwarelist[@]}" | /usr/lib/rpm/firmware.prov | sort -u
+
+#
# --- Mono exes/dlls
: ${MONO_PREFIX=/usr}
if [ -x $MONO_PREFIX/bin/mono -a -n "$monolist" ] ; then
Index: scripts/firmware.prov
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ scripts/firmware.prov 2011-06-08 13:28:33.117204009 +0200
@@ -0,0 +1,8 @@
+#!/bin/sh
+# Add firmware files in /lib/firmware into RPM provides
+
+while read instfile ; do
+ case $instfile in
+ */lib/firmware/*) test -f "$instfile" && echo "firmware(${instfile##*/lib/firmware/})" ;;
+ esac
+done
++++++ fontprovides.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:37:46.951974468 +0200
+++ autodeps/linux.prov 2011-06-08 13:37:46.967972960 +0200
@@ -15,6 +15,8 @@ pythonlist=($(printf "%s\n" "${filelist[
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
+pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$'))
+fontlist=($(printf "%s\n" "${filelist[@]}" | egrep -i "/usr/share/fonts/.*\.(ttf|otf|pfa)$"))
#
# --- Alpha does not mark 64bit dependencies
@@ -80,6 +82,16 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
fi
#
+# --- pkgconfig provides
+[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] &&
+ printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -P | sort -u
+
+#
+# --- font provides
+[ -x /usr/lib/rpm/fontconfig.prov -a -n "$fontlist" ] &&
+ printf "%s\n" "${fontlist[@]}" | /usr/lib/rpm/fontconfig.prov | sort -u
+
+#
# --- Kernel module exported symbols
[ -x /usr/lib/rpm/find-provides.ksyms ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
Index: autodeps/linux.req
===================================================================
--- autodeps/linux.req.orig 2011-06-08 13:37:46.951974468 +0200
+++ autodeps/linux.req 2011-06-08 13:37:46.968972865 +0200
@@ -34,6 +34,7 @@ perllist=()
pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..'))
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
+pkgconfiglist=($(printf "%s\n" "${filelist[@]}" | egrep '\.pc$'))
#
# --- Alpha does not mark 64bit dependencies
@@ -143,6 +144,11 @@ if [ -x $MONO_PREFIX/bin/mono -a -n "$mo
fi
#
+# --- pkgconfig requires
+[ -x /usr/lib/rpm/pkgconfigdeps.sh -a -n "$pkgconfiglist" ] &&
+ printf "%s\n" "${pkgconfiglist[@]}" | /usr/lib/rpm/pkgconfigdeps.sh -R | sort -u
+
+#
# --- Kernel module imported symbols
[ -x ${0%/*}/find-requires.ksyms ] &&
printf "%s\n" "${filelist[@]}" | ${0%/*}/find-requires.ksyms "$@"
++++++ getauxval.diff ++++++
commit 60835b20180c1be351ff95fa8c8d930afada0e4c
Author: Kirill A. Shutemov
Date: Mon Jul 1 03:25:32 2013 +0300
Use getauxval(3) to read auxv data
glibc >= 2.16 provides getauxval(): a reliable way to retrieve a value
from the auxiliary vector. It doesn't rely on /proc filesystem.
Let's switch to it and get rid of /proc dependency.
Signed-off-by: Kirill A. Shutemov
Signed-off-by: Panu Matilainen
--- configure.ac.orig 2013-07-12 12:25:38.000000000 +0000
+++ configure.ac 2013-07-12 12:35:18.000000000 +0000
@@ -518,6 +518,7 @@ dnl Checks for library functions.
AC_CHECK_FUNCS(putenv)
AC_CHECK_FUNCS(mempcpy)
AC_CHECK_FUNCS(fdatasync)
+AC_CHECK_FUNCS(getauxval)
AC_REPLACE_FUNCS(stpcpy stpncpy)
--- lib/rpmrc.c.orig 2013-07-12 12:25:38.000000000 +0000
+++ lib/rpmrc.c 2013-07-12 12:34:34.000000000 +0000
@@ -20,6 +20,10 @@
#define __power_pc() 0
#endif
+#ifdef HAVE_GETAUXVAL
+#include
+#endif
+
#include /* RPM_MACTABLE*, Rc-prototypes */
#include
#include
@@ -922,13 +926,19 @@ static int is_geode(void)
#if defined(__linux__) && defined(__powerpc__)
/**
- * Populate rpmat structure with parsed info from /proc/self/auxv
+ * Populate rpmat structure with auxv values
*/
-static void parse_auxv(void)
+static void read_auxv(void)
{
static int oneshot = 1;
if (oneshot) {
+#ifdef HAVE_GETAUXVAL
+ rpmat.platform = (char *) getauxval(AT_PLATFORM);
+ if (!rpmat.platform)
+ rpmat.platform = "";
+ rpmat.hwcap = getauxval(AT_HWCAP);
+#else
rpmat.platform = "";
int fd = open("/proc/self/auxv", O_RDONLY);
@@ -953,6 +963,7 @@ static void parse_auxv(void)
}
close(fd);
}
+#endif
oneshot = 0; /* only try once even if it fails */
}
return;
@@ -972,7 +983,7 @@ static void defaultMachine(const char **
#if defined(__linux__) && defined(__powerpc__)
/* Populate rpmat struct with hw info */
- parse_auxv();
+ read_auxv();
#endif
while (!gotDefaults) {
++++++ headeradddb.diff ++++++
Add rpmtsHeaderAddDB and rpmtsHeaderRemoveDB so that
convertdb1 will build again.
--- lib/rpmts.c.orig 2011-05-12 13:21:03.000000000 +0000
+++ lib/rpmts.c 2011-05-12 13:26:25.000000000 +0000
@@ -159,6 +159,24 @@ int rpmtsVerifyDB(rpmts ts)
return rc;
}
+int rpmtsHeaderAddDB(rpmts ts, Header h)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbAdd(rpmtsGetRdb(ts), h) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum)
+{
+ if (rpmtsOpenDB(ts, (O_RDWR|O_CREAT)))
+ return RPMRC_FAIL;
+ if (rpmdbRemove(rpmtsGetRdb(ts), hdrNum) != 0)
+ return RPMRC_FAIL;
+ return RPMRC_OK;
+}
+
/* keyp might no be defined. */
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
const void * keyp, size_t keylen)
--- lib/rpmts.h.orig 2011-05-12 13:21:11.000000000 +0000
+++ lib/rpmts.h 2011-05-12 13:28:32.000000000 +0000
@@ -264,6 +264,22 @@ int rpmtsRebuildDB(rpmts ts);
int rpmtsVerifyDB(rpmts ts);
/** \ingroup rpmts
+ * Add a header to the database used by the transaction.
+ * @param ts transaction set
+ * @param h header to add
+ * @return 0 on success
+ */
+int rpmtsHeaderAddDB(rpmts ts, Header h);
+
+/** \ingroup rpmts
+ * Remove a header from the database used by the transaction.
+ * @param ts transaction set
+ * @param hdrNum index of header to remove
+ * @return 0 on success
+ */
+int rpmtsHeaderRemoveDB(rpmts ts, unsigned int hdrNum);
+
+/** \ingroup rpmts
* Return transaction database iterator.
* @param ts transaction set
* @param rpmtag database index tag
++++++ headerchk2.diff ++++++
--- lib/header.c.orig 2012-04-03 13:29:24.000000000 +0000
+++ lib/header.c 2012-06-01 14:22:12.000000000 +0000
@@ -900,7 +900,8 @@ Header headerImport(void * blob, unsigne
rdlen += REGION_TAG_COUNT;
- if (rdlen != dl)
+ /* should be equality test, but can be off if entries are not perfectly aligned */
+ if (rdlen > dl)
goto errxit;
}
++++++ helperenv.diff ++++++
--- macros.in.orig 2012-04-18 13:48:07.000000000 +0000
+++ macros.in 2012-04-18 13:47:41.000000000 +0000
@@ -515,7 +515,7 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.ex
# %__myattr_exclude_magic exclude by magic regex
# %__myattr_exclude_path exclude by path regex
#
-%_fileattrsdir %{_rpmconfigdir}/fileattrs
+%_fileattrsdir %{__set_helper_env}%{_rpmconfigdir}/fileattrs
#==============================================================================
# ---- Database configuration macros.
++++++ ignore-auxv.diff ++++++
--- lib/rpmrc.c
+++ lib/rpmrc.c
@@ -79,10 +79,12 @@
int localize;
};
+#if defined(__linux__) && defined(__powerpc__)
static struct rpmat_s {
const char *platform;
uint64_t hwcap;
} rpmat;
+#endif
typedef struct defaultEntry_s {
char * name;
@@ -907,7 +909,7 @@
#endif
-#if defined(__linux__)
+#if defined(__linux__) && defined(__powerpc__)
/**
* Populate rpmat structure with parsed info from /proc/self/auxv
*/
@@ -957,7 +959,7 @@
canonEntry canon;
int rc;
-#if defined(__linux__)
+#if defined(__linux__) && defined(__powerpc__)
/* Populate rpmat struct with hw info */
parse_auxv();
#endif
++++++ ignore_poolstr_dummy_entries.diff ++++++
--- build/rpmfc.c.orig 2013-09-11 17:13:39.165560997 +0000
+++ build/rpmfc.c 2013-09-11 17:13:52.171560974 +0000
@@ -848,6 +848,8 @@ rpmRC rpmfcApply(rpmfc fc)
previx = -1;
for (rpmsid id = 1; id <= nddict; id++) {
s = rpmstrPoolStr(fc->ddict, id);
+ if (!s || !*s)
+ continue;
/* Parse out (file#,deptype,N,EVR,Flags) */
ix = strtol(s, &se, 10);
++++++ initscriptsprov.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-12-09 15:13:23.686700264 +0100
+++ autodeps/linux.prov 2011-12-09 15:13:23.733698039 +0100
@@ -101,4 +101,9 @@ fi
[ -x /usr/lib/rpm/gstreamer-provides ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u
+#
+# --- Provides of sysvinit scripts
+[ -x /usr/lib/rpm/sysvinitdeps.sh ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/sysvinitdeps.sh -P | sort -u
+
exit 0
Index: scripts/Makefile.am
===================================================================
--- scripts/Makefile.am.orig 2011-12-09 15:13:22.917736665 +0100
+++ scripts/Makefile.am 2011-12-09 15:13:23.733698039 +0100
@@ -21,6 +21,7 @@ EXTRA_DIST = \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
macros.perl macros.php macros.python
rpmconfig_SCRIPTS = \
@@ -37,6 +38,7 @@ rpmconfig_SCRIPTS = \
pkgconfigdeps.sh libtooldeps.sh \
ocaml-find-requires.sh ocaml-find-provides.sh \
fontconfig.prov desktop-file.prov script.req \
+ sysvinitdeps.sh \
rpmdb_loadcvt rpm2cpio.sh tcl.req tgpg
rpmconfig_DATA = \
Index: scripts/sysvinitdeps.sh
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ scripts/sysvinitdeps.sh 2011-12-09 15:13:23.733698039 +0100
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+[ "$1" = '-P' -o "$1" = '--provides' ] || {
+ cat > /dev/null
+ exit 0
+}
+
+while read file; do
+ case $file in
+ */etc/init.d/*)
+ provs=`grep '^# *Provides:' $file | sed 's,^.*:,,'`
+ for p in $provs; do
+ echo "sysvinit($p)"
+ done
+ ;;
+ esac
+done
++++++ installnoglob.diff ++++++
--- ./lib/rpminstall.c.orig 2014-12-10 16:39:12.987524435 +0000
+++ ./lib/rpminstall.c 2014-12-10 16:42:02.439772544 +0000
@@ -385,6 +385,19 @@ static int checkFreshenStatus(rpmts ts,
return (oldH != NULL);
}
+static int rpmNoGlob(const char *fn, int *argcPtr, ARGV_t * argvPtr)
+{
+ struct stat sb;
+ int rc = stat(fn, &sb);
+ if (rc == 0) {
+ argvAdd(argvPtr, fn);
+ *argcPtr = 1;
+ } else {
+ *argcPtr = 0;
+ }
+ return rc;
+}
+
/** @todo Generalize --freshen policies. */
int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
{
@@ -420,10 +433,18 @@ int rpmInstall(rpmts ts, struct rpmInsta
char * fn;
fn = rpmEscapeSpaces(*eiu->fnp);
- rc = rpmGlob(fn, &ac, &av);
+ if (giFlags & RPMGI_NOGLOB) {
+ rc = rpmNoGlob(fn, &ac, &av);
+ } else {
+ rc = rpmGlob(fn, &ac, &av);
+ }
fn = _free(fn);
if (rc || ac == 0) {
- rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), *eiu->fnp);
+ if (giFlags & RPMGI_NOGLOB) {
+ rpmlog(RPMLOG_ERR, _("File not found: %s\n"), *eiu->fnp);
+ } else {
+ rpmlog(RPMLOG_ERR, _("File not found by glob: %s\n"), *eiu->fnp);
+ }
eiu->numFailed++;
continue;
}
++++++ installprefix.diff ++++++
commit 88d24b14a8e0e33e768cb74a3487acf0925b012a
Author: Panu Matilainen
Date: Fri Jul 5 10:27:18 2013 +0300
Ensure relocatable packages always get install-prefix(es) set (RhBug:979443)
- Scriptlets from relocatable packages should always run with
$RPM_INSTALL_PREFIX* defined, whether actually being relocated or not.
- Fixes regression introduced by the optimization in commit
5d3018c4ed476b1b7ac18e2573af517f872cb303. We always need to call
addPrefixes() but return early from rpmRelocateFileList() when
no relocations are taking place, fixing the performance regression
introduced all the way back in cb8241dda783f7e8c143b08fecf57fe89a39c3a6
which is what 5d3018c4ed476b1b7ac18e2573af517f872cb303 was trying
to fix. Pooh :)
--- ./lib/rpmfi.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./lib/rpmfi.c 2013-12-19 15:00:52.808435567 +0000
@@ -793,7 +793,8 @@ static int addPrefixes(Header h, rpmRelo
headerPutStringArray(h, RPMTAG_INSTPREFIXES, actualRelocations, numActual);
}
free(actualRelocations);
- return numActual;
+ /* When any relocations are present there'll be more work to do */
+ return 1;
}
static void saveRelocs(Header h, rpmtd bnames, rpmtd dnames, rpmtd dindexes)
@@ -835,7 +836,8 @@ void rpmRelocateFileList(rpmRelocation *
int i, j;
struct rpmtd_s bnames, dnames, dindexes, fmodes;
- addPrefixes(h, relocations, numRelocations);
+ if (!addPrefixes(h, relocations, numRelocations))
+ return;
if (!_printed) {
_printed = 1;
--- ./lib/rpmte.c.orig 2012-11-18 08:21:42.000000000 +0000
+++ ./lib/rpmte.c 2013-12-19 15:00:52.808435567 +0000
@@ -98,7 +98,7 @@ static rpmfi getFI(rpmte p, Header h)
(RPMFI_NOHEADER | RPMFI_FLAGS_ERASE);
/* relocate stuff in header if necessary */
- if (rpmteType(p) == TR_ADDED && rpmfsFC(p->fs) > 0 && p->nrelocs) {
+ if (rpmteType(p) == TR_ADDED && rpmfsFC(p->fs) > 0) {
if (!headerIsSource(h) && !headerIsEntry(h, RPMTAG_ORIGBASENAMES)) {
rpmRelocateFileList(p->relocs, p->nrelocs, p->fs, h);
}
++++++ langnoc.diff ++++++
--- ./macros.in.orig 2012-06-01 14:10:18.000000000 +0000
+++ ./macros.in 2012-06-01 14:10:29.000000000 +0000
@@ -1204,6 +1204,7 @@ EOF
# %files -f %{name}.lang
#
%find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
+%no_lang_C --without-C
# Commands + opts to use for retrieving remote files
# Proxy opts can be set through --httpproxy/--httpport popt aliases,
--- ./scripts/find-lang.sh.orig 2012-06-01 14:10:18.000000000 +0000
+++ ./scripts/find-lang.sh 2012-06-01 14:14:47.000000000 +0000
@@ -62,6 +62,8 @@ MO=
MO_NAME=$NAME.lang
ALL_NAME=#
NO_ALL_NAME=
+ONLY_C=#
+NO_C=#
while test $# -gt 0 ; do
case "${1}" in
@@ -98,6 +100,14 @@ while test $# -gt 0 ; do
NO_ALL_NAME=#
shift
;;
+ --with-only-C )
+ ONLY_C=
+ shift
+ ;;
+ --without-C )
+ NO_C=
+ shift
+ ;;
* )
MO_NAME=${1}
shift
@@ -133,6 +143,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' > $MO_NAME_NEW
@@ -141,19 +153,23 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3\4/:
'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
find "$TOP_DIR" -type d|sed '
s:'"$TOP_DIR"'::
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%lang(C) %dir %doc \1:
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%lang(C) %dir %doc \1:
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -169,6 +185,8 @@ s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1:
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -181,6 +199,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -194,6 +214,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
fi
@@ -206,6 +228,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1:
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
s:^[^%].*::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -214,6 +238,8 @@ s:'"$TOP_DIR"'::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
@@ -221,6 +247,8 @@ find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d
+'"$NO_C"'/%lang(C)/d
s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW
++++++ lazystatfs.diff ++++++
Prefer sys/vfs.h, as statvfs stats all filesystems again
--- ./configure.ac.orig 2011-05-12 12:36:32.000000000 +0000
+++ ./configure.ac 2011-05-12 12:36:42.000000000 +0000
@@ -402,25 +402,25 @@ dnl
found_struct_statfs=no
if test X$found_struct_statfs = Xno ; then
-dnl Solaris 2.6+ wants to use statvfs
+dnl first try including sys/vfs.h
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
-#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
- AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
- [statfs in (for solaris 2.6+ systems)])
+#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
+ AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)])
found_struct_statfs=yes],[])
fi
if test X$found_struct_statfs = Xno ; then
-dnl first try including sys/vfs.h
+dnl Solaris 2.6+ wants to use statvfs
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#ifdef HAVE_SYS_TYPES_H
#include
#endif
-#include ]], [[struct statfs sfs;]])],[AC_MSG_RESULT(in sys/vfs.h)
- AC_DEFINE(STATFS_IN_SYS_VFS, 1, [statfs in (for linux systems)])
+#include ]], [[struct statvfs sfs;]])],[AC_MSG_RESULT(in sys/statvfs.h)
+ AC_DEFINE(STATFS_IN_SYS_STATVFS, 1,
+ [statfs in (for solaris 2.6+ systems)])
found_struct_statfs=yes],[])
fi
--- ./lib/transaction.c.orig 2011-05-12 12:36:55.000000000 +0000
+++ ./lib/transaction.c 2011-05-12 12:38:03.000000000 +0000
@@ -114,7 +114,11 @@ static rpmDiskSpaceInfo rpmtsCreateDSI(c
dsi->bneeded = 0;
dsi->ineeded = 0;
#ifdef STATFS_HAS_F_BAVAIL
+# ifdef ST_RDONLY
dsi->bavail = (sfb.f_flag & ST_RDONLY) ? 0 : sfb.f_bavail;
+# else
+ dsi->bavail = sfb.f_bavail;
+# endif
#else
/* FIXME: the statfs struct doesn't have a member to tell how many blocks are
* available for non-superusers. f_blocks - f_bfree is probably too big, but
++++++ localetag.diff ++++++
Convert output to the current locale. Assumes utf8 input if the
decoding works, otherwise iso-8859-1.
--- ./lib/tagexts.c.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./lib/tagexts.c 2011-05-10 16:05:30.000000000 +0000
@@ -2,6 +2,7 @@
* \file lib/formats.c
*/
+#include
#include "system.h"
#include
@@ -150,6 +151,114 @@ exit:
return rc;
}
+static char * strtolocale(char *str)
+{
+ wchar_t *wstr, *wp;
+ const unsigned char *cp;
+ char *cc;
+ int state = 0;
+ int c;
+ int ccl, cca, mb_cur_max;
+ size_t l;
+ mbstate_t ps;
+ int strisutf8 = 1;
+ int locisutf8 = 1;
+
+ if (!str)
+ return 0;
+ if (!*str)
+ return str;
+ wstr = (wchar_t *)xmalloc((strlen(str) + 1) * sizeof(*wstr));
+ wp = wstr;
+ cp = (const unsigned char *)str;
+ while ((c = *cp++) != 0) {
+ if (state) {
+ if ((c & 0xc0) != 0x80) {
+ /* encoding error */
+ break;
+ }
+ c = (c & 0x3f) | (state << 6);
+ if (!(state & 0x40000000)) {
+ /* check for overlong sequences */
+ if ((c & 0x820823e0) == 0x80000000)
+ c = 0xfdffffff;
+ else if ((c & 0x020821f0) == 0x02000000)
+ c = 0xfff7ffff;
+ else if ((c & 0x000820f8) == 0x00080000)
+ c = 0xffffd000;
+ else if ((c & 0x0000207c) == 0x00002000)
+ c = 0xffffff70;
+ }
+ } else {
+ /* new sequence */
+ if (c >= 0xfe)
+ c = 0xfffd;
+ else if (c >= 0xfc)
+ c = (c & 0x01) | 0xbffffffc; /* 5 bytes to follow */
+ else if (c >= 0xf8)
+ c = (c & 0x03) | 0xbfffff00; /* 4 */
+ else if (c >= 0xf0)
+ c = (c & 0x07) | 0xbfffc000; /* 3 */
+ else if (c >= 0xe0)
+ c = (c & 0x0f) | 0xbff00000; /* 2 */
+ else if (c >= 0xc2)
+ c = (c & 0x1f) | 0xfc000000; /* 1 */
+ else if (c >= 0xc0)
+ c = 0xfdffffff; /* overlong */
+ else if (c >= 0x80)
+ c = 0xfffd;
+ }
+ state = (c & 0x80000000) ? c : 0;
+ if (state)
+ continue;
+ *wp++ = (wchar_t)c;
+ }
+ if (state) {
+ /* encoding error, assume latin1 */
+ strisutf8 = 0;
+ cp = (const unsigned char *)str;
+ wp = wstr;
+ while ((c = *cp++) != 0) {
+ *wp++ = (wchar_t)c;
+ }
+ }
+ *wp = 0;
+ mb_cur_max = MB_CUR_MAX;
+ memset(&ps, 0, sizeof(ps));
+ cc = xmalloc(mb_cur_max);
+ /* test locale encoding */
+ if (wcrtomb(cc, 0x20ac, &ps) != 3 || memcmp(cc, "\342\202\254", 3))
+ locisutf8 = 0;
+ if (locisutf8 == strisutf8) {
+ wstr = _free(wstr);
+ return str;
+ }
+ str = _free((char *)str);
+ memset(&ps, 0, sizeof(ps));
+ ccl = cca = 0;
+ for (wp = wstr; ; wp++) {
+ l = wcrtomb(cc + ccl, *wp, &ps);
+ if (*wp == 0)
+ break;
+ if (l == (size_t)-1) {
+ if (*wp < (wchar_t)256 && mbsinit(&ps)) {
+ cc[ccl] = *wp;
+ l = 1;
+ } else
+ l = wcrtomb(cc + ccl, (wchar_t)'?', &ps);
+ }
+ if (l == 0 || l == (size_t)-1)
+ continue;
+ ccl += l;
+ if (ccl > cca) {
+ cca = ccl + 16;
+ cc = xrealloc(cc, cca + mb_cur_max);
+ }
+ }
+ wstr = _free(wstr);
+ return (char *)cc;
+}
+
/**
* Retrieve trigger info.
* @param h header
@@ -435,10 +544,41 @@ static int i18nTag(Header h, rpmTag tag,
#endif
rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (rc && td->data) {
+ td->data = strtolocale(td->data);
+ }
return rc;
}
/**
+ * Retrieve text and convert to locale.
+ */
+static int localeTag(Header h, rpmTag tag, rpmtd td)
+{
+ int rc;
+ rc = headerGet(h, tag, td, HEADERGET_ALLOC);
+ if (!rc)
+ return 0;
+ if (td->type == RPM_STRING_TYPE) {
+ td->data = strtolocale(td->data);
+ td->count = 1;
+ } else if (td->type == RPM_STRING_ARRAY_TYPE) {
+ char **arr;
+ int i;
+ arr = xmalloc(td->count * sizeof(*arr));
+ for (i = 0; i < td->count; i++) {
+ arr[i] = xstrdup(((char **)td->data)[i]);
+ arr[i] = strtolocale(arr[i]);
+ }
+ _free(td->data);
+ td->data = arr;
+ td->flags = RPMTD_ALLOCED | RPMTD_PTR_ALLOCED;
+ }
+ return rc;
+}
+
+
+/**
* Retrieve summary text.
* @param h header
* @retval td tag data container
@@ -460,6 +600,16 @@ static int descriptionTag(Header h, rpmt
return i18nTag(h, RPMTAG_DESCRIPTION, td, hgflags);
}
+static int changelognameTag(Header h, rpmtd td)
+{
+ return localeTag(h, RPMTAG_CHANGELOGNAME, td);
+}
+
+static int changelogtextTag(Header h, rpmtd td)
+{
+ return localeTag(h, RPMTAG_CHANGELOGTEXT, td);
+}
+
/**
* Retrieve group text.
* @param h header
@@ -677,6 +827,8 @@ static const struct headerTagFunc_s rpmH
{ RPMTAG_LONGARCHIVESIZE, longarchivesizeTag },
{ RPMTAG_LONGSIZE, longsizeTag },
{ RPMTAG_LONGSIGSIZE, longsigsizeTag },
+ { RPMTAG_CHANGELOGNAME, changelognameTag },
+ { RPMTAG_CHANGELOGTEXT, changelogtextTag },
{ RPMTAG_DBINSTANCE, dbinstanceTag },
{ RPMTAG_EVR, evrTag },
{ RPMTAG_NVR, nvrTag },
++++++ macrosin.diff ++++++
--- ./macros.in.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./macros.in 2013-07-12 11:53:07.000000000 +0000
@@ -185,22 +185,22 @@
# Template for debug information sub-package.
%debug_package \
-%ifnarch noarch\
%global __debug_package 1\
%package debuginfo\
Summary: Debug information for package %{name}\
Group: Development/Debug\
AutoReqProv: 0\
+#Requires: %{?!debug_package_requires:%{name} = %{version}-%{release}}%{?debug_package_requires}\
%description debuginfo\
This package provides debug information for package %{name}.\
Debug information is useful when developing applications that use this\
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
-%endif\
%{nil}
-%_defaultdocdir %{_datadir}/doc
+%_defaultdocdir %{_datadir}/doc/packages
+%_docdir_fmt %%{NAME}
%_defaultlicensedir %{_datadir}/licenses
# The path to the gzip executable (legacy, use %{__gzip} instead).
@@ -238,7 +238,8 @@ package or when debugging this package.\
%_tmppath %{_var}/tmp
# Path to top of build area.
-%_topdir %{getenv:HOME}/rpmbuild
+%_topdir %{expand:%%global _topdir %{lua:if posix.access(rpm.expand("%{_usrsrc}/packages"), "w") then print "%{_usrsrc}/packages" else print "%{getenv:HOME}/rpmbuild" end} \
+}%_topdir
# The path to the unzip executable (legacy, use %{__unzip} instead).
%_unzipbin %{__unzip}
@@ -341,7 +342,7 @@ package or when debugging this package.\
# "w7.lzdio" lzma-alone level 7, lzma's default
#
#%_source_payload w9.gzdio
-#%_binary_payload w9.gzdio
+%_binary_payload w5.lzdio
# Algorithm to use for generating file checksum digests on build.
# If not specified or 0, MD5 is used.
@@ -440,16 +441,22 @@ package or when debugging this package.\
# Directories whose contents should be considered as documentation.
%__docdir_path %{_datadir}/doc:%{_datadir}/man:%{_datadir}/info:%{_datadir}/gtk-doc/html:%{?_docdir}:%{?_mandir}:%{?_infodir}:%{?_javadocdir}:/usr/doc:/usr/man:/usr/info:/usr/X11R6/man
+# maxnum,cuttime,minnum
+# 2009/03/01 (SLES11 GA)
+%_binarychangelogtrim 0,1235862000,10
+
#
# Path to scripts to autogenerate package dependencies,
#
# Note: Used iff _use_internal_dependency_generator is zero.
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
-%__find_provides %{_rpmconfigdir}/find-provides
-%__find_requires %{_rpmconfigdir}/find-requires
+%__find_provides %{_rpmconfigdir}/find-provides %name
+%__find_requires %{_rpmconfigdir}/find-requires %name
#%__find_conflicts ???
#%__find_obsoletes ???
+#%__find_supplements ???
+#%__find_enhances ???
#
# Path to file attribute classifications for automatic dependency
@@ -512,10 +519,10 @@ package or when debugging this package.\
# Misc BDB tuning options
%__dbi_other mp_mmapsize=128Mb mp_size=1Mb
-%_dbi_config %{?__dbi_other}
+%_dbi_config %{?__dbi_other} nofsync
# "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd".
-%_dbi_config_Packages %{?_dbi_config} lockdbfd
+%_dbi_config_Packages %{?__dbi_other} lockdbfd
#==============================================================================
# ---- GPG/PGP/PGP5 signature macros.
@@ -816,7 +823,7 @@ package or when debugging this package.\
%_build_vendor %{_host_vendor}
%_build_os %{_host_os}
%_host @host@
-%_host_alias @host_alias@%{nil}
+%_host_alias @host@%{nil}
%_host_cpu @host_cpu@
%_host_vendor @host_vendor@
%_host_os @host_os@
@@ -980,6 +987,183 @@ done \
%python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")
%python_version %(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")
+# More useful perl macros (from Raul Dias )
+#
+%perl_version %(perl -V:version | sed "s!.*='!!;s!'.*!!")
+%perl_man1ext %(perl -V:man1ext | sed "s!.*='!!;s!'.*!!")
+%perl_man3ext %(perl -V:man3ext | sed "s!.*='!!;s!'.*!!")
+%perl_man1dir %(perl -V:man1dir | sed "s!.*='!!;s!'.*!!")
+%perl_man3dir %(perl -V:man3dir | sed "s!.*='!!;s!'.*!!")
+%perl_installman1dir %(perl -V:installman1dir | sed "s!.*='!!;s!'.*!!")
+%perl_installman3dir %(perl -V:installman3dir | sed "s!.*='!!;s!'.*!!")
+%perl_installarchlib %(perl -V:installarchlib | sed "s!.*='!!;s!'.*!!")
+%perl_prefix %{buildroot}
+
+#------------------------------------------------------------------------------
+# Python specific macro definitions (originally from PLD).
+#
+%py_ver %(python -c "import sys; v=sys.version_info[:2]; print '%%d.%%d'%%v" 2>/dev/null || echo PYTHON-NOT-FOUND)
+%py_prefix %(python -c "import sys; print sys.prefix" 2>/dev/null || echo PYTHON-NOT-FOUND)
+%py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
+%py_incdir %{py_prefix}/include/python%{py_ver}
+%py_sitedir %{py_libdir}/site-packages
+%py_compile(O) \
+find %1 -name '*.pyc' -exec rm -f {} \\; \
+python -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
+%{-O: \
+find %1 -name '*.pyo' -exec rm -f {} \\; \
+python -O -c "import sys, os, compileall; br='%{buildroot}'; compileall.compile_dir(sys.argv[1], ddir=br and (sys.argv[1][len(os.path.abspath(br)):]+'/') or None)" %1 \
+}
+%py_requires(d) \
+%define minver %py_ver \
+%define maxver %(python -c "import sys; a,b=sys.version_info[:2]; print '%%d.%%d'%%(a,b+1)" 2>/dev/null || echo PYTHON-NOT-FOUND) \
+BuildRequires: python %{-d:python-devel} \
+PreReq: python >= %minver, python < %maxver
+
+#------------------------------------------------------------------------------
+#
+# RPM macros for Java applications.
+#
+# JPackage Project http://www.jpackage.org/
+# David Walluck
+# Ville Skytt�
+# Nicolas Mailhot
+#
+# $Id: macros.jpackage,v 1.1.2.5 2003/08/30 13:24:58 scop Exp $
+#
+
+# ---- default Java directories
+
+#
+# Root directory where all Java VMs/SDK/JREs are installed.
+#
+%_jvmdir %{_libdir}/jvm
+
+#
+# Root directory where all Java VMs/SDK/JREs expose their jars
+#
+%_jvmjardir %{_libdir}/jvm-exports
+
+#
+# Root directory for all Java VM/SDK/JRE's private things.
+#
+%_jvmprivdir %{_libdir}/jvm-private
+
+#
+# Directory where arch and version independent jars are installed.
+# This has already been integrated in RH macros following our request.
+#
+# By extension:
+# %{_javadir}-ext:
+# - version dependent jars
+# %{_javadir}-x.y.z:
+# - jars for Java standard x.y.z (usually symlinks to %{_javadir}-ext)
+# %{_javadir}-utils:
+# - Java-related scripts
+#
+# To simplify things only %{_javadir} is defined.
+#
+%_javadir %{_datadir}/java
+
+#
+# Directory where arch-specific (JNI) version-independent jars are installed.
+#
+# By extension:
+# %{_jnidir}-ext:
+# - version dependent jars
+# %{_jnidir}-x.y.z:
+# - jars for Java standard x.y.z (usually symlinks to %{_jnidir}-ext)
+# To simplify things only %{_jnidir} is defined.
+#
+%_jnidir %{_libdir}/java
+
+#
+# Root directory where all javadoc is installed. Also already in RH macros.
+#
+%_javadocdir %{_datadir}/javadoc
+
+#
+# Current default JVM home.
+#
+%java_home %(. %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
+
+# ---- default Java commands
+
+%ant JAVA_HOME=%{java_home} ant
+%jar %{java_home}/bin/jar
+%java %(. %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
+%javac %{java_home}/bin/javac
+%javadoc %{java_home}/bin/javadoc
+
+# ---- Java extension handling macros
+
+#
+# add_jvm_extension should be used in %install by extension packages to declare
+# what extension jars they provide.
+#
+# For example a package that provides foo.jar which is the bar extension
+# under java 1.2 and 1.3 should do a:
+#
+# %install
+# ... # create foo.jar in %{javadir}-ext
+# %add_jvm_extension foo bar 1.2 1.3
+#
+# %files
+# %{javadir}-ext/foo.jar
+# %{javadir}-*/bar.jar
+#
+%add_jvm_extension JAVA_LIBDIR=%{buildroot}/%{_javadir} %{_bindir}/jvmjar -l
+
+#
+# Standard JPackage script
+#
+# This is kind of tasteless and should be moved to an external template
+#
+# %1 main class
+# %2 flags
+# %3 options
+# %4 jars (separated by ':')
+# %5 the name of script you wish to create
+# %6 whether to prefer a jre over a sdk when finding a jvm
+#
+%jpackage_script() \
+install -d -m 755 $RPM_BUILD_ROOT%{_bindir}\
+cat > $RPM_BUILD_ROOT%{_bindir}/%5 << EOF \
+#!/bin/sh\
+#\
+# %{name} script\
+# JPackage Project http://www.jpackage.org/\
+\
+# Source functions library\
+_prefer_jre="%{?6}"\
+. %{_javadir}-utils/java-functions\
+\
+# Source system prefs\
+if [ -f %{_sysconfdir}/java/%{name}.conf ] ; then\
+ . %{_sysconfdir}/java/%{name}.conf\
+fi\
+\
+# Source user prefs\
+if [ -f \\$HOME/.%{name}rc ] ; then\
+ . \\$HOME/.%{name}rc\
+fi\
+\
+# Configuration\
+MAIN_CLASS=%1\
+BASE_FLAGS=%2\
+BASE_OPTIONS=%3\
+BASE_JARS="%(echo %4 | sed -e 's,:, ,g')"\
+\
+# Set parameters\
+set_jvm\
+set_classpath \\$BASE_JARS\
+set_flags \\$BASE_FLAGS\
+set_options \\$BASE_OPTIONS\
+\
+# Let's start\
+run "\\$@"\
+EOF
+
#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatibile processors
# (Note: This macro (and it's analogues) will probably be obsoleted when
@@ -990,7 +1174,9 @@ done \
#------------------------------------------------------------------------------
# arch macro for all supported ARM processors
-%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
+%arm armv3l armv4b armv4l armv4tl armv5b armv5l armv5teb armv5tel armv5tejl armv6l armv6hl armv7l armv7hl
+%arml armv3l armv4l armv5l armv5tel armv6l armv7l armv7hl
+%armb armv4b armv5b armv5teb
#------------------------------------------------------------------------------
# arch macro for all supported Sparc processors
@@ -1110,3 +1296,26 @@ end}
# \endverbatim
#*/
+
+
+#------------------------------------------------------------------------
+# standard build service macros
+#
+%ext_info .gz
+%ext_man .gz
+
+%info_add() test -x /sbin/install-info -a -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%info_del() test -x /sbin/install-info -a ! -f %{?2}%{?!2:%{_infodir}}/%{1}%ext_info && /sbin/install-info --quiet --delete --info-dir=%{?2}%{?!2:%{_infodir}} %{?2}%{?!2:%{_infodir}}/%{1}%ext_info \
+%{nil}
+
+%service_add() %{fillup_and_insserv %{1}}
+%service_del_preun() %{stop_on_removal %{1}}
+%service_del_postun() %{restart_on_update %{1}}
+
+%user_group_add() \
+/usr/sbin/groupadd -r %{1} 2>/dev/null || :\
+/usr/sbin/useradd -r -g %{1} -d %{2} -s %{3} -c %{4} %{1} 2>/dev/null || :\
+%{nil}
+
++++++ modalias-encode.diff ++++++
Module aliases (modinfo -F alias <module>) may contain special characters
that rpm does not allow in dependencies, such as commas. Encode those as
%XX to avoid generating broken dependencies.
Signed-off-by: Andreas Gruenbacher
Index: rpm-4.4.2.3/scripts/find-supplements.ksyms
===================================================================
--- scripts/find-supplements.ksyms
+++ scripts/find-supplements.ksyms
@@ -48,6 +48,21 @@ combine_modaliases() {
print_modaliases "$class" "$variants" "$pos"
}
+# Encode all characters other than [*:a-zA-Z0-9] in stdin as %XX.
+# (This includes the % character itself, which becomes %25.)
+hexenc() {
+ local line hex
+
+ while read line; do
+ set -- "" "$line"
+ while [[ "$2" =~ ([*:a-zA-Z0-9]*)([^*:a-zA-Z0-9])(.*) ]]; do
+ hex=$(echo -n "${BASH_REMATCH[2]}" | hexdump -e '"%X"')
+ set -- "$1${BASH_REMATCH[1]}%$hex" "${BASH_REMATCH[3]}"
+ done
+ echo "$1$2"
+ done
+}
+
aliases_of_filelist() {
modlist=$(mktemp)
have_module=1
@@ -60,6 +75,7 @@ aliases_of_filelist() {
fi
have_module=0
/sbin/modinfo -F alias "$module" \
+ | hexenc \
| sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p" | tee -a $modlist
done
if ! test -s "$modlist" && test $have_module = 0; then
++++++ modalias-kernel_module.diff ++++++
Index: scripts/find-supplements.ksyms
===================================================================
--- scripts/find-supplements.ksyms.orig
+++ scripts/find-supplements.ksyms
@@ -1,6 +1,8 @@
#! /bin/sh
+SPECFILE=${RPMBUILD_SPECFILE:-/usr/src/packages/SOURCES/$1.spec}
IFS=$'\n'
+PACKAGE=$1
case "$1" in
kernel-module-*) ;; # Fedora kernel module package names start with
@@ -46,11 +48,54 @@ combine_modaliases() {
print_modaliases "$class" "$variants" "$pos"
}
-for module in $(grep -E '/lib/modules/.+\.ko$'); do
- vermagic=$(/sbin/modinfo -F vermagic "$module")
- krel=${vermagic%% *}
- /sbin/modinfo -F alias "$module" \
- | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
-done \
+aliases_of_filelist() {
+ modlist=$(mktemp)
+ have_module=1
+ for module in $(grep -E '/lib/modules/.+\.ko$'); do
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
+ krel=${vermagic%% *}
+ if ! test -x /sbin/modinfo; then
+ echo "ERROR: add module-init-tools to BuildRequires" >&2
+ exit 1
+ fi
+ have_module=0
+ /sbin/modinfo -F alias "$module" \
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p" | tee -a $modlist
+ done
+ if ! test -s "$modlist" && test $have_module = 0; then
+ echo "packageand(kernel-${krel##*-}:$PACKAGE)"
+ fi
+ rm -f $modlist
+}
+
+aliases_of_specfile_macro() {
+ declare regex
+
+ regex=$(
+ set -o noglob
+ set -- $(sed -ne 's:^%supplements_kernel_module[ \t]::p' \
+ $SPECFILE)
+ while [ $# -ge 1 ]; do
+ regex=$(echo "$1" \
+ | sed -e 's:[.]:\\.:g' \
+ -e 's:?:.:g' \
+ -e 's:\*:.*:g' \
+ -e 's:\\:\\\\:g')
+ echo -n "^$regex\$"
+ [ $# -ge 2 ] && echo -n "|"
+ shift
+ done
+ )
+
+ if [ -n "$regex" ]; then
+ awk '
+ $1 == "alias" && $3 ~ regex { print $2 }
+ ' regex="$regex" /lib/modules/*/modules.alias
+ fi
+}
+
+( aliases_of_filelist
+ aliases_of_specfile_macro "$1"
+) \
| sort -u \
| combine_modaliases
++++++ modalias.diff ++++++
--- ./macros.in.orig 2011-05-11 14:57:08.000000000 +0000
+++ ./macros.in 2011-05-11 15:01:39.000000000 +0000
@@ -470,14 +470,18 @@ print (t)\
#
# Path to scripts to autogenerate package dependencies,
#
+%__set_helper_env %{lua:
+posix.setenv("RPMBUILD_SPECFILE",rpm.expand("%?_specfile"));
+posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
+}
# Note: Used iff _use_internal_dependency_generator is zero.
#%__find_provides %{_rpmconfigdir}/rpmdeps --provides
#%__find_requires %{_rpmconfigdir}/rpmdeps --requires
-%__find_provides %{_rpmconfigdir}/find-provides %name
-%__find_requires %{_rpmconfigdir}/find-requires %name
+%__find_provides %{__set_helper_env}%{_rpmconfigdir}/find-provides %name
+%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name
#%__find_conflicts ???
#%__find_obsoletes ???
-#%__find_supplements ???
+%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name
#%__find_enhances ???
#
--- ./scripts/find-supplements.ksyms.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements.ksyms 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,56 @@
+#! /bin/sh
+
+IFS=$'\n'
+
+case "$1" in
+kernel-module-*) ;; # Fedora kernel module package names start with
+ # kernel-module.
+kernel*) is_kernel_package=1 ;;
+esac
+
+if ! [ -z "$is_kernel_package" ]; then
+ cat > /dev/null
+ exit 0
+fi
+
+print_modaliases() {
+ declare class=$1 variants=$2 pos=$3
+ if [ -n "$variants" ]; then
+ echo "${class:0:pos}[$variants]${class:pos+1}"
+ else
+ [ -z "$class" ] || echo "$class"
+ fi
+}
+
+combine_modaliases() {
+ declare tag class variants pos n
+ read class
+ while read tag; do
+ for ((n=0; n<${#class}; n++)); do
+ if [ "*" != "${class:n:1}" -a \
+ "${class:0:n}" = "${tag:0:n}" -a \
+ "${class:n+1}" = "${tag:n+1}" ] &&
+ ( [ -z "$pos" ] || [ $n = $pos ] ); then
+ variants="${variants:-${class:n:1}}${tag:n:1}"
+ pos=$n
+ break
+ fi
+ done
+ if [ $n -eq ${#class} ]; then
+ print_modaliases "$class" "$variants" "$pos"
+ variants=
+ pos=
+ class=$tag
+ fi
+ done
+ print_modaliases "$class" "$variants" "$pos"
+}
+
+for module in $(grep -E '/lib/modules/.+\.ko$'); do
+ vermagic=$(/sbin/modinfo -F vermagic "$module")
+ krel=${vermagic%% *}
+ /sbin/modinfo -F alias "$module" \
+ | sed -nre "s,(.+:.+),modalias(kernel-${krel##*-}:\\1),p"
+done \
+| sort -u \
+| combine_modaliases
--- ./scripts/find-supplements.orig 2011-05-11 15:01:39.000000000 +0000
+++ ./scripts/find-supplements 2011-05-11 15:01:39.000000000 +0000
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+# This script reads filenames from STDIN and outputs any relevant provides
+# information that needs to be included in the package.
+IFS=$'\n'
+filelist=($(cat))
+
+#
+# --- Kernel module hardware identifiers
+# (e.g., modalias(pci:v0000109Ed00000878sv00000070sd0000FF01bc*sc*i*)
+[ -x /usr/lib/rpm/find-supplements.ksyms ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-supplements.ksyms "$@"
+
+exit 0
++++++ mono-find-requires.diff ++++++
--- scripts/mono-find-requires
+++ scripts/mono-find-requires
@@ -42,8 +42,12 @@
(START==1) && /^\tName=/ {
sub(/Name=/, "", $1);
LIBNAME=$1
-
- print "mono(" LIBNAME ") = " VERSION
+ # Allow rpm deps to be resolved for 1.0 profile version
+ if (VERSION=="1.0.3300.0")
+ OP=">="
+ else
+ OP="="
+ print "mono(" LIBNAME ") " OP " " VERSION
START=0
}
') 2> /dev/null
++++++ nameversioncompare.diff ++++++
Also compare the name and not only the version when checking if
two packages are the same. rh#104066
--- ./lib/depends.c.orig 2012-06-01 10:07:12.000000000 +0000
+++ ./lib/depends.c 2012-06-01 10:16:13.000000000 +0000
@@ -144,6 +144,24 @@ static int skipColor(rpm_color_t tscolor
return tscolor && color && ocolor && !(color & ocolor);
}
+static int rpmNameVersionCompare(Header first, Header second)
+{
+ const char * one, * two;
+ int rc;
+
+ one = headerGetString(first, RPMTAG_NAME);
+ two = headerGetString(second, RPMTAG_NAME);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ one = headerGetString(first, RPMTAG_ARCH);
+ two = headerGetString(second, RPMTAG_ARCH);
+ rc = strcmp(one, two);
+ if (rc)
+ return rc;
+ return rpmVersionCompare(first, second);
+}
+
/* Add erase elements for older packages of same color (if any). */
static int addUpgradeErasures(rpmts ts, rpm_color_t tscolor,
rpmte p, rpm_color_t hcolor, Header h)
@@ -157,8 +175,8 @@ static int addUpgradeErasures(rpmts ts,
if (skipColor(tscolor, hcolor, headerGetNumber(oh, RPMTAG_HEADERCOLOR)))
continue;
- /* Skip packages that contain identical NEVR. */
- if (rpmVersionCompare(h, oh) == 0)
+ /* Skip packages that contain identical NEVRA. */
+ if (rpmNameVersionCompare(h, oh) == 0)
continue;
if (removePackage(ts, oh, p)) {
++++++ nobuildcolor.diff ++++++
Disable file coloring for SUSE systems
--- build/rpmfc.c.orig 2013-07-12 12:12:45.000000000 +0000
+++ build/rpmfc.c 2013-07-12 12:15:51.000000000 +0000
@@ -1305,7 +1305,8 @@ rpmRC rpmfcGenerateDepends(const rpmSpec
/* XXX Make sure only primary (i.e. Elf32/Elf64) colors are added. */
for (int i = 0; i < fc->nfiles; i++)
fc->fcolor[i] &= 0x0f;
- headerPutUint32(pkg->header, RPMTAG_FILECOLORS, fc->fcolor, fc->nfiles);
+ if (rpmExpandNumeric("%{?_transaction_color}") != 0)
+ headerPutUint32(pkg->header, RPMTAG_FILECOLORS, fc->fcolor, fc->nfiles);
/* Add classes(#classes) */
for (rpmsid id = 1; id <= rpmstrPoolNumStr(fc->cdict); id++) {
++++++ nomagiccheck.diff ++++++
Don't let rpm complain about a missing /etc/magic.mgc file
--- build/rpmfc.c.orig 2013-07-12 12:16:40.000000000 +0000
+++ build/rpmfc.c 2013-07-12 12:17:15.000000000 +0000
@@ -901,7 +901,7 @@ static int initAttrs(rpmfc fc)
rpmRC rpmfcClassify(rpmfc fc, ARGV_t argv, rpm_mode_t * fmode)
{
- int msflags = MAGIC_CHECK | MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
+ int msflags = MAGIC_COMPRESS | MAGIC_NO_CHECK_TOKENS;
magic_t ms = NULL;
rpmRC rc = RPMRC_FAIL;
++++++ noposttrans.diff ++++++
Author: Panu Matilainen
Date: Wed Apr 10 11:31:41 2013 +0300
Add scriptlet-specific disablers for %pretrans and %posttrans
- Previously %pretrans and %posttrans were tied to --nopre and --nopost
disablers (since commit 0b2d7775c5e828652e45829f551352b93890bbc8)
because back then, there was no room new disablers in rpmtransFlags
bitfield. This is no longer the case as of rpm >= 4.9.x where
a bunch of obsolete flags were axed, so we can now add specific
--nopretrans and --noposttrans switches + corresponding flags.
- This is obviously a behavior change as --nopre and --nopost no
longer affect %pretrans and %posttrans, but --noscripts behavior
remains the same.
--- doc/rpm.8
+++ doc/rpm.8
@@ -278,6 +278,10 @@ packages would normally be reordered to satisfy dependencies.
\fB--nopreun\fR
.TP
\fB--nopostun\fR
+.TP
+\fB--nopretrans\fR
+.TP
+\fB--noposttrans\fR
Don't execute the scriptlet of the same name.
The \fB--noscripts\fR option is equivalent to
@@ -285,12 +289,16 @@ The \fB--noscripts\fR option is equivalent to
\fB--nopost\fR
\fB--nopreun\fR
\fB--nopostun\fR
+\fB--nopretrans\fR
+\fB--noposttrans\fR
and turns off the execution of the corresponding
\fB%pre\fR,
\fB%post\fR,
-\fB%preun\fR, and
+\fB%preun\fR,
\fB%postun\fR
+\fB%pretrans\fR, and
+\fB%posttrans\fR
scriptlet(s).
.TP
\fB--notriggers\fR
--- lib/poptI.c
+++ lib/poptI.c
@@ -202,6 +202,12 @@ struct poptOption rpmInstallPoptTable[] = {
{ "nopostun", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
RPMTRANS_FLAG_NOPOSTUN,
N_("do not execute %%postun scriptlet (if any)"), NULL },
+ { "nopretrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
+ RPMTRANS_FLAG_NOPRETRANS,
+ N_("do not execute %%pretrans scriptlet (if any)"), NULL },
+ { "noposttrans", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &rpmIArgs.transFlags,
+ RPMTRANS_FLAG_NOPOSTTRANS,
+ N_("do not execute %%posttrans scriptlet (if any)"), NULL },
{ "notriggers", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, _noTransTriggers,
N_("do not execute any scriptlet(s) triggered by this package"), NULL},
--- lib/rpmts.h
+++ lib/rpmts.h
@@ -45,7 +45,8 @@ enum rpmtransFlags_e {
RPMTRANS_FLAG_NOPREUN = (1 << 21), /*!< from --nopreun */
RPMTRANS_FLAG_NOPOSTUN = (1 << 22), /*!< from --nopostun */
RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23), /*!< from --notriggerpostun */
- /* bits 24-25 unused */
+ RPMTRANS_FLAG_NOPRETRANS = (1 << 24), /*!< from --nopretrans */
+ RPMTRANS_FLAG_NOPOSTTRANS = (1 << 25), /*!< from --noposttrans */
RPMTRANS_FLAG_NOCOLLECTIONS = (1 << 26), /*!< from --nocollections */
RPMTRANS_FLAG_NOMD5 = (1 << 27), /*!< from --nomd5 */
RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27), /*!< from --nofiledigest (alias to --nomd5) */
@@ -60,7 +61,9 @@ typedef rpmFlags rpmtransFlags;
( RPMTRANS_FLAG_NOPRE | \
RPMTRANS_FLAG_NOPOST | \
RPMTRANS_FLAG_NOPREUN | \
- RPMTRANS_FLAG_NOPOSTUN \
+ RPMTRANS_FLAG_NOPOSTUN | \
+ RPMTRANS_FLAG_NOPRETRANS | \
+ RPMTRANS_FLAG_NOPOSTTRANS \
)
#define _noTransTriggers \
--- lib/transaction.c
+++ lib/transaction.c
@@ -1496,7 +1496,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
/* 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))
+ if (!((rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRETRANS))
|| (rpmpsNumProblems(tsprobs)))) {
rpmlog(RPMLOG_DEBUG, "running pre-transaction scripts\n");
runTransScripts(ts, PKG_PRETRANS);
@@ -1532,7 +1532,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
rc = rpmtsProcess(ts) ? -1 : 0;
/* Run post-transaction scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOST))) {
+ if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_NOPOSTTRANS))) {
rpmlog(RPMLOG_DEBUG, "running post-transaction scripts\n");
runTransScripts(ts, PKG_POSTTRANS);
}
--- python/rpmmodule.c
+++ python/rpmmodule.c
@@ -414,6 +414,8 @@ static int initModule(PyObject *m)
REGISTER_ENUM(RPMTRANS_FLAG_NOPREUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTUN);
REGISTER_ENUM(RPMTRANS_FLAG_NOTRIGGERPOSTUN);
+ REGISTER_ENUM(RPMTRANS_FLAG_NOPRETRANS);
+ REGISTER_ENUM(RPMTRANS_FLAG_NOPOSTTRANS);
REGISTER_ENUM(RPMTRANS_FLAG_NOMD5);
REGISTER_ENUM(RPMTRANS_FLAG_NOFILEDIGEST);
REGISTER_ENUM(RPMTRANS_FLAG_NOSUGGEST);
++++++ noprereqdeprec.diff ++++++
Not deprecated for SUSE builds.
--- ./build/parsePreamble.c.orig 2011-05-11 15:59:08.000000000 +0000
+++ ./build/parsePreamble.c 2011-05-11 16:35:47.000000000 +0000
@@ -891,7 +891,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_ICON, 0, 0, LEN_AND_STR("icon")},
{RPMTAG_PROVIDEFLAGS, 0, 0, LEN_AND_STR("provides")},
{RPMTAG_REQUIREFLAGS, 2, 0, LEN_AND_STR("requires")},
- {RPMTAG_PREREQ, 2, 1, LEN_AND_STR("prereq")},
+ {RPMTAG_PREREQ, 2, 0, LEN_AND_STR("prereq")},
{RPMTAG_CONFLICTFLAGS, 0, 0, LEN_AND_STR("conflicts")},
{RPMTAG_OBSOLETEFLAGS, 0, 0, LEN_AND_STR("obsoletes")},
{RPMTAG_PREFIXES, 0, 0, LEN_AND_STR("prefixes")},
@@ -900,7 +900,7 @@ static struct PreambleRec_s const preamb
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarchitectures")},
{RPMTAG_BUILDARCHS, 0, 0, LEN_AND_STR("buildarch")},
{RPMTAG_BUILDCONFLICTS, 0, 0, LEN_AND_STR("buildconflicts")},
- {RPMTAG_BUILDPREREQ, 0, 1, LEN_AND_STR("buildprereq")},
+ {RPMTAG_BUILDPREREQ, 0, 0, LEN_AND_STR("buildprereq")},
{RPMTAG_BUILDREQUIRES, 0, 0, LEN_AND_STR("buildrequires")},
{RPMTAG_AUTOREQPROV, 0, 0, LEN_AND_STR("autoreqprov")},
{RPMTAG_AUTOREQ, 0, 0, LEN_AND_STR("autoreq")},
++++++ perlprov.diff ++++++
Support a "first version wins" semantics.
--- ./scripts/perl.prov.orig 2010-12-03 12:11:57.000000000 +0000
+++ ./scripts/perl.prov 2011-05-11 15:32:39.000000000 +0000
@@ -170,7 +170,7 @@ sub process_file {
$version = $1;
}
- $require{$package} = $version;
+ $require{$package} ||= $version;
}
# Allow someone to have a variable that defines virtual packages
++++++ platformin.diff ++++++
SUSE specific platform changes.
--- ./platform.in.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./platform.in 2012-06-01 12:42:30.000000000 +0000
@@ -29,7 +29,7 @@
%_exec_prefix @exec_prefix@
%_bindir @bindir@
%_sbindir @sbindir@
-%_libexecdir @libexecdir@
+%_libexecdir %{_exec_prefix}/lib
%_datarootdir @datarootdir@
%_datadir @datadir@
%_sysconfdir @sysconfdir@
@@ -41,7 +41,7 @@
%_oldincludedir @oldincludedir@
%_infodir @infodir@
%_mandir @mandir@
-%_initddir %{_sysconfdir}/rc.d/init.d
+%_initddir %{_sysconfdir}/init.d
# Deprecated misspelling, present for backwards compatibility.
%_initrddir %{_initddir}
@@ -78,3 +78,21 @@
@apple@#
@apple@%_use_internal_dependency_generator 0
@apple@%__so dylib
+@suse@#---------------------------------------------------------------------
+@suse@# Expanded at end of %prep
+@suse@#
+@suse@%__id_u %{__id} -u
+@suse@%__chown_Rhf %{__chown} -Rhf
+@suse@%__chgrp_Rhf %{__chgrp} -Rhf
+@suse@%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root
+@suse@%_fixgroup [ `%{__id_u}` = '0' ] && %{__chgrp_Rhf} root
+@suse@%_fixperms %{__chmod} -Rf @FIXPERMS@
+@suse@
+@suse@#---------------------------------------------------------------------
+@suse@# Expanded at start of %build
+@suse@#
+@suse@%__spec_build_pre %{___build_pre}\
+@suse@%{?buildroot: %__rm -rf "$RPM_BUILD_ROOT"\
+@suse@ %__mkdir_p `dirname "$RPM_BUILD_ROOT"`\
+@suse@ %__mkdir "$RPM_BUILD_ROOT"\
+@suse@}
++++++ psm-errno.diff ++++++
--- lib/psm.c.orig 2013-07-12 12:25:38.000000000 +0000
+++ lib/psm.c 2013-07-12 12:27:01.000000000 +0000
@@ -807,6 +807,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
case PSM_PROCESS:
if (psm->goal == PKG_INSTALL) {
int fsmrc = 0;
+ int saved_errno = 0;
rpmpsmNotify(psm, RPMCALLBACK_INST_START, 0);
/* make sure first progress call gets made */
@@ -826,6 +827,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
fsmrc = rpmPackageFilesInstall(psm->ts, psm->te, psm->fi,
payload, psm, &psm->failedFile);
+ saved_errno = errno;
rpmswAdd(rpmtsOp(psm->ts, RPMTS_OP_UNCOMPRESS),
fdOp(payload, FDSTAT_READ));
@@ -843,6 +845,7 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
rpmpsmNotify(psm, RPMCALLBACK_INST_STOP, psm->total);
if (fsmrc) {
+ errno = saved_errno;
rpmlog(RPMLOG_ERR,
_("unpacking of archive failed%s%s: %s\n"),
(psm->failedFile != NULL ? _(" on file ") : ""),
++++++ python3-abi-kind.diff ++++++
--- configure.ac
+++ configure.ac
@@ -537,7 +537,7 @@
])
CPPFLAGS="$save_CPPFLAGS"
save_LIBS="$LIBS"
- AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION} python],[
+ AC_SEARCH_LIBS([Py_Main],[python${PYTHON_VERSION}mu python${PYTHON_VERSION} python],[
WITH_PYTHON_LIB="$ac_res"
],[AC_MSG_ERROR([missing python library])
])
++++++ pythondeps.diff ++++++
Index: autodeps/linux.prov
===================================================================
--- autodeps/linux.prov.orig 2011-06-08 13:31:39.000000000 +0200
+++ autodeps/linux.prov 2011-06-08 13:31:39.191646314 +0200
@@ -11,7 +11,7 @@ filelist=($(printf "%s\n" "${filelist[@]
solist=($(printf "%s\n" "${filelist[@]}" | grep "\\.so" | grep -v "^/lib/ld.so" | \
tr '\n' '\0' | xargs -0 -r file -L | grep "ELF.*shared object" | \
cut -d: -f1))
-pythonlist=
+pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/bin/python.\..$'))
tcllist=
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
firmwarelist=($(printf "%s\n" "${filelist[@]}" | grep "/lib/firmware/"))
@@ -54,8 +54,8 @@ done | sort -u
#
# --- Python modules.
-[ -x /usr/lib/rpm/python.prov -a -n "$pythonlist" ] &&
- printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.prov | sort -u
+[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] &&
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -P | sort -u
#
# --- Tcl modules.
Index: autodeps/linux.req
===================================================================
--- autodeps/linux.req.orig 2011-06-08 13:31:38.000000000 +0200
+++ autodeps/linux.req 2011-06-08 13:31:39.191646314 +0200
@@ -31,7 +31,7 @@ liblist=($(printf "%s\0" "${filelist[@]}
interplist=()
perllist=()
-pythonlist=()
+pythonlist=($(printf "%s\n" "${filelist[@]}" | egrep '/usr/lib[^/]*/python.\..'))
tcllist=()
monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)(\\.config)?\$"))
@@ -127,8 +127,8 @@ done | sort -u
#
# --- Python modules.
-[ -x /usr/lib/rpm/python.req -a -n "$pythonlist" ] && \
- printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/python.req | sort -u
+[ -x /usr/lib/rpm/pythondeps.sh -a -n "$pythonlist" ] && \
+ printf "%s\n" "${pythonlist[@]}" | /usr/lib/rpm/pythondeps.sh -R | sort -u
#
# --- Tcl modules.
++++++ refreshtestarch.diff ++++++
Also test architecture in "refresh" test when not colored. This allows
updates to different architectures.
--- ./lib/psm.c.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./lib/psm.c 2012-06-01 10:22:24.000000000 +0000
@@ -680,13 +680,14 @@ void rpmpsmNotify(rpmpsm psm, int what,
*/
static void markReplacedInstance(rpmts ts, rpmte te)
{
+ /* this must match rpmNameVersionCompare in depends.c */
rpmdbMatchIterator mi = rpmtsInitIterator(ts, RPMDBI_NAME, rpmteN(te), 0);
rpmdbSetIteratorRE(mi, RPMTAG_EPOCH, RPMMIRE_STRCMP, rpmteE(te));
rpmdbSetIteratorRE(mi, RPMTAG_VERSION, RPMMIRE_STRCMP, rpmteV(te));
rpmdbSetIteratorRE(mi, RPMTAG_RELEASE, RPMMIRE_STRCMP, rpmteR(te));
+ rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP, rpmteA(te));
/* XXX shouldn't we also do this on colorless transactions? */
if (rpmtsColor(ts)) {
- rpmdbSetIteratorRE(mi, RPMTAG_ARCH, RPMMIRE_STRCMP, rpmteA(te));
rpmdbSetIteratorRE(mi, RPMTAG_OS, RPMMIRE_STRCMP, rpmteO(te));
}
++++++ remove-brp-strips.diff ++++++
Subject: remove references to removed brp scripts
Some brp-scripts are not used in openSUSE, remove references
to it
--- ./platform.in.orig 2011-05-11 15:02:03.000000000 +0000
+++ ./platform.in 2011-05-11 15:38:05.000000000 +0000
@@ -55,8 +55,6 @@
%__os_install_post \
%{_rpmconfigdir}/brp-compress \
%{_rpmconfigdir}/brp-strip %{__strip} \
- %{_rpmconfigdir}/brp-strip-static-archive %{__strip} \
- %{_rpmconfigdir}/brp-strip-comment-note %{__strip} %{__objdump} \
%{nil}
%__spec_install_post\
++++++ remove-translations.diff ++++++
--- ./scripts/find-lang.sh.orig 2012-06-01 13:28:40.000000000 +0000
+++ ./scripts/find-lang.sh 2012-06-01 13:30:43.000000000 +0000
@@ -111,6 +111,23 @@ fi
MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW
+# remove languages we do not yet support - but give out statistics
+find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
+ echo -n "removing translation $file: "
+ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
+ done
+ rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi
+done
+find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do
+ if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then
+ echo "removing help translation /usr/share/help/$dir"
+ rm -rf $TOP_DIR/usr/share/help/$dir
+ fi
+done
+
find "$TOP_DIR" -type f -o -type l|sed '
s:'"$TOP_DIR"'::
'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
++++++ repackage-nomd5.diff ++++++
Don't complain about a bad md5 sum for repackaged rpms.
--- ./lib/psm.c.orig 2013-07-12 12:05:15.000000000 +0000
+++ ./lib/psm.c 2013-07-12 12:07:59.000000000 +0000
@@ -813,12 +813,17 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
rpmpsmNotify(psm, RPMCALLBACK_INST_PROGRESS, 0);
if (rpmfiFC(fi) > 0 && !(rpmtsFlags(ts) & RPMTRANS_FLAG_JUSTDB)) {
+ rpmtransFlags oldtsflags;
FD_t payload = rpmtePayload(psm->te);
if (payload == NULL) {
rc = RPMRC_FAIL;
break;
}
+ oldtsflags = rpmtsFlags(ts);
+ if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+ (void) rpmtsSetFlags(ts, oldtsflags | RPMTRANS_FLAG_NOMD5);
+
fsmrc = rpmPackageFilesInstall(psm->ts, psm->te, psm->fi,
payload, psm, &psm->failedFile);
@@ -827,6 +832,9 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
rpmswAdd(rpmtsOp(psm->ts, RPMTS_OP_DIGEST),
fdOp(payload, FDSTAT_DIGEST));
+ if (headerIsEntry(fi->h, RPMTAG_REMOVETID))
+ (void) rpmtsSetFlags(ts, oldtsflags);
+
Fclose(payload);
}
++++++ requires-ge-macro.diff ++++++
--- ./macros.in.orig 2011-05-11 15:36:05.000000000 +0000
+++ ./macros.in 2011-05-11 15:38:44.000000000 +0000
@@ -1027,7 +1027,8 @@ done \
# %{perl_sitearch}/Image
# %dir %{perl_sitearch}/auto/Image
#
-%requires_eq() %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
+%requires_eq() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
+%requires_ge() %(echo '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
++++++ rpm-deptracking.patch ++++++
Index: macros.in
===================================================================
--- macros.in.orig 2011-12-09 13:21:58.078688958 +0100
+++ macros.in 2011-12-09 13:21:58.502668839 +0100
@@ -920,7 +920,8 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.ex
--localstatedir=%{_localstatedir} \\\
--sharedstatedir=%{_sharedstatedir} \\\
--mandir=%{_mandir} \\\
- --infodir=%{_infodir}
+ --infodir=%{_infodir} \\\
+ --disable-dependency-tracking
#------------------------------------------------------------------------------
# The make install analogue of %configure for modern autotools:
++++++ rpm-gst-provides.patch ++++++
Index: ./autodeps/linux.prov
===================================================================
--- ./autodeps/linux.prov
+++ ./autodeps/linux.prov
@@ -102,4 +102,9 @@ fi
[ -x /usr/lib/rpm/find-provides.ksyms ] &&
printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/find-provides.ksyms "$@"
+#
+# --- GStreamer provides, codecs
+[ -x /usr/lib/rpm/gstreamer-provides ] &&
+ printf "%s\n" "${filelist[@]}" | /usr/lib/rpm/gstreamer-provides | sort -u
+
exit 0
++++++ rpm-shorten-changelog.diff ++++++
--- ./build/pack.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./build/pack.c 2013-07-12 11:59:37.000000000 +0000
@@ -540,6 +540,63 @@ static rpmRC checkPackages(char *pkgchec
return RPMRC_OK;
}
+static void trimChangelog(Header h)
+{
+ static int oneshot;
+ static int cuttime, minnum, maxnum;
+ int * times;
+ char ** names = 0, ** texts = 0;
+ int i, keep, count = 0;
+
+ if (!oneshot) {
+ char *binarychangelogtrim = rpmExpand("%{?_binarychangelogtrim}", NULL);
+ oneshot = 1;
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ maxnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ cuttime = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ if (binarychangelogtrim)
+ binarychangelogtrim++;
+ }
+ if (binarychangelogtrim && *binarychangelogtrim) {
+ minnum = atoi(binarychangelogtrim);
+ binarychangelogtrim = strchr(binarychangelogtrim, ',');
+ }
+ }
+ if (!cuttime && !minnum && !maxnum) {
+ return;
+ }
+ if (!headerGetEntry(h, RPMTAG_CHANGELOGTIME, NULL, (void **) ×, &count))
+ return;
+ if ((!cuttime || count <= minnum) && (!maxnum || count <= maxnum)) {
+ return;
+ }
+ keep = count;
+ if (maxnum && keep > maxnum)
+ keep = maxnum;
+ if (cuttime) {
+ for (i = 0; i < keep; i++) {
+ if (i >= minnum && times[i] < cuttime)
+ break;
+ }
+ keep = i;
+ }
+ if (keep >= count)
+ return;
+ headerGetEntry(h, RPMTAG_CHANGELOGNAME, NULL, (void **) &names, &count);
+ headerGetEntry(h, RPMTAG_CHANGELOGTEXT, NULL, (void **) &texts, &count);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, times, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, names, keep);
+ headerModifyEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, texts, keep);
+ free(names);
+ free(texts);
+}
+
rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)
{
rpmRC rc;
@@ -547,6 +604,7 @@ rpmRC packageBinaries(rpmSpec spec, cons
Package pkg;
char *pkglist = NULL;
+ trimChangelog(spec->packages->header);
for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) {
char *fn;
--- ./build/parseChangelog.c.orig 2012-11-18 08:21:06.000000000 +0000
+++ ./build/parseChangelog.c 2013-07-12 11:59:37.000000000 +0000
@@ -183,6 +183,11 @@ static rpmRC addChangelog(Header h, ARGV
goto exit;
}
+ /* workaround old suse oddity */
+ if (*s == '-' && s[1] == ' ') {
+ s += 2;
+ }
+
/* name */
name = s;
while (*s != '\0') s++;
++++++ rpm-suse_macros ++++++
# need to keep this around for a while
%suse_check %{nil}
# directories
%_infodir %{_prefix}/share/info
%_mandir %{_prefix}/share/man
%_sysconfdir /etc
%_localstatedir /var
%_defaultdocdir %{_usr}/share/doc/packages
# package build macros
%make_install make install DESTDIR=%{?buildroot}
%makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install
%insserv_prereq insserv sed
%fillup_prereq fillup coreutils grep diffutils
%install_info_prereq info
# this script calls all scripts in /usr/lib/rpm/brp-suse.d
%__os_install_post \
/usr/lib/rpm/brp-compress \
/usr/lib/rpm/brp-suse \
%{nil}
# macro: %restart_on_update()
# Used to restart a service in postun section, if we are
# not running from YaST2 in instsys on update.
%restart_on_update() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if test "$FIRST_ARG" -ge 1 ; then \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \
test -x /bin/systemctl && /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
for service in %{?*} ; do \
/etc/init.d/$service try-restart > /dev/null || : \
done \
fi \
fi \
%nil
# macro: %stop_on_removal()
# Used to stop a service in preun section, if we are
# not running from YaST2 in instsys on removal of this package.
%stop_on_removal() \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
if test "$FIRST_ARG" = "0" ; then \
test -f /etc/sysconfig/services && . /etc/sysconfig/services \
if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_STOP_ON_REMOVAL" != yes ; then \
for service in %{?*} ; do \
/etc/init.d/$service stop > /dev/null \
done \
fi \
fi \
%nil
# macro: %configure_kernel_source
#
#
%configure_kernel_source() \
if test -d /usr/src/linux ; then \
pushd /usr/src/linux \
test -f .config || cp arch/%_arch/defconfig.default .config \
yes "" | make oldconfig \
make dep \
popd \
fi \
%nil
%is_plus %(if test -f /.buildenv ; then source /.buildenv ; if [[ "$BUILD_BASENAME" == *+kde ]] ; then echo 1 ; else echo 0 ; fi ; else echo 0 ; fi)
%set_permissions(f:) \
if [ -x /usr/bin/chkstat ]; then \
/usr/bin/chkstat -n --set --system %{**} \
fi \
%nil
%verify_permissions(e:f:) \
/usr/bin/chkstat -n --warn --system %{**} 1>&2 \
%nil
%suse_update_libdir() \
if [ %_lib != lib ]; then \
for file in %{?*} ; do \
[ ! -e $file ] && echo "Error: $file does not exist!" && exit -1 \
[ -e $file.nolib64 ] && echo "Error: $file.nolib64 already exists!" && exit -1 \
cp $file $file.nolib64 \
echo "patching $file" \
sed -e "s,/lib\\\>,/%_lib,g" $file.nolib64 | sed -e "s,/%_lib/cpp,/lib/cpp,; s,/usr/%_lib/perl,/usr/lib/perl, ; s,/%_lib\\([\$-]\\),/lib\\1,g" > $file \
diff -u $file.nolib64 $file \
rm -f $file.nolib64 \
done; \
fi ; \
# macro: fillup_and_insserv
# do the fillup and insserv calls for postinstall
# options:
# -n (use first argument as name for fillup template filenames
# instead of package name)
# -f (skip fillup parts)
# -i (skip insserv parts)
# -y (default start-variable value to yes)
# Used only if X-UnitedLinux-Default-Enabled is not specified
# in the init script
# -Y (force_yes: always activate, discard setting before update)
# arguments:
# [if "-n" first argument as package name]
# Pairs of:
# main script name
# and
# name of (old) START variable (unless -s is given)
#
# template for variables into /etc/sysconfig/package:
# /var/adm/fillup-templates/sysconfig.package
%fillup_and_insserv(finpsyY) \
%{-p:echo "-p option for fillup_and_insserv no longer supported (ever only used on SL8.0)"; exit 1;} \
%{-s:echo "STARTVAR for fillup_and_insserv no longer supported (rc.config is gone since SL8.0)"; exit 1;} \
test -n "$FIRST_ARG" || FIRST_ARG=$1 \
%{-Y:FORCE_YES=1}%{!-Y:FORCE_YES=0} \
set -- %{?*} \
%{-n:PNAME=$1 ; shift }%{!-n:PNAME=%{name}} \
INSSRV_ARRAY="" \
while [ ${#*} -gt 0 ] ; do \
SCRIPTNAME=$1 \
shift \
SV_B='^### BEGIN INIT INFO' \
SV_E='^### END INIT INFO' \
SV_KW=Default-Enabled \
SV_VALUE=`sed -n -e "/$SV_B/,/$SV_E/{/^# [^[:space:]]*$SV_KW:[[:space:]]*\\([^[:space:]]*\\).*/s//\\1/p;}" < /etc/init.d/$SCRIPTNAME` \
test "$FORCE_YES" = "1" && SV_VALUE="yes" \
test -n "$SV_VALUE" || SV_VALUE=%{-y:"yes"}%{!-y:"no"} \
INSSRV_ARRAY="$INSSRV_ARRAY $SCRIPTNAME $SV_VALUE" \
done \
%{!-f: %{do_real_fillup}} \
%{!-i: %{add_start_if_needed $INSSRV_ARRAY } } \
%nil
# do_real_fillup: internal macro
# this part really calls fillup for the appropriate files
#
%do_real_fillup() \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME \
SD_NAME="" \
%{sysc_fillup}
# add_start_if_needed: internally used by fillup_and_insserv
%add_start_if_needed() \
set -- %{?*} \
while [ ${#*} -gt 0 ] ; do \
SCRIPTNAME=$1 \
SV_VALUE=$2 \
shift 2 \
test -n "$SCRIPTNAME" -a -n "$SV_VALUE" || { echo "SCRIPTNAME or SV_VALUE unknown"; exit 1;} \
if test "$FIRST_ARG" = "1" -a "$SV_VALUE" = "no" ; then \
/sbin/insserv ${YAST_IS_RUNNING:+-f} -r /etc/init.d/$SCRIPTNAME \
elif test "$FIRST_ARG" = "1" -o "$FORCE_YES" = "1" ; then \
/sbin/insserv ${YAST_IS_RUNNING:+-f} /etc/init.d/$SCRIPTNAME \
fi \
done
# macro: insserv_cleanup
%insserv_cleanup() \
/sbin/insserv /etc/init.d
# macro: fillup_only
# do the fillup for sysconfig files
# template naming convention:
# .../fillup-templates/sysconfig.$NAME1[-$NAME2]
# NAME1: the name of the sysconfig-file
# NAME2: if needed (if more packages fill the
# same sysconfig file) the package name
# options:
# -n set sysconfig name manually
# -a use package name as $NAME2
# -s use second arg as package-name
# -d use a subdirectory of sysconfig
# (last arg as directory name)
%fillup_only(dans) \
%{-n:PNAME=%{1}}%{!-n:PNAME=%{name}} \
%{-s:SUBPNAME=-%{2}}%{!-s:SUBPNAME=%{-a:-%{name}}} \
TEMPLATE_DIR=/var/adm/fillup-templates \
SYSC_TEMPLATE=$TEMPLATE_DIR/sysconfig.$PNAME$SUBPNAME \
SD_NAME="" \
%{-d:%{-s:SD_NAME=%{3}/}%{!-s:SD_NAME=%{2}/}} \
%{sysc_fillup} \
%nil
# internal only: sysc_fillup
%sysc_fillup() \
if [ -x /bin/fillup ] ; then \
if [ -f $SYSC_TEMPLATE ] ; then \
echo "Updating /etc/sysconfig/$SD_NAME$PNAME..." \
mkdir -p /etc/sysconfig/$SD_NAME \
touch /etc/sysconfig/$SD_NAME$PNAME \
/bin/fillup -q /etc/sysconfig/$SD_NAME$PNAME $SYSC_TEMPLATE \
fi \
else \
echo "ERROR: fillup not found. This should not happen. Please compare" \
echo "/etc/sysconfig/$PNAME and $TEMPLATE_DIR/sysconfig.$PNAME and" \
echo "update by hand." \
fi
# macro: rename_sysconfig_variable
# as the name says, rename a variable in the file given with -f
%rename_sysconfig_variable(f:) \
%{!-f:echo "missing argument for rename_sysconfig_variable"; exit 1; }%{-f:FILE=%{-f*}} \
if [ -f $FILE ] ; then \
sed -i -e "s/^%{1}=/%{2}=/" $FILE \
fi
# macro: remove_and_set
# remove variables from sysconfig.$NAME
# (both if existant) and set them in the environment
# for further handling in postinstall
# options: -n set package name
# -y default to yes if not found (otherwise no)
%remove_and_set(n:y) \
%{-n:PNAME=%{-n*}}%{!-n:PNAME=%{name}} \
DEF_VAL=%{-y:"yes"}%{!-y:"no"} \
DEL_TEMPL=/var/adm/fillup-templates/$PNAME.del \
rm -f $DEL_TEMPL \
for var in %{?*} ; do \
echo -e "#\\n$var=$DEF_VAL\\n" >> $DEL_TEMPL \
done \
if [ -f /etc/sysconfig/$PNAME ] ; then \
/bin/fillup -q -t -r -i -d "=" /etc/sysconfig/$PNAME $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ \
test -f /etc/sysconfig/$PNAME.new && mv /etc/sysconfig/$PNAME.new /etc/sysconfig/$PNAME \
fi \
for i in $DEL_TEMPL /etc/sysconfig/$PNAME.deleted.$$ ; do \
if [ -f $i ] ; then \
. $i \
rm -f $i \
fi \
done
%insserv_force_if_yast() \
/sbin/insserv ${YAST_IS_RUNNING:+-f} %{?*}
%run_ldconfig /sbin/ldconfig
%install_info(:-:) \
ALL_ARGS=(%{**}) \
NUM_ARGS=${#ALL_ARGS[@]} \
if test -x /sbin/install-info ; then \
if test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
/sbin/install-info "${ALL_ARGS[@]}" \
fi \
fi ;
%install_info_delete(:-:) \
ALL_ARGS=(%{**}) \
NUM_ARGS=${#ALL_ARGS[@]} \
if test -x /sbin/install-info ; then \
if ! test -e "${ALL_ARGS[$((NUM_ARGS-1))]}" ; then \
/sbin/install-info --quiet --delete "${ALL_ARGS[@]}" \
fi ; \
fi ;
# find-supplements.ksyms parses this macro directly out of the spec file:
%supplements_kernel_module() \
%{expand:%(if ! rpm -q kernel-syms > /dev/null; then echo "%fail Please add the kernel-syms package to BuildRequires"; fi)}
%suse_version 1310
%sles_version 0
%ul_version 0
%do_profiling 1
%cflags_profile_generate -fprofile-generate
%cflags_profile_feedback -fprofile-use
%suse_install_update_message() \
install -D -m 644 %1 %buildroot/var/adm/update-messages/%{name}-%{version}-%{release}-%(basename %1).txt \
%nil
%suse_install_update_script() \
install -D -m 755 %1 %buildroot/var/adm/update-scripts/%{name}-%{version}-%{release}-%(basename %1).txt \
%nil
# Template for lang sub-package.
%lang_package(n:r:) \
%package %{-n:-n %{-n*}-}lang \
Summary: Languages for package %{name} \
Group: System/Localization \
Requires: %{-n:%{-n*}}%{!-n:%{name}} = %{version} \
%{-r:Requires: %{-r*}} \
Provides: %{-n:%{-n*}}%{!-n:%{name}}-lang-all = %{version} \
Supplements: packageand(bundle-lang-other:%{-n:%{-n*}}%{!-n:%{name}}) \
BuildArch: noarch \
%description %{-n:-n %{-n*}-}lang \
Provides translations to the package %{name}
++++++ rpmconfigcheck ++++++
#! /bin/bash
# Copyright (c) 2002 SuSE GmbH Nuernberg, Germany.
#
# Author: Michael Schroeder
#
# /etc/init.d/rpmconfigcheck
# /usr/sbin/rcrpmconfigcheck
#
# Script to scan for unresolved .rpmnew, .rpmorig, and .rpmsave files
#
### BEGIN INIT INFO
# Provides: rpmconfigcheck
# Required-Start: $remote_fs
# Required-Stop: $null
# Default-Start: 2 3 5
# Default-Stop:
# Description: rpm config file scan
### END INIT INFO
. /etc/rc.status
# First reset status of this service
rc_reset
configcheckfile=/var/adm/rpmconfigcheck
packages=/var/lib/rpm/Packages
test -z "$1" && set start
case "$1" in
start|restart|try-restart|reload|force-reload)
if test -s $packages -a \( ! -e $configcheckfile -o -s $configcheckfile -o ! $packages -ot $configcheckfile \) ; then
echo -n "Searching for unresolved configuration files"
if test ! -e $configcheckfile -o ! $packages -ot $configcheckfile ; then
test -e $configcheckfile && mv -f $configcheckfile $configcheckfile.old
rpm -qalc | sort | perl -lne '-e "$_.rpmnew" and print "$_.rpmnew"; -e "$_.rpmorig" and print "$_.rpmorig"; -e "$_.rpmsave" and print "$_.rpmsave"' > $configcheckfile
else
mv -f $configcheckfile $configcheckfile.old
while read l; do
test -e $l && echo $l
done < $configcheckfile.old > $configcheckfile
true
fi
rc_status -v
if test -s $configcheckfile; then
echo "Please check the following files (see /var/adm/rpmconfigcheck):"
sed -e 's/^/ /' < $configcheckfile
touch $configcheckfile.old
cat $configcheckfile $configcheckfile.old | sort | uniq -d > $configcheckfile.dup
cat $configcheckfile $configcheckfile.dup | sort | uniq -u > $configcheckfile.new
if test -s $configcheckfile.new ; then
(
echo "----------------------------------------------------------------------"
echo "----------------------------------------------------------------------"
echo "rpmconfigcheck"
date
echo "----------------------------------------"
echo "This is a warning message."
echo "rpmconfigcheck has found the following new unresolved config files"
echo "(all files are listed in /var/adm/rpmconfigcheck):"
cat $configcheckfile.new
echo "----------------------------------------"
) >> /var/log/update-messages
fi
fi
rm -f $configcheckfile.old $configcheckfile.dup $configcheckfile.new
fi
;;
stop)
;;
status)
rc_failed 4
rc_status -v
;;
*)
echo "Usage: $0 {start}"
exit 1
;;
esac
rc_exit
++++++ rpmpopt.diff ++++++
--- ./rpmpopt.in.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./rpmpopt.in 2011-05-11 15:02:34.000000000 +0000
@@ -101,7 +101,8 @@ Relocations : %|PREFIXES?{[%{PREFIXES} ]
%|URL?{URL : %{URL}\n}|\
%|BUGURL?{Bug URL : %{BUGURL}\n}|\
Summary : %{SUMMARY}\n\
-Description :\n%{DESCRIPTION}\n' \
+Description :\n%{DESCRIPTION}\n\
+Distribution: %{DISTRIBUTION}\n' \
--POPTdesc=$"list descriptive information from package(s)"
rpm alias --changelog --qf '[* %{CHANGELOGTIME:day} %{CHANGELOGNAME}\n%{CHANGELOGTEXT}\n\n]' \
++++++ rpmqpack.diff ++++++
Provide rpmqpack, a fast way to list all installed packages are
check if some package is installed. This is a hack.
--- ./Makefile.am.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./Makefile.am 2011-05-11 15:15:27.000000000 +0000
@@ -170,6 +170,10 @@ rpmgraph_LDADD = lib/librpm.la rpmio/lib
dist_bin_SCRIPTS = scripts/gendiff
+bin_PROGRAMS += rpmqpack
+rpmqpack_SOURCES = rpmqpack.c
+rpmqpack_LDADD = lib/librpm.la
+
rpmconfig_DATA = rpmrc
rpmrc: $(top_srcdir)/rpmrc.in
@$(SED) \
--- ./doc/Makefile.am.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/Makefile.am 2011-05-11 15:16:24.000000000 +0000
@@ -8,7 +8,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 += rpmdb.8 rpmkeys.8 rpmsign.8 rpmspec.8 rpmqpack.8
EXTRA_DIST += $(man_man8_DATA)
man_fr_man8dir = $(mandir)/fr/man8
--- ./doc/rpmqpack.8.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./doc/rpmqpack.8 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,25 @@
+.TH RPMQPACK 8 "Mar 2002"
+.SH NAME
+rpmqpack \- check for installed rpm packages
+
+.SH SYNOPSIS
+.B rpmqpack
+.RI [ pack1 "] [" pack2 ]...
+
+.SH DESCRIPTION
+rpmqpack checks if packages given as arguments are installed in
+the system. It prints each installed package to stdout.
+If no arguments are given all installed packages are printed.
+
+.SH EXIT STATUS
+rpmqpack returns 0 if all given packages are installed, otherwise
+1.
+
+.SH SEE ALSO
+.BR rpm (1)
+
+.SH COPYRIGHT
+2002 SuSE Linux AG Nuernberg, Germany.
+
+.SH AUTHOR
+Michael Schroeder
--- ./rpmqpack.c.orig 2011-05-11 15:15:27.000000000 +0000
+++ ./rpmqpack.c 2011-05-11 15:15:27.000000000 +0000
@@ -0,0 +1,59 @@
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+DBT key;
+DBT data;
+
+int
+main(int argc, char **argv)
+{
+ DB *db = 0;
+ DBC *dbc = 0;
+ int ret = 0;
+
+ if (db_create(&db, 0, 0))
+ {
+ perror("db_create");
+ exit(1);
+ }
+ if (db->open(db, 0, "/var/lib/rpm/Name", 0, DB_UNKNOWN, DB_RDONLY, 0664))
+ {
+ perror("db->open");
+ exit(1);
+ }
+ if (argc == 1)
+ {
+ if (db->cursor(db, NULL, &dbc, 0))
+ {
+ perror("db->cursor");
+ exit(1);
+ }
+ while (dbc->c_get(dbc, &key, &data, DB_NEXT) == 0)
+ printf("%*.*s\n", (int)key.size, (int)key.size, (char *)key.data);
+ dbc->c_close(dbc);
+ }
+ else
+ {
+ argc--;
+ while (argc--)
+ {
+ argv++;
+ key.data = (void *)*argv;
+ key.size = strlen(*argv);
+ data.data = NULL;
+ data.size = 0;
+ if (db->get(db, 0, &key, &data, 0) == 0)
+ printf("%s\n", *argv);
+ else
+ ret = 1;
+ }
+ }
+ db->close(db, 0);
+ return ret;
+}
++++++ rpmrc.diff ++++++
--- ./rpmrc.in.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./rpmrc.in 2013-07-12 11:56:53.000000000 +0000
@@ -12,16 +12,16 @@
# "fat" binary with both archs, for Darwin
optflags: fat -O2 -g -arch i386 -arch ppc
-optflags: i386 -O2 -g -march=i386 -mtune=i686
-optflags: i486 -O2 -g -march=i486
-optflags: i586 -O2 -g -march=i586
-optflags: i686 -O2 -g -march=i686
-optflags: pentium3 -O2 -g -march=pentium3
-optflags: pentium4 -O2 -g -march=pentium4
-optflags: athlon -O2 -g -march=athlon
+optflags: i386 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i486 -O2 -g -m32 -march=i486 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i586 -O2 -g -m32 -march=i586 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: i686 -O2 -g -m32 -march=i686 -mtune=i686 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: pentium3 -O2 -g -m32 -march=pentium3
+optflags: pentium4 -O2 -g -m32 -march=pentium4
+optflags: athlon -O2 -g -m32 -march=athlon
optflags: geode -Os -g -m32 -march=geode
-optflags: ia64 -O2 -g
-optflags: x86_64 -O2 -g
+optflags: ia64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: x86_64 -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: amd64 -O2 -g
optflags: ia32e -O2 -g
@@ -41,16 +41,17 @@ optflags: sparc64v -O2 -g -m64 -mtune=ni
optflags: m68k -O2 -g -fomit-frame-pointer
-optflags: ppc -O2 -g -fsigned-char
-optflags: ppc8260 -O2 -g -fsigned-char
-optflags: ppc8560 -O2 -g -fsigned-char
-optflags: ppc32dy4 -O2 -g -fsigned-char
-optflags: ppciseries -O2 -g -fsigned-char
-optflags: ppcpseries -O2 -g -fsigned-char
-optflags: ppc64 -O2 -g -fsigned-char
-optflags: ppc64p7 -O3 -mtune=power7 -mcpu=power7 -g -fsigned-char
+optflags: ppc -O2 -g -m32 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc8260 -O2 -g -m32
+optflags: ppc8560 -O2 -g -m32
+optflags: ppc32dy4 -O2 -g -m32
+optflags: ppciseries -O2 -g -m32
+optflags: ppcpseries -O2 -g -m32
+optflags: ppc64 -O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: ppc64p7 -O3 -mtune=power7 -mcpu=power7 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: parisc -O2 -g -mpa-risc-1-0
+optflags: hppa -O2 -g -mpa-risc-1-0
optflags: hppa1.0 -O2 -g -mpa-risc-1-0
optflags: hppa1.1 -O2 -g -mpa-risc-1-0
optflags: hppa1.2 -O2 -g -mpa-risc-1-0
@@ -66,7 +67,9 @@ optflags: armv4tl -O2 -g -march=armv4t
optflags: armv5tel -O2 -g -march=armv5te
optflags: armv5tejl -O2 -g -march=armv5te
optflags: armv6l -O2 -g -march=armv6
+optflags: armv6hl -O2 -g -march=armv6 -mfloat-abi=hard -mabi=aapcs-linux
optflags: armv7l -O2 -g -march=armv7
+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mthumb -mabi=aapcs-linux
optflags: atarist -O2 -g -fomit-frame-pointer
optflags: atariste -O2 -g -fomit-frame-pointer
@@ -76,8 +79,8 @@ optflags: atariclone -O2 -g -fomit-frame
optflags: milan -O2 -g -fomit-frame-pointer
optflags: hades -O2 -g -fomit-frame-pointer
-optflags: s390 -O2 -g
-optflags: s390x -O2 -g
+optflags: s390 -O2 -g -m31 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
+optflags: s390x -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables
optflags: sh3 -O2 -g
optflags: sh4 -O2 -g -mieee
@@ -178,7 +181,9 @@ arch_canon: armv4l: armv4l 12
arch_canon: armv5tel: armv5tel 12
arch_canon: armv5tejl: armv5tejl 12
arch_canon: armv6l: armv6l 12
+arch_canon: armv6hl: armv6hl 12
arch_canon: armv7l: armv7l 12
+arch_canon: armv7hl: armv7hl 12
arch_canon: m68kmint: m68kmint 13
arch_canon: atarist: m68kmint 13
@@ -241,17 +246,17 @@ os_canon: MacOSX: macosx 21
#############################################################
# For a given uname().machine, the default build arch
-buildarchtranslate: osfmach3_i686: i386
-buildarchtranslate: osfmach3_i586: i386
+buildarchtranslate: osfmach3_i686: i586
+buildarchtranslate: osfmach3_i586: i586
buildarchtranslate: osfmach3_i486: i386
buildarchtranslate: osfmach3_i386: i386
-buildarchtranslate: athlon: i386
-buildarchtranslate: geode: i386
-buildarchtranslate: pentium4: i386
-buildarchtranslate: pentium3: i386
-buildarchtranslate: i686: i386
-buildarchtranslate: i586: i386
+buildarchtranslate: athlon: i586
+buildarchtranslate: geode: i586
+buildarchtranslate: pentium4: i586
+buildarchtranslate: pentium3: i586
+buildarchtranslate: i686: i586
+buildarchtranslate: i586: i586
buildarchtranslate: i486: i386
buildarchtranslate: i386: i386
@@ -281,6 +286,7 @@ buildarchtranslate: ppcpseries: ppc
buildarchtranslate: ppc64iseries: ppc64
buildarchtranslate: ppc64pseries: ppc64
buildarchtranslate: ppc64p7: ppc64
+buildarchtranslate: powerpc64: ppc64
buildarchtranslate: armv3l: armv3l
buildarchtranslate: armv4b: armv4b
@@ -289,7 +295,9 @@ buildarchtranslate: armv4tl: armv4tl
buildarchtranslate: armv5tel: armv5tel
buildarchtranslate: armv5tejl: armv5tejl
buildarchtranslate: armv6l: armv6l
+buildarchtranslate: armv6hl: armv6hl
buildarchtranslate: armv7l: armv7l
+buildarchtranslate: armv7hl: armv7hl
buildarchtranslate: atarist: m68kmint
buildarchtranslate: atariste: m68kmint
@@ -314,6 +322,15 @@ buildarchtranslate: sh4a: sh4
buildarchtranslate: aarch64: aarch64
+buildarchtranslate: parisc: hppa
+buildarchtranslate: hppa2.0: hppa
+buildarchtranslate: hppa64: hppa
+
+buildarchtranslate: armv5l: armv4l
+buildarchtranslate: armv5tel: armv4l
+buildarchtranslate: armv5b: armv4b
+buildarchtranslate: armv5teb: armv4b
+
#############################################################
# Architecture compatibility
@@ -370,14 +387,20 @@ arch_compat: mipsel: noarch
arch_compat: hppa2.0: hppa1.2
arch_compat: hppa1.2: hppa1.1
arch_compat: hppa1.1: hppa1.0
-arch_compat: hppa1.0: parisc
+arch_compat: hppa1.0: hppa
+arch_compat: hppa: parisc
arch_compat: parisc: noarch
+arch_compat: armv5teb: armv5b
+arch_compat: armv5b: armv4b
arch_compat: armv4b: noarch
+arch_compat: armv7hl: armv7l
arch_compat: armv7l: armv6l
arch_compat: armv6l: armv5tejl
+arch_compat: armv6hl: armv6l
arch_compat: armv5tejl: armv5tel
-arch_compat: armv5tel: armv4tl
+arch_compat: armv5tel: armv5l
+arch_compat: armv5l: armv4tl
arch_compat: armv4tl: armv4l
arch_compat: armv4l: armv3l
arch_compat: armv3l: noarch
@@ -394,7 +417,7 @@ arch_compat: i370: noarch
arch_compat: s390: noarch
arch_compat: s390x: s390 noarch
-arch_compat: ia64: noarch
+arch_compat: ia64: i686 noarch
arch_compat: x86_64: amd64 em64t athlon noarch
arch_compat: amd64: x86_64 em64t athlon noarch
@@ -483,7 +506,9 @@ buildarch_compat: mips: noarch
buildarch_compat: mipsel: noarch
buildarch_compat: armv4b: noarch
+buildarch_compat: armv7hl: armv7l
buildarch_compat: armv7l: armv6l
+buildarch_compat: armv6hl: armv6l
buildarch_compat: armv6l: armv5tejl
buildarch_compat: armv5tejl: armv5tel
buildarch_compat: armv5tel: armv4tl
@@ -494,7 +519,8 @@ buildarch_compat: armv3l: noarch
buildarch_compat: hppa2.0: hppa1.2
buildarch_compat: hppa1.2: hppa1.1
buildarch_compat: hppa1.1: hppa1.0
-buildarch_compat: hppa1.0: parisc
+buildarch_compat: hppa1.0: hppa
+buildarch_compat: hppa: parisc
buildarch_compat: parisc: noarch
buildarch_compat: atarist: m68kmint noarch
++++++ rpmrctests.diff ++++++
Patch machine detection code: detect transmeta, rename parisc to hppa. [#52713]
--- ./lib/rpmrc.c.orig 2012-06-01 10:38:24.000000000 +0000
+++ ./lib/rpmrc.c 2012-06-01 10:44:59.000000000 +0000
@@ -786,6 +786,14 @@ static inline int RPMClass(void)
cpu = (tfms>>8)&15;
+ if (cpu == 5
+ && cpuid_ecx(0) == '68xM'
+ && cpuid_edx(0) == 'Teni'
+ && (cpuid_edx(1) & ((1<<8)|(1<<15))) == ((1<<8)|(1<<15))) {
+ sigaction(SIGILL, &oldsa, NULL);
+ return 6; /* has CX8 and CMOV */
+ }
+
sigaction(SIGILL, &oldsa, NULL);
if (cpu < 6)
@@ -1023,6 +1031,12 @@ static void defaultMachine(const char **
strcpy(un.machine, "mips");
# endif
+#if defined(__linux__)
+ /* in linux, lets rename parisc to hppa */
+ if (rstreq(un.machine, "parisc"))
+ strcpy(un.machine, "hppa");
+#endif
+
# if defined(__hpux) && defined(_SC_CPU_VERSION)
{
# if !defined(CPU_PA_RISC1_2)
++++++ rpmsort ++++++
#! /usr/bin/perl -w
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
use Getopt::Long qw(:config gnu_getopt);
sub do_rpm_cmp_versions {
my ($evr1, $evr2) = @_;
sub _rpm_cmp {
my ($s1, $s2) = @_;
return defined $s1 <=> defined $s2
unless defined $s1 && defined $s2;
my ($r, $x1, $x2);
do {
$s1 =~ s/^[^a-zA-Z0-9]+//;
$s2 =~ s/^[^a-zA-Z0-9]+//;
if ($s1 =~ /^\d/ || $s2 =~ /^\d/) {
$s1 =~ s/^(0*(\d*))//; $x1 = $2;
return -1 if $1 eq '';
$s2 =~ s/^(0*(\d*))//; $x2 = $2;
return 1 if $1 eq '';
$r = length $x1 <=> length $x2 || $x1 cmp $x2;
} else {
$s1 =~ s/^([a-zA-Z]*)//; $x1 = $1;
$s2 =~ s/^([a-zA-Z]*)//; $x2 = $1;
return 0
if $x1 eq '' && $x2 eq '';
$r = $x1 cmp $x2;
}
} until $r;
return $r;
}
my ($e1, $v1, $r1) = $evr1 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my ($e2, $v2, $r2) = $evr2 =~ /^(?:(\d*):)?(.*?)(?:-([^-]*))?$/;
my $r = _rpm_cmp($e1 || 0, $e2 || 0);
$r = _rpm_cmp($v1, $v2)
unless $r;
$r = _rpm_cmp($r1, $r2)
unless $r;
return $r;
}
my $reorder = sub { return @_ };
my $key = 0;
my $test = 0;
sub rpm_cmp_versions {
my ($evr1, $evr2) = @_;
chomp($evr1, $evr2);
my $res1 = do_rpm_cmp_versions($evr1, $evr2);
if ($test) {
open(my $fd, '-|', 'zypper', '--terse', 'versioncmp',
$evr1, $evr2) or die "zypper: $!\n";
my $res2 = <$fd>;
close($fd) or die "zypper: $!\n";
chomp $res2;
if ($res1 != $res2) {
my @operators = qw(< == >);
my $op1 = $operators[$res1 + 1];
my $op2 = $operators[$res2 + 1];
print STDERR "BUG: $evr1 $op1 $evr2 vs. zypper: $evr1 $op2 $evr2\n";
}
}
return $res1;
}
GetOptions ("r|reverse" => sub { $reorder = sub { return reverse @_ } },
"k|key=i" => \$key,
"test" => \$test)
or do {
print STDERR "Usage $0 [-r, --reverse] [-k N, --key=N] [--test]\n";
exit 1;
};
if ($key == 0) {
# Sort by entire lines
map { print } &$reorder(sort { rpm_cmp_versions($a, $b) } <>);
} else {
# Sort by field $key
my @data = map { [(split)[$key-1], $_] } <>;
map { print } &$reorder(map { $_->[1] }
sort { rpm_cmp_versions($a->[0], $b->[0]) } @data);
}
++++++ safeugid.diff ++++++
Work around glibc/nscd caching problems when doing 'rpm --root'.
--- ./lib/rpmchroot.c.orig 2011-05-12 08:26:10.000000000 +0000
+++ ./lib/rpmchroot.c 2011-05-12 08:28:32.000000000 +0000
@@ -66,6 +66,7 @@ int rpmChrootIn(void)
} else if (rootState.chrootDone == 0) {
if (chdir("/") == 0 && chroot(rootState.rootDir) == 0) {
rootState.chrootDone = 1;
+ rpmugChroot(1);
} else {
rpmlog(RPMLOG_ERR, _("Unable to change root directory: %m\n"));
rc = -1;
@@ -91,6 +92,7 @@ int rpmChrootOut(void)
} else if (rootState.chrootDone == 1) {
if (chroot(".") == 0 && fchdir(rootState.cwd) == 0) {
rootState.chrootDone = 0;
+ rpmugChroot(0);
} else {
rpmlog(RPMLOG_ERR, _("Unable to restore root directory: %m\n"));
rc = -1;
--- ./lib/rpmug.c.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.c 2011-05-12 08:33:28.000000000 +0000
@@ -35,6 +35,47 @@ const char * rpmugStashStr(const char *s
return ret;
}
+#if defined(__GLIBC__)
+
+static int inchroot;
+
+/*
+ * Unfortunatelly glibc caches nss/nscd data and there is no
+ * good way to flush those caches when we did a chroot(). Thus
+ * we need to parse /etc/passwd and /etc/group ourselfs.
+ */
+static int safe_lookup(const char * file, const char * name)
+{
+ FILE *fp;
+ int l;
+ char buf[4096], *p;
+
+ if (!name || !*name)
+ return -1;
+ l = strlen(name);
+ if ((fp = fopen(file, "r")) == 0)
+ return -1;
+ while ((p = fgets(buf, sizeof(buf), fp)) != 0) {
+ if (*p == '#')
+ continue;
+ while (*p && (*p == ' ' || *p == '\t'))
+ p++;
+ if (strncmp(p, name, l) != 0 || p[l] != ':')
+ continue;
+ p = strchr(p + l + 1, ':');
+ if (!p)
+ continue;
+ fclose(fp);
+ p++;
+ while (*p && (*p == ' ' || *p == '\t'))
+ p++;
+ return atoi(p);
+ }
+ fclose(fp);
+ return -1;
+}
+#endif
+
/*
* These really ought to use hash tables. I just made the
* guess that most files would be owned by root or the same person/group
@@ -68,17 +109,28 @@ int rpmugUid(const char * thisUname, uid
lastUnameAlloced = thisUnameLen + 10;
lastUname = xrealloc(lastUname, lastUnameAlloced); /* XXX memory leak */
}
- strcpy(lastUname, thisUname);
- pwent = getpwnam(thisUname);
- if (pwent == NULL) {
- /* FIX: shrug */
- endpwent();
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int uid = safe_lookup("/etc/passwd", thisUname);
+ if (uid < 0)
+ return -1;
+ lastUid = uid;
+ } else
+#endif
+ {
pwent = getpwnam(thisUname);
- if (pwent == NULL) return -1;
+ if (pwent == NULL) {
+ /* FIX: shrug */
+ endpwent();
+ pwent = getpwnam(thisUname);
+ if (pwent == NULL) return -1;
+ }
+ lastUid = pwent->pw_uid;
}
- lastUid = pwent->pw_uid;
+ strcpy(lastUname, thisUname);
+ lastUnameLen = thisUnameLen;
}
*uid = lastUid;
@@ -111,18 +163,29 @@ int rpmugGid(const char * thisGname, gid
lastGnameAlloced = thisGnameLen + 10;
lastGname = xrealloc(lastGname, lastGnameAlloced); /* XXX memory leak */
}
- strcpy(lastGname, thisGname);
- grent = getgrnam(thisGname);
- if (grent == NULL) {
- /* FIX: shrug */
- endgrent();
+#if defined(__GLIBC__)
+ if (inchroot) {
+ int gid = safe_lookup("/etc/group", thisGname);
+ if (gid < 0)
+ return -1;
+ lastGid = gid;
+ } else
+#endif
+ {
grent = getgrnam(thisGname);
if (grent == NULL) {
- return -1;
+ /* FIX: shrug */
+ endgrent();
+ grent = getgrnam(thisGname);
+ if (grent == NULL) {
+ return -1;
+ }
}
+ lastGid = grent->gr_gid;
}
- lastGid = grent->gr_gid;
+ strcpy(lastGname, thisGname);
+ lastGnameLen = thisGnameLen;
}
*gid = lastGid;
@@ -134,7 +197,7 @@ const char * rpmugUname(uid_t uid)
{
static uid_t lastUid = (uid_t) -1;
static char * lastUname = NULL;
- static size_t lastUnameLen = 0;
+ static size_t lastUnameAlloced = 0;
if (uid == (uid_t) -1) {
lastUid = (uid_t) -1;
@@ -151,9 +214,9 @@ const char * rpmugUname(uid_t uid)
lastUid = uid;
len = strlen(pwent->pw_name);
- if (lastUnameLen < len + 1) {
- lastUnameLen = len + 20;
- lastUname = xrealloc(lastUname, lastUnameLen);
+ if (lastUnameAlloced < len + 1) {
+ lastUnameAlloced = len + 20;
+ lastUname = xrealloc(lastUname, lastUnameAlloced);
}
strcpy(lastUname, pwent->pw_name);
@@ -165,7 +228,7 @@ const char * rpmugGname(gid_t gid)
{
static gid_t lastGid = (gid_t) -1;
static char * lastGname = NULL;
- static size_t lastGnameLen = 0;
+ static size_t lastGnameAlloced = 0;
if (gid == (gid_t) -1) {
lastGid = (gid_t) -1;
@@ -182,9 +245,9 @@ const char * rpmugGname(gid_t gid)
lastGid = gid;
len = strlen(grent->gr_name);
- if (lastGnameLen < len + 1) {
- lastGnameLen = len + 20;
- lastGname = xrealloc(lastGname, lastGnameLen);
+ if (lastGnameAlloced < len + 1) {
+ lastGnameAlloced = len + 20;
+ lastGname = xrealloc(lastGname, lastGnameAlloced);
}
strcpy(lastGname, grent->gr_name);
@@ -200,3 +263,16 @@ void rpmugFree(void)
rpmugGname(-1);
strStash = strCacheFree(strStash);
}
+
+void rpmugChroot(int in)
+{
+ /* tell libc to drop caches / file descriptors */
+ endpwent();
+ endgrent();
+ /* drop our own caches */
+ rpmugUid(NULL, NULL);
+ rpmugGid(NULL, NULL);
+#if defined(__GLIBC__)
+ inchroot = in;
+#endif
+}
--- ./lib/rpmug.h.orig 2011-05-12 08:13:52.000000000 +0000
+++ ./lib/rpmug.h 2011-05-12 08:26:56.000000000 +0000
@@ -15,4 +15,6 @@ const char * rpmugGname(gid_t gid);
void rpmugFree(void);
+void rpmugChroot(int in);
+
#endif /* _RPMUG_H */
++++++ selfconflicts.diff ++++++
From fae0eef24582dd9e071be8e884ff0851d4b57437 Mon Sep 17 00:00:00 2001
From: Michael Schroeder
Date: Fri, 27 Sep 2013 15:09:20 +0200
Subject: [PATCH] Ignore self-obsoletes and self-conflicts in dependency check
code
We already ignored them when checking against the added package list,
but not when checking against installed packages. Thus, rpm -V reported
them as errors.
---
lib/depends.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git lib/depends.c lib/depends.c
index 3d70e68..3ef27bc 100644
--- lib/depends.c
+++ lib/depends.c
@@ -504,6 +504,12 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep)
if (deptag != RPMTAG_OBSOLETENAME && Name[0] == '/') {
mi = rpmtsPrunedIterator(ts, RPMDBI_INSTFILENAMES, Name, prune);
while ((h = rpmdbNextIterator(mi)) != NULL) {
+ /* Ignore self-conflicts */
+ if (deptag == RPMTAG_CONFLICTNAME) {
+ unsigned int instance = headerGetInstance(h);
+ if (instance && instance == rpmdsInstance(dep))
+ continue;
+ }
rpmdsNotify(dep, "(db files)", rc);
break;
}
@@ -527,6 +533,12 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep)
int prix = (selfevr) ? -1 : rpmdbGetIteratorFileNum(mi);
int match = rpmdsMatches(tspool, h, prix, dep, selfevr,
_rpmds_nopromote);
+ /* Ignore self-obsoletes and self-conflicts */
+ if (match && (deptag == RPMTAG_OBSOLETENAME || deptag == RPMTAG_CONFLICTNAME)) {
+ unsigned int instance = headerGetInstance(h);
+ if (instance && instance == rpmdsInstance(dep))
+ match = 0;
+ }
if (match) {
rpmdsNotify(dep, "(db provides)", rc);
break;
@@ -672,8 +684,18 @@ static void checkInstDeps(rpmts ts, depCache dcache, rpmte te,
rpmstrPool pool = rpmtsPool(ts);
while ((h = rpmdbNextIterator(mi)) != NULL) {
- char * pkgNEVRA = headerGetAsString(h, RPMTAG_NEVRA);
- rpmds ds = rpmdsNewPool(pool, h, depTag, 0);
+ char * pkgNEVRA;
+ rpmds ds;
+
+ /* Ignore self-obsoletes and self-conflicts */
+ if (depTag == RPMTAG_OBSOLETENAME || depTag == RPMTAG_CONFLICTNAME) {
+ unsigned int instance = headerGetInstance(h);
+ if (instance && instance == rpmteDBInstance(te))
+ continue;
+ }
+
+ pkgNEVRA = headerGetAsString(h, RPMTAG_NEVRA);
+ ds = rpmdsNewPool(pool, h, depTag, 0);
checkDS(ts, dcache, te, pkgNEVRA, ds, dep, 0);
--
1.8.1.4
++++++ specfilemacro.diff ++++++
--- ./build/parseSpec.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./build/parseSpec.c 2013-07-12 12:04:11.000000000 +0000
@@ -561,6 +561,7 @@ static rpmSpec parseSpec(const char *spe
spec = newSpec();
spec->specFile = rpmGetPath(specFile, NULL);
+ addMacro(spec->macros, "_specfile", NULL, spec->specFile, RMIL_SPEC);
pushOFI(spec, spec->specFile);
/* If buildRoot not specified, use default %{buildroot} */
if (buildRoot) {
++++++ strpoolrehash.diff ++++++
--- rpmio/rpmstrpool.c.orig 2013-09-11 15:33:48.371571600 +0000
+++ rpmio/rpmstrpool.c 2013-09-11 16:20:56.106566595 +0000
@@ -219,8 +219,17 @@ static void rpmstrPoolRehash(rpmstrPool
pool->hash = poolHashFree(pool->hash);
pool->hash = poolHashCreate(sizehint);
- for (int i = 1; i < pool->offs_size; i++)
- poolHashAddEntry(pool, rpmstrPoolStr(pool, i), i);
+ for (int i = 1; i <= pool->offs_size; i++) {
+ /* this is a little bit tricky because we have to skip the dummy
+ * entries that are at the end of each chunk */
+ const char * str = rpmstrPoolStr(pool, i);
+ if (str[0] == 0 && i < pool->offs_size) {
+ /* looks like a dummy entry, check if next str is in a different chunk */
+ if (rpmstrPoolStr(pool, i + 1) != str + 1)
+ continue;
+ }
+ poolHashAddEntry(pool, str, i);
+ }
}
rpmstrPool rpmstrPoolCreate(void)
@@ -308,7 +317,8 @@ static rpmsid rpmstrPoolPut(rpmstrPool p
}
chunk_used = pool->offs[pool->offs_size] - pool->chunks[pool->chunks_size];
- if (ssize + 1 > pool->chunk_allocated - chunk_used) {
+ /* +2: extra trailing zero + extra byte */
+ if (ssize + 2 > pool->chunk_allocated - chunk_used) {
/* check size of ->chunks */
pool->chunks_size += 1;
if (pool->chunks_size >= pool->chunks_allocated) {
@@ -318,11 +328,12 @@ static rpmsid rpmstrPoolPut(rpmstrPool p
}
/* Check if string is bigger than chunks */
- if (ssize > pool->chunk_allocated) {
- pool->chunk_allocated = 2 * ssize;
+ if (ssize + 2 > pool->chunk_allocated) {
+ pool->chunk_allocated = 2 * ssize + 2;
}
/* Dummy entry for end of last string*/
+ pool->offs[pool->offs_size][0] = 0;
pool->offs_size += 1;
pool->offs[pool->offs_size] = xcalloc(1, pool->chunk_allocated);
++++++ suspendlock.diff ++++++
Suspend exclusive database lock when scriptlets get called, allowing
read access in scriptlets. Only needed for DB_PRIVATE (aka global)
locking.
--- ./lib/backend/db3.c.orig 2012-06-01 10:50:11.000000000 +0000
+++ ./lib/backend/db3.c 2012-06-01 10:50:19.000000000 +0000
@@ -628,3 +628,59 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
return rc;
}
+
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
+ int fdno = -1;
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_RDLCK;
+ rc = fcntl(fdno, F_SETLK, (void *)&l);
+ if (rc)
+ rpmlog(RPMLOG_WARNING, _("could not suspend database lock\n"));
+ return rc;
+}
+
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags)
+{
+ struct flock l;
+ int rc = 0;
+ int tries;
+ int fdno = -1;
+
+ if (!dbi->dbi_lockdbfd)
+ return 0;
+ if (!(dbi->dbi_rpmdb->db_mode & (O_RDWR|O_WRONLY)))
+ return 0;
+ if (_lockdbfd == 0)
+ return 0;
+ if (!(dbi->dbi_db->fd(dbi->dbi_db, &fdno) == 0 && fdno >= 0))
+ return 1;
+ for (tries = 0; tries < 2; tries++) {
+ memset(&l, 0, sizeof(l));
+ l.l_whence = 0;
+ l.l_start = 0;
+ l.l_len = 0;
+ l.l_type = F_WRLCK;
+ rc = fcntl(fdno, tries ? F_SETLKW : F_SETLK, (void *)&l);
+ if (!rc)
+ break;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING, _("waiting to reestablish exclusive database lock\n"));
+ }
+ return rc;
+}
+
--- ./lib/backend/dbi.h.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./lib/backend/dbi.h 2012-06-01 10:53:43.000000000 +0000
@@ -90,6 +90,24 @@ struct dbiIndex_s {
extern "C" {
#endif
+/** \ingroup dbi
+ * Suspend the exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiSuspendDBLock(dbiIndex dbi, unsigned int flags);
+
+/** \ingroup dbi
+ * Reacquire an exclusive lock on the dbi
+ * @param dbi index database handle
+ * @param flags (unused)
+ * @return 0 on success
+ */
+RPM_GNUC_INTERNAL
+int dbiResumeDBLock(dbiIndex dbi, unsigned int flags);
+
RPM_GNUC_INTERNAL
/* Globally enable/disable fsync in the backend */
--- ./lib/psm.c.orig 2012-06-01 10:50:11.000000000 +0000
+++ ./lib/psm.c 2012-06-01 10:51:34.000000000 +0000
@@ -419,10 +419,12 @@ static rpmRC runScript(rpmpsm psm, ARGV_
if (sfd == NULL)
sfd = rpmtsScriptFd(psm->ts);
+ rpmtsSuspendResumeDBLock(psm->ts, 0);
rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
rc = rpmScriptRun(script, arg1, arg2, sfd,
prefixes, warn_only, selinux);
rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+ rpmtsSuspendResumeDBLock(psm->ts, 1);
/* Map warn-only errors to "notfound" for script stop callback */
stoprc = (rc != RPMRC_OK && warn_only) ? RPMRC_NOTFOUND : rc;
--- ./lib/rpmdb.c.orig 2012-06-01 10:50:11.000000000 +0000
+++ ./lib/rpmdb.c 2012-06-01 10:50:19.000000000 +0000
@@ -769,6 +769,12 @@ int rpmdbSync(rpmdb db)
return dbiForeach(db->_dbi, dbiSync, 0);
}
+int rpmdbSuspendResumeDBLock(rpmdb db, int mode)
+{
+ if (db == NULL) return 0;
+ return dbiForeach(db->_dbi, mode ? dbiResumeDBLock : dbiSuspendDBLock, 0);
+}
+
static rpmdb newRpmdb(const char * root, const char * home,
int mode, int perms, int flags)
{
--- ./lib/rpmts.c.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./lib/rpmts.c 2012-06-01 10:50:19.000000000 +0000
@@ -95,6 +95,11 @@ int rpmtsOpenDB(rpmts ts, int dbmode)
return rc;
}
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode)
+{
+ return rpmdbSuspendResumeDBLock(ts->rdb, mode);
+}
+
int rpmtsInitDB(rpmts ts, int dbmode)
{
rpmlock lock = rpmtsAcquireLock(ts);
--- ./lib/rpmts.h.orig 2012-03-20 08:07:25.000000000 +0000
+++ ./lib/rpmts.h 2012-06-01 10:50:19.000000000 +0000
@@ -423,6 +423,8 @@ rpmdb rpmtsGetRdb(rpmts ts);
void * rpmtsNotify(rpmts ts, rpmte te,
rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
+int rpmtsSuspendResumeDBLock(rpmts ts, int mode);
+
/** \ingroup rpmts
* Return number of (ordered) transaction set elements.
* @param ts transaction set
++++++ symset-table ++++++
#! /bin/sh
# Create a table of all symbol sets defined in all /boot/symsets*.tar.gz
# files.
#
# Format:
# kernelrelease/modver/symbol <tab> symset <tab> symset_hash
#
# This table is needed for computing the appropriate Requires: tags for
# kernel module packages.
tmpdir=$(mktemp -t -d ${0##*/}.XXXXXX)
trap "cd / ; rm -rf $tmpdir" EXIT
cd $tmpdir
shopt -s nullglob
for symsets in /boot/symsets-*.tar.gz; do
zcat $symsets \
| tar xf -
done
for symsets in *; do
krel=${symsets#symsets-}
for symset in $symsets/*; do
class=${symset##*/} ; class=${class%.*}
hash=${symset##*.}
awk '
BEGIN { FS = "\t" ; OFS = "\t" }
{ sub(/0x0*/, "", $1)
print krel "/" $1 "/" $2, class, hash }
' krel="$krel" class="$class" hash="$hash" $symset
done
done
# vim:shiftwidth=4 softtabstop=4
++++++ sysconfig.services-rpm ++++++
## Path: System/Services
## Type: yesno
## Default: no
#
# Do you want to disable the automatic restart of services when
# a new version gets installed?
#
DISABLE_RESTART_ON_UPDATE="no"
## Type: yesno
## Default: no
#
# Do you want to disable the automatic shutdown of services when
# the corresponding package gets erased?
#
DISABLE_STOP_ON_REMOVAL="no"
++++++ taggedfileindex.diff ++++++
This used to be the taggedfileindex patch, but it's gone.
The remaining part just strips off the tag.
--- ./lib/rpmdb.c.orig 2011-05-11 14:27:32.000000000 +0000
+++ ./lib/rpmdb.c 2011-05-11 15:14:39.000000000 +0000
@@ -257,6 +257,9 @@ static int dbt2set(dbiIndex dbi, DBT * d
_DBSWAP(hdrNum);
_DBSWAP(tagNum);
}
+ /* remove tagged directory info */
+ if (tagNum.ui & 0x80000000)
+ tagNum.ui &= 0x0000ffff;
set->recs[i].hdrNum = hdrNum.ui;
set->recs[i].tagNum = tagNum.ui;
}
++++++ unpackmode0.diff ++++++
--- ./lib/fsm.c.orig 2013-06-10 15:55:10.000000000 +0000
+++ ./lib/fsm.c 2014-12-11 14:56:46.948898563 +0000
@@ -726,12 +726,18 @@ static int expandRegular(FSM_t fsm, rpmp
{
FD_t wfd = NULL;
const struct stat * st = &fsm->sb;
- rpm_loff_t left = st->st_size;
+ rpm_loff_t size = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix);
+ rpm_loff_t left = size;
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;
@@ -743,7 +749,7 @@ static int expandRegular(FSM_t fsm, rpmp
fidigest = rpmfiFDigestIndex(fi, fsm->ix, NULL, NULL);
}
- if (st->st_size > 0 && fidigest)
+ if (size > 0 && fidigest)
fdInitDigest(wfd, digestalgo, 0);
while (left) {
@@ -765,7 +771,7 @@ static int expandRegular(FSM_t fsm, rpmp
rpmpsmNotify(psm, RPMCALLBACK_INST_PROGRESS, rpmcpioTell(archive));
}
- if (st->st_size > 0 && fidigest) {
+ if (size > 0 && fidigest) {
void * digest = NULL;
(void) Fflush(wfd);
++++++ waitlock.diff ++++++
Fix global (DB_PRIVATE) lock code: fix recursion counter, retry
failed lock operations for up to 3 minutes.
--- ./lib/backend/db3.c.orig 2012-05-04 09:47:17.000000000 +0000
+++ ./lib/backend/db3.c 2012-06-01 10:47:01.000000000 +0000
@@ -422,6 +422,8 @@ int dbiVerify(dbiIndex dbi, unsigned int
return rc;
}
+static int _lockdbfd = 0;
+
int dbiClose(dbiIndex dbi, unsigned int flags)
{
rpmdb rdb = dbi->dbi_rpmdb;
@@ -439,6 +441,8 @@ int dbiClose(dbiIndex dbi, unsigned int
rpmlog(RPMLOG_DEBUG, "closed db index %s/%s\n",
dbhome, dbi->dbi_file);
+ if (dbi->dbi_lockdbfd && _lockdbfd)
+ _lockdbfd--;
}
db_fini(rdb, dbhome ? dbhome : "");
@@ -478,6 +482,7 @@ static int dbiFlock(dbiIndex dbi, int mo
rc = 1;
} else {
const char *dbhome = rpmdbHome(dbi->dbi_rpmdb);
+ int tries;
struct flock l;
memset(&l, 0, sizeof(l));
l.l_whence = 0;
@@ -487,20 +492,38 @@ static int dbiFlock(dbiIndex dbi, int mo
? F_RDLCK : F_WRLCK;
l.l_pid = 0;
- rc = fcntl(fdno, F_SETLK, (void *) &l);
- if (rc) {
- uint32_t eflags = db_envflags(db);
- /* Warning iff using non-private CDB locking. */
- rc = (((eflags & DB_INIT_CDB) && !(eflags & DB_PRIVATE)) ? 0 : 1);
- rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
- _("cannot get %s lock on %s/%s\n"),
- ((mode & O_ACCMODE) == O_RDONLY)
- ? _("shared") : _("exclusive"),
- dbhome, dbi->dbi_file);
- } else {
- rpmlog(RPMLOG_DEBUG,
- "locked db index %s/%s\n",
- dbhome, dbi->dbi_file);
+ for (tries = 0; ; tries++) {
+ rc = fcntl(fdno, F_SETLK, (void *) &l);
+ if (rc) {
+ uint32_t eflags = db_envflags(db);
+ /* Warning iff using non-private CDB locking. */
+ rc = (((eflags & DB_INIT_CDB) && !(eflags & DB_PRIVATE)) ? 0 : 1);
+ if (errno == EAGAIN && rc) {
+ struct timespec ts;
+ if (tries == 0)
+ rpmlog(RPMLOG_WARNING,
+ _("waiting for %s lock on %s/%s\n"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ ts.tv_sec = (time_t)0;
+ ts.tv_nsec = 100000000; /* .1 seconds */
+ if (tries < 10*60*3) { /* 3 minutes */
+ nanosleep(&ts, (struct timespec *)0);
+ continue;
+ }
+ }
+ rpmlog( (rc ? RPMLOG_ERR : RPMLOG_WARNING),
+ _("cannot get %s lock on %s/%s\n"),
+ ((mode & O_ACCMODE) == O_RDONLY)
+ ? _("shared") : _("exclusive"),
+ dbhome, dbi->dbi_file);
+ } else {
+ rpmlog(RPMLOG_DEBUG,
+ "locked db index %s/%s\n",
+ dbhome, dbi->dbi_file);
+ }
+ break;
}
}
return rc;
@@ -517,7 +540,6 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
DB * db = NULL;
DBTYPE dbtype = DB_UNKNOWN;
uint32_t oflags;
- static int _lockdbfd = 0;
if (dbip)
*dbip = NULL;
@@ -591,7 +613,10 @@ int dbiOpen(rpmdb rdb, rpmDbiTagVal rpmt
dbi->dbi_db = db;
dbi->dbi_oflags = oflags;
- if (!verifyonly && rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
+ if (verifyonly)
+ dbi->dbi_lockdbfd = 0; /* disable locking in verify mode */
+
+ if (rc == 0 && dbi->dbi_lockdbfd && _lockdbfd++ == 0) {
rc = dbiFlock(dbi, rdb->db_mode);
}
++++++ weakdeps.diff ++++++
Add support for weak dependencies:
A) use RPMTAG_SUGGESTS and RPMTAG_ENHANCES to store them.
This is different to upstream, which uses RPMSENSE_MISSINGOK
and RPMTAG_REQUIRES/RPMTAG_PROVIDES instead. I chose different
tags because I wanted to be compatible. The point is that
applications that don't know about the new MISSINGOK semantics
will mis-interpret the provides/requires otherwise, which
I deemed too risky.
B) use RPMSENSE_STRONG to support a "strong" version, "Recommends"
instead of "Suggests" and "Supplements" instead of "Enhances".
Needs extcond.diff for query operations.
--- build/parsePreamble.c
+++ build/parsePreamble.c
@@ -341,6 +341,8 @@
{ "verify", RPMSENSE_SCRIPT_VERIFY },
{ "pretrans", RPMSENSE_PRETRANS },
{ "posttrans", RPMSENSE_POSTTRANS },
+ { "hint", RPMSENSE_MISSINGOK },
+ { "strong", RPMSENSE_STRONG },
{ NULL, 0 }
};
@@ -795,6 +797,18 @@
if (parseRCPOT(spec, spec->sourcePackage, field, tag, 0, tagflags))
goto exit;
break;
+ case RPMTAG_SUGGESTSFLAGS:
+ case RPMTAG_ENHANCESFLAGS:
+ case RPMTAG_BUILDSUGGESTS:
+ case RPMTAG_BUILDENHANCES:
+ tagflags = RPMSENSE_MISSINGOK;
+ if (macro && (!strcmp(macro, "recommends") || !strcmp(macro, "buildrecommends")))
+ tagflags |= RPMSENSE_STRONG;
+ if (macro && (!strcmp(macro, "supplements") || !strcmp(macro, "buildsupplements")))
+ tagflags |= RPMSENSE_STRONG;
+ if ((rc = parseRCPOT(spec, pkg, field, tag, 0, tagflags)))
+ return rc;
+ break;
case RPMTAG_EXCLUDEARCH:
case RPMTAG_EXCLUSIVEARCH:
case RPMTAG_EXCLUDEOS:
@@ -903,6 +917,14 @@
{RPMTAG_BUGURL, 0, 0, LEN_AND_STR("bugurl")},
{RPMTAG_COLLECTIONS, 0, 0, LEN_AND_STR("collections")},
{RPMTAG_ORDERFLAGS, 2, 0, LEN_AND_STR("orderwithrequires")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("recommends")},
+ {RPMTAG_SUGGESTSFLAGS, 0, 0, LEN_AND_STR("suggests")},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("supplements")},
+ {RPMTAG_ENHANCESFLAGS, 0, 0, LEN_AND_STR("enhances")},
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildrecommends")},
+ {RPMTAG_BUILDSUGGESTS, 0, 0, LEN_AND_STR("buildsuggests")},
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildsupplements")},
+ {RPMTAG_BUILDENHANCES, 0, 0, LEN_AND_STR("buildenhances")},
{0, 0, 0, 0}
};
--- build/parseReqs.c
+++ build/parseReqs.c
@@ -92,6 +92,18 @@
case RPMTAG_BUILDCONFLICTS:
nametag = RPMTAG_CONFLICTNAME;
break;
+ case RPMTAG_SUGGESTSFLAGS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ break;
+ case RPMTAG_ENHANCESFLAGS:
+ nametag = RPMTAG_ENHANCESNAME;
+ break;
+ case RPMTAG_BUILDSUGGESTS:
+ nametag = RPMTAG_SUGGESTSNAME;
+ break;
+ case RPMTAG_BUILDENHANCES:
+ nametag = RPMTAG_ENHANCESNAME;
+ break;
}
for (r = field; *r != '\0'; r = re) {
--- build/reqprov.c
+++ build/reqprov.c
@@ -81,6 +81,18 @@
extra = Flags & RPMSENSE_TRIGGER;
dsp = &pkg->triggers;
break;
+ case RPMTAG_SUGGESTSNAME:
+ versiontag = RPMTAG_SUGGESTSVERSION;
+ flagtag = RPMTAG_SUGGESTSFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
+ dsp = &pkg->suggests;
+ break;
+ case RPMTAG_ENHANCESNAME:
+ versiontag = RPMTAG_ENHANCESVERSION;
+ flagtag = RPMTAG_ENHANCESFLAGS;
+ extra = Flags & _ALL_REQUIRES_MASK;
+ dsp = &pkg->enhances;
+ break;
case RPMTAG_REQUIRENAME:
default:
tagN = RPMTAG_REQUIRENAME;
--- build/rpmbuild_internal.h
+++ build/rpmbuild_internal.h
@@ -97,6 +97,8 @@
rpmds obsoletes;
rpmds triggers;
rpmds order;
+ rpmds suggests;
+ rpmds enhances;
rpmfi cpioList;
rpm_loff_t cpioArchiveSize;
--- build/rpmfc.c
+++ build/rpmfc.c
@@ -1087,6 +1087,12 @@
{ "Obsoletes", { "%{?__find_obsoletes}", NULL, NULL, NULL },
RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEVERSION, RPMTAG_OBSOLETEFLAGS,
0, -1 },
+ { "Enhances", { "%{?__find_enhances}", NULL, NULL, NULL },
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
+ RPMSENSE_STRONG, RPMSENSE_STRONG },
+ { "Supplements", { "%{?__find_supplements}", NULL, NULL, NULL },
+ RPMTAG_ENHANCESNAME, RPMTAG_ENHANCESVERSION, RPMTAG_ENHANCESFLAGS,
+ RPMSENSE_STRONG, 0 },
{ NULL, { NULL, NULL, NULL, NULL }, 0, 0, 0, 0, 0 }
};
@@ -1163,6 +1169,14 @@
continue;
tagflags = RPMSENSE_FIND_REQUIRES;
break;
+ case RPMTAG_ENHANCESFLAGS:
+ if (!pkg->autoProv)
+ continue;
+ failnonzero = 0;
+ tagflags = RPMSENSE_FIND_REQUIRES | RPMSENSE_MISSINGOK;
+ if (strcmp(dm->msg, "Supplements") == 0)
+ tagflags |= RPMSENSE_STRONG;
+ break;
default:
continue;
break;
--- build/spec.c
+++ build/spec.c
@@ -141,6 +141,8 @@
pkg->obsoletes = rpmdsFree(pkg->obsoletes);
pkg->triggers = rpmdsFree(pkg->triggers);
pkg->order = rpmdsFree(pkg->order);
+ pkg->suggests = rpmdsFree(pkg->suggests);
+ pkg->enhances = rpmdsFree(pkg->enhances);
pkg->fileList = argvFree(pkg->fileList);
pkg->fileFile = argvFree(pkg->fileFile);
pkg->policyList = argvFree(pkg->policyList);
--- lib/formats.c
+++ lib/formats.c
@@ -486,6 +486,19 @@
return val;
}
+static char * depflag_strongFormat(rpmtd td)
+{
+ char * val = NULL;
+
+ if (rpmtdClass(td) != RPM_NUMERIC_CLASS) {
+ val = xstrdup(_("(not a number)"));
+ } else {
+ uint64_t anint = rpmtdGetNumber(td);
+ val = xstrdup(anint & RPMSENSE_STRONG ? "strong" : "");
+ }
+ return val;
+}
+
/**
* Return tag container array size.
* @param td tag data container
@@ -591,6 +604,7 @@
{ RPMTD_FORMAT_VFLAGS, "vflags", vflagsFormat },
{ RPMTD_FORMAT_EXPAND, "expand", expandFormat },
{ RPMTD_FORMAT_FSTATUS, "fstatus", fstatusFormat },
+ { RPMTD_FORMAT_DEPFLAG_STRONG, "depflag_strong", depflag_strongFormat },
{ -1, NULL, NULL }
};
--- lib/rpmds.c
+++ lib/rpmds.c
@@ -70,6 +70,14 @@
t = "Trigger";
evr = RPMTAG_TRIGGERVERSION;
f = RPMTAG_TRIGGERFLAGS;
+ } else if (tag == RPMTAG_ENHANCESNAME) {
+ t = "Enhances";
+ evr = RPMTAG_ENHANCESVERSION;
+ f = RPMTAG_ENHANCESFLAGS;
+ } else if (tag == RPMTAG_SUGGESTSNAME) {
+ t = "Suggests";
+ evr = RPMTAG_SUGGESTSVERSION;
+ f = RPMTAG_SUGGESTSFLAGS;
} else {
rc = 1;
}
--- lib/rpmds.h
+++ lib/rpmds.h
@@ -48,7 +48,7 @@
RPMSENSE_RPMLIB = (1 << 24), /*!< rpmlib(feature) dependency. */
RPMSENSE_TRIGGERPREIN = (1 << 25), /*!< %triggerprein dependency. */
RPMSENSE_KEYRING = (1 << 26),
- /* bit 27 unused */
+ RPMSENSE_STRONG = (1 << 27),
RPMSENSE_CONFIG = (1 << 28)
};
@@ -70,6 +70,7 @@
RPMSENSE_FIND_REQUIRES | \
RPMSENSE_RPMLIB | \
RPMSENSE_KEYRING | \
+ RPMSENSE_STRONG | \
RPMSENSE_PRETRANS | \
RPMSENSE_POSTTRANS | \
RPMSENSE_PREREQ | \
--- lib/rpmtag.h
+++ lib/rpmtag.h
@@ -217,14 +217,14 @@
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_SUGGESTSNAME = 1156, /* s[] extension */
+#define RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME /* s[] */
+ RPMTAG_SUGGESTSVERSION = 1157, /* s[] extension */
+ RPMTAG_SUGGESTSFLAGS = 1158, /* i[] extension */
+ RPMTAG_ENHANCESNAME = 1159, /* s[] extension */
+#define RPMTAG_ENHANCES RPMTAG_ENHANCESNAME /* s[] */
+ RPMTAG_ENHANCESVERSION = 1160, /* s[] extension */
+ RPMTAG_ENHANCESFLAGS = 1161, /* i[] extension */
RPMTAG_PRIORITY = 1162, /* i[] extension placeholder (unimplemented) */
RPMTAG_CVSID = 1163, /* s (unimplemented) */
#define RPMTAG_SVNID RPMTAG_CVSID /* s (unimplemented) */
--- lib/rpmtd.h
+++ lib/rpmtd.h
@@ -228,6 +228,7 @@
RPMTD_FORMAT_VFLAGS = 17, /* file verify flags (int types) */
RPMTD_FORMAT_EXPAND = 18, /* macro expansion (string types) */
RPMTD_FORMAT_FSTATUS = 19, /* file verify status (int types) */
+ RPMTD_FORMAT_DEPFLAG_STRONG = 20, /* strong dependency (int types) */
} rpmtdFormats;
/** \ingroup rpmtd
--- python/rpmmodule.c
+++ python/rpmmodule.c
@@ -393,6 +393,7 @@
REGISTER_ENUM(RPMSENSE_RPMLIB);
REGISTER_ENUM(RPMSENSE_TRIGGERPREIN);
REGISTER_ENUM(RPMSENSE_KEYRING);
+ REGISTER_ENUM(RPMSENSE_STRONG);
REGISTER_ENUM(RPMSENSE_CONFIG);
REGISTER_ENUM(RPMTRANS_FLAG_TEST);
--- rpmpopt.in
+++ rpmpopt.in
@@ -67,6 +67,22 @@
--POPTdesc=$"list capabilities required by package(s)"
rpm alias -R --requires
+rpm alias --suggests --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{}:{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package suggests"
+
+rpm alias --recommends --qf \
+ "[%|SUGGESTSFLAGS:depflag_strong?{%{SUGGESTSNAME} %{SUGGESTSFLAGS:depflags} %{SUGGESTSVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package recommends"
+
+rpm alias --enhances --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{}:{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package enhances"
+
+rpm alias --supplements --qf \
+ "[%|ENHANCESFLAGS:depflag_strong?{%{ENHANCESNAME} %{ENHANCESFLAGS:depflags} %{ENHANCESVERSION}\n}|]" \
+ --POPTdesc=$"list capabilities this package supplements"
+
rpm alias --info --qf '\
Name : %{NAME}\n\
%|EPOCH?{Epoch : %{EPOCH}\n}|\
--- tests/rpmgeneral.at
+++ tests/rpmgeneral.at
@@ -79,6 +79,10 @@
DISTURL
DSAHEADER
E
+ENHANCES
+ENHANCESFLAGS
+ENHANCESNAME
+ENHANCESVERSION
EPOCH
EPOCHNUM
EVR
@@ -219,6 +223,10 @@
SOURCEPACKAGE
SOURCEPKGID
SOURCERPM
+SUGGESTS
+SUGGESTSFLAGS
+SUGGESTSNAME
+SUGGESTSVERSION
SUMMARY
TRIGGERCONDS
TRIGGERFLAGS
++++++ whatrequires-doc.diff ++++++
--- ./doc/rpm.8.orig 2011-01-05 08:11:09.000000000 +0000
+++ ./doc/rpm.8 2011-05-11 15:36:18.000000000 +0000
@@ -564,6 +564,11 @@ Query all packages that provide the \fIC
.TP
\fB--whatrequires \fICAPABILITY\fB\fR
Query all packages that require \fICAPABILITY\fR for proper functioning.
+.br
+Note that this does not return what requires a given package.
+A package usually provides multiple capabilities and file-names on which
+other packages may depend. To see the complete dependencies
+for a package, use \fB-e --test \fIPACKAGE_NAME\fB\fR
.SS "PACKAGE QUERY OPTIONS:"
.PP
.TP
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org