convert per-system configuration in /etc/rpmrc to macros.

CVS patchset: 3012
CVS date: 1999/04/18 19:01:46
This commit is contained in:
jbj 1999-04-18 19:01:46 +00:00
parent 3b9ca6b62e
commit c67e60d5e7
3 changed files with 18 additions and 6 deletions

View File

@ -6,6 +6,7 @@
- CPIOERR_CHECK_ERRNO masking caused AIX cc warnings.
- solaris 2.6+ needs statvfs.
- check build prerequisites before building from specfile.
- convert per-system configuration in /etc/rpmrc to macros.
2.93 -> 2.94
- fix: segfault while parsing target string.

View File

@ -2,12 +2,15 @@ Summary: The Red Hat package management system.
Name: rpm
%define version 2.95
Version: %{version}
Release: 8
Release: 9
Group: System Environment/Base
Source: ftp://ftp.rpm.org/pub/rpm/dist/rpm-2.5.x/rpm-%{version}.tar.gz
Copyright: GPL
BuildRoot: /var/tmp/rpm-%{version}-root
Conflicts: patch < 2.5
%ifos linux
Prereq: awk fileutils textutils sh-utils mktemp
%endif
BuildRoot: /var/tmp/rpm-%{version}-root
%description
The Red Hat Package Manager (RPM) is a powerful command line driven
@ -60,6 +63,12 @@ rm -rf $RPM_BUILD_ROOT
%post
/bin/rpm --initdb
%ifos linux
if [ ! -e /etc/rpm/macros -a -e /etc/rpmrc -a -f /usr/lib/rpm/convertrpmrc.sh ]
then
sh /usr/lib/rpm/convertrpmrc.sh 2>&1 > /dev/null
fi
%endif
%files
%defattr(-,root,root)

View File

@ -1,6 +1,9 @@
#!/bin/sh
#
# Convert per-system configuration in /etc/rpmrc to macros in /etc/rpm/macros.
#
# prereq: awk fileutils textutils sh-utils mktemp
#
RPMRC=/etc/rpmrc
MACROS=/etc/rpm/macros
@ -11,14 +14,14 @@ MACROS=/etc/rpm/macros
[ -f $RPMRC ] || exit 0
[ -f $MACROS ] && {
echo "$MACROS already exists 1>&2
echo "$MACROS already exists" 1>&2
exit 1
}
DIRN="`dirname $MACROS`"
[ -d "$DIRN" ] || mkdir -p "$DIRN"
[ -d "$DIRN" ] || {
echo "$DIRN doesn't exist"
echo "could not create directory $DIRN" 1>&2
exit 1
}
@ -70,7 +73,6 @@ awk 'BEGIN {
{
for (str in xlate) {
ms = "^" str ":"
print str >> "blah"
if (match($1, ms)) {
if (xlate[str]) {
sub(ms, "%" xlate[str] " ")