Commit ae3f50ff authored by Michal Čihař's avatar Michal Čihař

Imported Upstream version 4.12.0.1

parent d15d165f
This diff is collapsed.
......@@ -8,8 +8,7 @@ include $(top_srcdir)/rpm.am
CLEANFILES =
EXTRA_DIST = CHANGES ChangeLog CREDITS GROUPS INSTALL \
autodeps autogen.sh \
db3/configure installplatform platform.in
autogen.sh db3/configure installplatform platform.in
BUILT_SOURCES =
SUBDIRS = po misc
......@@ -72,6 +71,7 @@ pkginclude_HEADERS += lib/rpmcli.h
pkginclude_HEADERS += lib/rpmlib.h
pkginclude_HEADERS += lib/rpmds.h
pkginclude_HEADERS += lib/rpmfi.h
pkginclude_HEADERS += lib/rpmfiles.h
pkginclude_HEADERS += lib/rpmlegacy.h
pkginclude_HEADERS += lib/rpmpol.h
pkginclude_HEADERS += lib/rpmps.h
......@@ -82,6 +82,7 @@ pkginclude_HEADERS += lib/rpmte.h
pkginclude_HEADERS += lib/rpmts.h
pkginclude_HEADERS += lib/rpmtypes.h
pkginclude_HEADERS += lib/rpmvf.h
pkginclude_HEADERS += lib/rpmarchive.h
pkginclude_HEADERS += sign/rpmsign.h
......@@ -94,13 +95,13 @@ rpmbindir = `echo $(bindir) | $(SED) -e s,usr/bin,bin,`
rpmbin_PROGRAMS = rpm
bin_PROGRAMS = rpm2cpio rpmbuild rpmdb rpmkeys rpmsign rpmspec
if WITH_ARCHIVE
bin_PROGRAMS += rpm2archive
endif
rpmlibexec_PROGRAMS =
rpmconfig_SCRIPTS = autodeps/find-provides autodeps/find-requires \
mkinstalldirs \
rpmconfig_SCRIPTS = mkinstalldirs \
config.guess config.sub
DISTCLEANFILES = autodeps/find-provides
DISTCLEANFILES += autodeps/find-requires
noinst_LTLIBRARIES = libcliutils.la
libcliutils_la_SOURCES = cliutils.h cliutils.c
......@@ -148,6 +149,10 @@ rpm2cpio_SOURCES = rpm2cpio.c debug.h system.h
rpm2cpio_LDADD = lib/librpm.la rpmio/librpmio.la
rpm2cpio_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@
rpm2archive_SOURCES = rpm2archive.c debug.h system.h
rpm2archive_LDADD = lib/librpm.la rpmio/librpmio.la
rpm2archive_LDADD += @WITH_NSS_LIB@ @WITH_POPT_LIB@ @WITH_ZLIB_LIB@ @WITH_ARCHIVE_LIB@
if LIBELF
if LIBDWARF
......@@ -265,7 +270,7 @@ EXTRA_DIST += doc/hacking.doxy.in doc/hacking/Doxyheader
# Always build librpm docs
if DOXYGEN
doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am $(pkginclude_HEADERS)
doc/librpm.doxy: doc/librpm.doxy.in doc/librpm/Doxyheader Makefile.am configure.ac $(pkginclude_HEADERS)
files=`echo " $(HEADERS)" | $(SED) -e "s, , \@top_srcdir\@/,g"`; \
$(SED) -e "s,[@]pkginclude_HEADERS[@],$$files," \
-e "s,\@top_srcdir\@/,$(top_srcdir)/,g" \
......@@ -286,7 +291,7 @@ db.h: $(top_builddir)/db3/db.h
$(LN_S) $(top_builddir)/db3/db.h $@
BUILT_SOURCES += db.h
endif
DISTCLEANFILES += db.h
DISTCLEANFILES = db.h
clean-local:
rm -rf doc/hacking/html
......
This diff is collapsed.
/find-provides
/find-requires
#! /usr/bin/ksh
# Original Author: Ralph Goers(rgoer@Candle.Com)
# Borrowed heavily from Tim Mooney's HP version.
# This file is distributed under the terms of the GNU General Public License
#
# find-requires is part of RPM, the RedHat Package Manager. find-requires
# reads a list of full pathnames (in a package) on stdin, and outputs all
# shared libraries the package requires to run correctly.
#
find_prov_ia64()
{
# On AIX for IA64, use the file command to find shared modules
#
# Example file output:
#
#$file /usr/lib/ia64l32/libc.so
#/usr/lib/ia64l32/libc.so: ELF 32-bit LSB version 1 AIX shared obj IA-64
#
#
#
# Search for shared objects - the file command on AIX for IA64 reports
# shared objects
sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*shared obj" | cut -d: -f1 | sed "s/\/$//g" | xargs -i basename {} | sort -u
}
find_prov_power()
{
#
# Example dump output:
#
#$dump -H /usr/bin/dump
#
#/usr/bin/dump:
#
# ***Loader Section***
# Loader Header Information
#VERSION# #SYMtableENT #RELOCent LENidSTR
#0x00000001 0x00000021 0x0000006c 0x0000002f
#
##IMPfilID OFFidSTR LENstrTBL OFFstrTBL
#0x00000002 0x00000848 0x00000049 0x00000877
#
#
# ***Import File Strings***
#INDEX PATH BASE MEMBER
#0 /usr/lib:/lib:/usr/lpp/xlC/lib
#1 libc.a shr.o
#
#
# Search executables, archives, and symlinks to those types for shared
# objects
sed -e "s/['\"]/\\\&/g" -e "s/$/\//g" | LANG=C xargs file | grep -e ":.*executable" -e ":.*archive" | cut -d: -f1 | sed "s/\/$//g" |
# Use the verbose version of dump to find the sharable objects
while read f
do
LANG=C /usr/bin/dump -ov $f/ 2>/dev/null | grep -E "^Flags.*SHROBJ|:$" |
awk 'match($1,":$") { member=$1 }
!match($1,":$") {print member} '
done | sed -e 's/:$//' -e 's/\/\[/\(/g' -e 's/\]/)/g' | xargs -i basename {} |
sort -u
}
PATH=/usr/bin
machinetype=`uname -m`
if [[ $machinetype = "ia64" ]]
then
find_prov_ia64
else
find_prov_power
fi
#! /usr/bin/ksh
# Original Author: Ralph Goers(rgoer@Candle.Com)
# Borrowed heavily from Tim Mooney's HP version.
# This file is distributed under the terms of the GNU General Public License
#
# find-requires is part of RPM, the RedHat Package Manager. find-requires
# reads a list of full pathnames (in a package) on stdin, and outputs all
# shared libraries the package requires to run correctly.
#
find_req_power ()
{
# On AIX Power, use `dump -H' to find the library dependencies
# for an executable
#
# Example dump output:
#
#$dump -H /usr/bin/dump
#
#/usr/bin/dump:
#
# ***Loader Section***
# Loader Header Information
#VERSION# #SYMtableENT #RELOCent LENidSTR
#0x00000001 0x00000021 0x0000006c 0x0000002f
#
##IMPfilID OFFidSTR LENstrTBL OFFstrTBL
#0x00000002 0x00000848 0x00000049 0x00000877
#
#
# ***Import File Strings***
#INDEX PATH BASE MEMBER
#0 /usr/lib:/lib:/usr/lpp/xlC/lib
#1 libc.a shr.o
#
#
while read f
do
# Find the required symbols in executables and the required shells in
# scripts
LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script"
if [ $? -ne 0 ] # Use dump to examine executables
then
LANG=C /usr/bin/dump -H $f 2>/dev/null | awk '
#
# Since this entire awk script is enclosed in single quotes,
# you need to be careful to not use single quotes, even in awk
# comments, if you modify this script.
#
BEGIN {
in_shlib_list = 0;
in_file_strings = 0;
FS = " ";
RS = "\n";
}
in_shlib_list == 1 && /^$/ {
in_shlib_list = 0;
in_file_strings = 0;
}
in_shlib_list == 1 {
pos = index($2, "/")
numfields = split($0, fields, " ")
if (pos == 0) {
namevar = 2
}
else {
namevar = 3
}
if (namevar < numfields) {
printf("%s(%s)\n", fields[namevar], fields[namevar+1])
}
else {
if ((fields[namevar] != ".") && (fields[namevar] != "..")) {
print fields[namevar]
}
}
}
in_file_strings == 1 && $1 == "0" {
in_shlib_list = 1
}
/\*Import File Strings\*/ {
in_file_strings = 1
}
' # end of awk
else # shell scripts
if [ -x $f ]; then
/usr/bin/head -1 $f | /usr/bin/sed -e 's/^\#\![ ]*//' | /usr/bin/cut -d" " -f1
fi
fi
done | sort -u
}
find_req_ia64 ()
{
# On AIX IA64, use `dump -Lv' to find the library dependencies
# for an executable
#
# Example dump output:
#
#$dump -Lv /usr/bin/dump
#
#
#/usr/bin/dump:
#
# **** DYNAMIC SECTION INFORMATION ****
#[INDEX] Tag Value
#
#.dynamic:
#[1] NEEDED libC.so.1
#[2] NEEDED libelf.so
#[3] NEEDED /usr/lib/ia64l32/libc.so.1
#[4] INIT 0x1001d6c0
#[5] FINI 0x1001d700
#[6] HASH 0x1000011c
#[7] STRTAB 0x10000914
#[8] SYMTAB 0x10000364
#[9] STRSZ 0x3dd
#[10] SYMENT 0x10
#[11] PLTGOT 0x20018994
#[12] PLT_RESERVE 0x20018a00
#[13] PLTSZ 0x1c0
#[14] PLTREL REL
#[15] JMPREL 0x100024bc
#[16] REL 0x10000cf4
#[17] RELSZ 0x17c8
#[18] RELENT 0x8
#
#
while read f
do
# Find the required symbols in executables and the required shells in
# scripts
LANG=C /usr/bin/file $f | /usr/bin/grep -q -e ":.*shell script"
if [ $? -ne 0 ] # Use dump to examine executables
then
LANG=C /usr/bin/dump -Lv $f 2>/dev/null | \
awk '$2=="NEEDED" {print $3}' | xargs -i basename {}
else # Extract the exec module from shell scripts
if [ -x $f ]; then
head -1 $f | sed -e 's/^\#\![ ]*//' | cut -d" " -f1
fi
fi
done | sort -u
}
machinetype=`uname -m`
if [[ $machinetype = "ia64" ]]
then
/usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \
/usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 |
find_req_ia64
else
/usr/bin/sed "s/['\"]/\\\&/g" | LANG=C /usr/bin/xargs /usr/bin/file | \
/usr/bin/grep -e ":.*executable" -e ":.*archive" -e ":.*shell script" | /usr/bin/cut -d: -f1 |
find_req_power
fi
#! /usr/bin/ksh
# Current Maintainer: Tim Mooney <mooney@golem.phys.ndsu.NoDak.edu>
#
# Original Author: Ralph Goers(rgoer@Candle.Com)
# Borrowed heavily from H10 version created by Tim Mooney.
# This file is distributed under the terms of the GNU Public License
#
# find-provides is part of RPM, the RedHat Package Manager. find-provides
# reads a list of full pathnames (in a package) on stdin, and outputs all
# shared libraries provided by (contained in) the package.
#
# On AIX, use `dump -o' to find what the library provides, if anything.
#
#
# Ralph's comments:
#
# Executables are skipped because, by convention, shared libraries
# which are not dynamically loaded are packaged as archives. Also,
# it is impossible to tell the difference between an executable
# program and a dynamically loaded shared library.
#
# Because archives can contain any number of things, including
# apparently, multiple shared libraries, dependencies in archives
# will be specified as file[member]. Any member in an archive which
# has a loader section will be listed as provided.
#
# Tim's (subsequent) comments:
#
# Based on discussions on the rpm-list in mid-March of 2000, I've modified
# the copy of find-provides that Ralph provided me to use `dump -o' instead
# of `dump -H', and I've followed Brandon S. Allbery's suggestions and modified
# the awk script to look for a modtype of `RE', which is what constitutes a
# shared member of a library. Just like everything else on AIX, libraries are
# weird. :-|
#
# I've followed Ralph's convention of generating provides in the form of
# `filebasename(member-object)' *if* there is a member object, or just
# `filebasename' if there isn't (such as in the case of certain perl modules,
# locally built shared libraries, etc.).
#
# Example dump output:
#
#$dump -o /usr/lpp/X11/lib/R6/libX11.a
#
#/usr/lpp/X11/lib/R6/libX11.a[shr4.o]:
#
# ***Object Module Header***
## Sections Symbol Ptr # Symbols Opt Hdr Len Flags
# 4 0x00126c28 14557 72 0x3002
#Timestamp = 920377624
#Magic = 0x1df
#
# ***Optional Header***
#Tsize Dsize Bsize Tstart Dstart
#0x000bcc20 0x00024bd4 0x00000e0c 0x00000000 0x00000000
#
#SNloader SNentry SNtext SNtoc SNdata
#0x0004 0x0000 0x0001 0x0002 0x0002
#
#TXTalign DATAalign TOC vstamp entry
#0x0005 0x0003 0x00023d74 0x0001 0xffffffff
#
#maxSTACK maxDATA SNbss magic modtype
#0x00000000 0x00000000 0x0003 0x010b RE
#
#/usr/lpp/X11/lib/R6/libX11.a[shr4net.o]:
#
# ***Object Module Header***
## Sections Symbol Ptr # Symbols Opt Hdr Len Flags
# 7 0x000006fb 22 72 0x3002
#Timestamp = 774732998
#Magic = 0x1df
#
# ***Optional Header***
#Tsize Dsize Bsize Tstart Dstart
#0x00000084 0x00000088 0x00000000 0x00000200 0x00000000
#
#SNloader SNentry SNtext SNtoc SNdata
#0x0007 0x0000 0x0002 0x0004 0x0004
#
#TXTalign DATAalign TOC vstamp entry
#0x0002 0x0003 0x00000080 0x0001 0xffffffff
#
#maxSTACK maxDATA SNbss magic modtype
#0x00000000 0x00000000 0x0005 0x010b RE
PATH=/usr/bin:/usr/ccs/bin
export PATH
#
# TVM: Marc Stephenson (marc@austin.ibm.com) points out we run things
# like `file', et. al. and expect the output to be what we see in the
# C/POSIX locale. Make sure it is so.
#
LANG=C
export LANG
#
# TVM: Because AIX libraries don't have the equivalent of a SONAME, if you do
#
# ln -s /usr/lib/libc.a /tmp/libmy_libc_link.a
#
# and then link your program with `-L/tmp -lmy_libc_link', that's the name
# that will be recorded as the BASE in the Import File Strings area.
# This means we need to include "symbolic link" in the list of files to check
# out.
#
filelist=`sed "s/['\"]/\\\&/g" | xargs file \
| grep -E 'archive|executable|symbolic link' | cut -d: -f1`
for f in $filelist
do
#
# Uncomment the next line for some additional debugging info:
#echo "Checking $f"
dump -o $f 2>/dev/null | awk '
# TVM: be careful to not use any single quotes, even in comments,
# since this entire awk script is enclosed in single quotes.
BEGIN {
FS = " ";
RS = "\n";
# our flag to indicate we found a filename[membername] or
# filename.
found_file_or_member = 0
# our flag to indicate we found the modtype tag. If so,
# we want to look for RE on the next line.
found_modtype = 0
#
# number of times gsub substituted, used twice below
nsub = 0
}
# Uncomment the next line for some debugging info.
# { print NR , ":", $0 }
found_modtype == 1 && found_file_or_member == 1 {
if ( $0 ~ / RE/ ) {
# we have seen a filename, we have seen a modtype line, and now
# we know that the modtype is RE. Print out the member name.
#
# Note that member names generally look like foo[bar.o], and
# since the RPM standard has become to use parens, we will
# translate the [ and ] into ( and ) in the output stream.
# awk on AIX 4 has sub() and gsub(), so we can use them to do
# it. If this script is adapted for use on some other platform
# make sure that awk on that platform has sub/gsub. If not,
# you will need to postprocess the output stream (probably before
# the sort -u) with tr or sed.
nsub = gsub(/\[/, "(", member)
if ( nsub > 1 ) {
print "substituted too many times for [:", member | "cat 1>&2"
}
nsub = gsub(/\]/, ")", member)
if ( nsub > 1 ) {
print "substituted too many times for ]:", member | "cat 1>&2"
}
print member
}
# In any case, reset our flags to zero, to indicate we are done
# with this member, so we are ready to handle additional members
# if needed.
found_file_or_member = 0
found_modtype = 0
}
found_file_or_member == 1 && /magic *modtype/ {
# we have seen a filename, and now we have seen the modtype
# line. Set the found_modtype flag. The next line of input
# will be caught by the rule above, and we will print out
# the member if the modtype is RE.
found_modtype = 1
}
/:$/ {
numfields = split($0,fields, "/")
# chop off the trailing colon
fieldlen = length(fields[numfields])-1
member= substr(fields[numfields], 1, fieldlen)
# Set the flat to indicate we found a file or a file(member).
found_file_or_member = 1
}
' # end of awk
done | sort -u
#comment out the previous line and uncomment the next line when debugging
#done
#! /usr/bin/ksh
#
# Current Maintainer: Tim Mooney <mooney@golem.phys.ndsu.NoDak.edu>
# Original Author: Ralph Goers(rgoer@Candle.Com)
#
# This file is distributed under the terms of the GNU Public License
#
# find-requires is part of RPM, the RedHat Package Manager. find-requires