summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbiao716.wang <biao716.wang@samsung.com>2021-02-23 17:00:38 +0900
committerbiao716.wang <biao716.wang@samsung.com>2021-02-23 17:00:38 +0900
commit2af3c624872b944f5d294b7b71e765b76d87b277 (patch)
tree5dd8d09f024e4deb784b48857bcfd256a18f224e
parent3a32c23a16ded3a5efc395235f28bfd9df2f0f29 (diff)
downloadrpm-2af3c624872b944f5d294b7b71e765b76d87b277.tar.gz
rpm-2af3c624872b944f5d294b7b71e765b76d87b277.tar.bz2
rpm-2af3c624872b944f5d294b7b71e765b76d87b277.zip
Change-Id: I6492ba2f49b43470edff096685621147bdadbcfc Signed-off-by: biao716.wang <biao716.wang@samsung.com>
-rw-r--r--macros.in29
-rwxr-xr-xmkinstalldirs4
-rwxr-xr-xscripts/find-debuginfo.sh17
-rwxr-xr-xscripts/rpm2cpio.sh2
-rw-r--r--tools/debugedit.c50
-rw-r--r--tools/elfdeps.c4
6 files changed, 46 insertions, 60 deletions
diff --git a/macros.in b/macros.in
index ea09df389..0fe8ff205 100644
--- a/macros.in
+++ b/macros.in
@@ -235,8 +235,8 @@ package or when debugging this package.\
%{nil}
%_defaultdocdir %{_datadir}/doc/packages
+%_docdir_fmt %%{NAME}
%_defaultlicensedir %{_datadir}/licenses
-%_docdir_fmt %%{NAME}
# Following macros for filtering auto deps must not be used in spec files.
# Their purpouse is to set up global filtering for all packages. If you need
@@ -327,6 +327,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
@@ -555,7 +565,6 @@ package or when debugging this package.\
# --unique-debug-suffix "-%{VERSION}-%{RELEASE}.%{_arch} find-debuginfo.sh
# to create debuginfo files which end in -<ver>-<rel>.<arch>.debug
# Requires _unique_build_ids.
-#For legacy compatibility, Temply change _unique_debug_names to 0.
#%_unique_debug_names 0
# Whether the /usr/debug/src/<package> directories should be unique between
@@ -583,8 +592,8 @@ package or when debugging this package.\
%__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
+# 2014/10/13 (SLES12 GA)
+%_binarychangelogtrim 0,1413151200,10
#
# Path to scripts to autogenerate package dependencies,
@@ -596,11 +605,11 @@ 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 %{__set_helper_env}%{_rpmconfigdir}/find-provides %name
-%__find_requires %{__set_helper_env}%{_rpmconfigdir}/find-requires %name
+%__find_provides %{_rpmconfigdir}/find-provides %name
+%__find_requires %{_rpmconfigdir}/find-requires %name
#%__find_conflicts ???
#%__find_obsoletes ???
-%__find_supplements %{__set_helper_env}%{_rpmconfigdir}/find-supplements %name
+%__find_supplements %{_rpmconfigdir}/find-supplements %name
#%__find_enhances ???
#
@@ -680,10 +689,10 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
# 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.
@@ -1002,7 +1011,7 @@ posix.setenv("RPMBUILD_SOURCEDIR",rpm.expand("%?_sourcedir"));
%_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@
diff --git a/mkinstalldirs b/mkinstalldirs
index 55d537f87..a31ce6d02 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2009-04-28.21; # UTC
+scriptversion=2016-01-11.22; # UTC
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
@@ -157,6 +157,6 @@ exit $errstatus
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index 3276b6dcf..51bc61af6 100755
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -250,6 +250,7 @@ strip_to_debug()
local g=
local r=
+
if test "$strip_disable" = true ; then
exit
fi
@@ -385,8 +386,7 @@ trap 'rm -rf "$temp"' EXIT
# Build a list of unstripped ELF files and their hardlinks
touch "$temp/primary"
-# 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 |
+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
@@ -470,7 +470,7 @@ do_file()
esac
mkdir -p "${debugdn}"
- if [ -e "${BUILDDIR}/Kconfig" ] ; then
+ if [ -e "${BUILDDIR}/Kconfig" ] ; then
mode=$(stat -c %a "$f")
chmod +w "$f"
objcopy --only-keep-debug $f $debugfn || :
@@ -505,7 +505,6 @@ do_file()
fi
fi
-
# strip -g implies we have full symtab, don't add mini symtab in that case.
# It only makes sense to add a minisymtab for executables and shared
# libraries. Other executable ELF files (like kernel modules) don't need it.
@@ -586,7 +585,7 @@ fi
# Invoke the DWARF Compressor utility.
if $run_dwz \
&& [ -d "${RPM_BUILD_ROOT}/usr/lib/debug" ]; then
- readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug)
+ readarray dwz_files < <(cd "${RPM_BUILD_ROOT}/usr/lib/debug"; find -type f -name \*.debug | LC_ALL=C sort)
if [ ${#dwz_files[@]} -gt 0 ]; then
dwz_multifile_name="${RPM_PACKAGE_NAME}-${RPM_PACKAGE_VERSION}-${RPM_PACKAGE_RELEASE}.${RPM_ARCH}"
dwz_multifile_suffix=
@@ -644,7 +643,6 @@ fi
# fi
#done
-
if [ -s "$SOURCEFILE" ]; then
# See also debugedit invocation. Directories must match up.
debug_base_name="$RPM_BUILD_DIR"
@@ -662,15 +660,16 @@ if [ -s "$SOURCEFILE" ]; then
# Get package name from directory and then filter out all files not
# starting with this name
- pn=$(basename "$BUILDDIR")
+ #remove old patch: 6428714ec2f4a0aa2b3c3b2e1b81c2cedf06e8c6
+ #pn=$(basename "$BUILDDIR")
LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(^|/)<[a-z _-]+>$' |
- grep -E -z "^${pn}" |
+ #grep -E -z "^${pn}" |
(cd "${debug_base_name}"; cpio -pd0mL "${RPM_BUILD_ROOT}${debug_dest_name}")
# stupid cpio creates new directories in mode 0700,
# and non-standard modes may be inherented from original directories, fixup
find "${RPM_BUILD_ROOT}${debug_dest_name}" -type d -print0 |
xargs --no-run-if-empty -0 chmod 0755
- find "${RPM_BUILD_ROOT}/usr/src/debug" -type f -print0 |
+ find "${RPM_BUILD_ROOT}${debug_dest_name}" -type f -print0 |
xargs --no-run-if-empty -0 chmod a+r
fi
diff --git a/scripts/rpm2cpio.sh b/scripts/rpm2cpio.sh
index a883562ac..daa8613ef 100755
--- a/scripts/rpm2cpio.sh
+++ b/scripts/rpm2cpio.sh
@@ -11,7 +11,7 @@ pkg="$1"
_dd() {
local o="$1"; shift
- dd if="$pkg" skip="$o" iflag=skip_bytes status=none $*
+ dd if="$pkg" skip="$o" iflag=skip_bytes $*
}
calcsize() {
diff --git a/tools/debugedit.c b/tools/debugedit.c
index 1912f8963..6c572ae09 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -858,9 +858,6 @@ record_file_string_entry_idx (struct strings *strings, size_t old_idx)
struct stridxentry *entry = string_find_new_entry (strings, old_idx);
if (entry != NULL)
{
- if (old_idx >= debug_sections[DEBUG_STR].size)
- error (1, 0, "Bad string pointer index %zd", old_idx);
-
Strent *strent;
const char *old_str = (char *)debug_sections[DEBUG_STR].data + old_idx;
const char *file = skip_dir_prefix (old_str, base_dir);
@@ -911,9 +908,6 @@ record_existing_string_entry_idx (struct strings *strings, size_t old_idx)
struct stridxentry *entry = string_find_new_entry (strings, old_idx);
if (entry != NULL)
{
- if (old_idx >= debug_sections[DEBUG_STR].size)
- error (1, 0, "Bad string pointer index %zd", old_idx);
-
const char *str = (char *)debug_sections[DEBUG_STR].data + old_idx;
Strent *strent = strtab_add_len (strings->str_tab,
str, strlen (str) + 1);
@@ -1577,18 +1571,10 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase)
{
const char *dir;
size_t idx = do_read_32_relocated (ptr);
- /* In phase zero we collect the comp_dir. */
- if (phase == 0)
- {
- if (idx >= debug_sections[DEBUG_STR].size)
- error (1, 0,
- "%s: Bad string pointer index %zd for comp_dir",
- dso->filename, idx);
- dir = (char *) debug_sections[DEBUG_STR].data + idx;
+ dir = (char *) debug_sections[DEBUG_STR].data + idx;
- free (comp_dir);
- comp_dir = strdup (dir);
- }
+ free (comp_dir);
+ comp_dir = strdup (dir);
if (dest_dir != NULL && phase == 0)
{
@@ -1608,29 +1594,21 @@ edit_attributes (DSO *dso, unsigned char *ptr, struct abbrev_tag *t, int phase)
unit. If starting with / it is a full path name.
Note that we don't handle DW_FORM_string in this
case. */
+ char *name;
size_t idx = do_read_32_relocated (ptr);
-
- /* In phase zero we will look for a comp_dir to use. */
- if (phase == 0)
+ name = (char *) debug_sections[DEBUG_STR].data + idx;
+ if (*name == '/' && comp_dir == NULL)
{
- if (idx >= debug_sections[DEBUG_STR].size)
- error (1, 0,
- "%s: Bad string pointer index %zd for unit name",
- dso->filename, idx);
- char *name = (char *) debug_sections[DEBUG_STR].data + idx;
- if (*name == '/' && comp_dir == NULL)
- {
- char *enddir = strrchr (name, '/');
+ char *enddir = strrchr (name, '/');
- if (enddir != name)
- {
- comp_dir = malloc (enddir - name + 1);
- memcpy (comp_dir, name, enddir - name);
- comp_dir [enddir - name] = '\0';
- }
- else
- comp_dir = strdup ("/");
+ if (enddir != name)
+ {
+ comp_dir = malloc (enddir - name + 1);
+ memcpy (comp_dir, name, enddir - name);
+ comp_dir [enddir - name] = '\0';
}
+ else
+ comp_dir = strdup ("/");
}
/* First pass (0) records the new name to be
diff --git a/tools/elfdeps.c b/tools/elfdeps.c
index a1c1a6a00..5eead404c 100644
--- a/tools/elfdeps.c
+++ b/tools/elfdeps.c
@@ -16,9 +16,9 @@
int filter_private = 0;
int soname_only = 0;
int fake_soname = 1;
-int assume_exec = 0;
int filter_soname = 1;
int require_interp = 0;
+int assume_exec = 0;
typedef struct elfInfo_s {
Elf *elf;
@@ -364,9 +364,9 @@ 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 },
{ "no-filter-soname", 0, POPT_ARG_VAL, &filter_soname, 0, NULL, NULL },
{ "require-interp", 0, POPT_ARG_VAL, &require_interp, -1, NULL, NULL },
+ { "assume-exec", 0, POPT_ARG_VAL, &assume_exec, -1, NULL, NULL },
POPT_AUTOHELP
POPT_TABLEEND
};