configurable PATH for install %pre/%post et al scriptlets.

use only %_install_langs, not LINGUAS/LANG when deciding to install.

CVS patchset: 3514
CVS date: 2000/01/11 15:22:35
This commit is contained in:
jbj 2000-01-11 15:22:35 +00:00
parent 8685f7a0de
commit 9f35fb4373
4 changed files with 73 additions and 10 deletions

View File

@ -38,6 +38,8 @@
- add several BuildRoot FTW policies. - add several BuildRoot FTW policies.
- add manpage for gendiff (pbrown@redhat.com). - add manpage for gendiff (pbrown@redhat.com).
- updated sv.po (goeran@uddeborg.pp.se) (#8349). - updated sv.po (goeran@uddeborg.pp.se) (#8349).
- configurable PATH for install %pre/%post et al scriptlets.
- use only %_install_langs, not LINGUAS/LANG when deciding to install.
3.0.2 -> 3.0.3 3.0.2 -> 3.0.3
- add --eval to find result of macro expansion. - add --eval to find result of macro expansion.

View File

@ -1091,9 +1091,11 @@ static void skipFiles(TFI_t * fi, int noDocs)
if (s) { if (s) {
languages = (const char **) splitString(s, strlen(s), ':'); languages = (const char **) splitString(s, strlen(s), ':');
xfree(s); xfree(s);
#ifdef DYING
/* XXX LINGUAS/LANG is used by the installer so leave alone for now */ /* XXX LINGUAS/LANG is used by the installer so leave alone for now */
} else if ((s = getenv("LINGUAS")) || (s = getenv("LANG")) || (s = "en")) { } else if ((s = getenv("LINGUAS")) || (s = getenv("LANG")) || (s = "en")) {
languages = (const char **) splitString(s, strlen(s), ':'); languages = (const char **) splitString(s, strlen(s), ':');
#endif
} else } else
languages = NULL; languages = NULL;

View File

@ -353,7 +353,14 @@ static int runScript(Header h, const char * root, int progArgc, const char ** pr
} }
} }
doputenv(SCRIPT_PATH); { const char *ipath = rpmExpand("PATH=%{_install_script_path}", NULL);
const char *path = SCRIPT_PATH;
if (ipath && ipath[5] != '%')
path = ipath;
doputenv(path);
if (ipath) xfree(ipath);
}
for (i = 0; i < numPrefixes; i++) { for (i = 0; i < numPrefixes; i++) {
sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]); sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]);

View File

@ -1,4 +1,4 @@
# $Id: macros.in,v 1.40 2000/01/07 17:32:28 jbj Exp $ # $Id: macros.in,v 1.41 2000/01/11 15:22:35 jbj Exp $
#============================================================================== #==============================================================================
# Macro naming conventions (preliminary): # Macro naming conventions (preliminary):
# #
@ -72,7 +72,7 @@
# ---- Required rpmrc macros. # ---- Required rpmrc macros.
# Macros that used to be initialized as a side effect of rpmrc parsing. # Macros that used to be initialized as a side effect of rpmrc parsing.
# These are the default values that can be overridden by other # These are the default values that can be overridden by other
# (e.g. per-platform, per-system, per-packager) macro files. # (e.g. per-platform, per-system, per-packager, per-package) macros.
# #
%_builddir %{_topdir}/BUILD %_builddir %{_topdir}/BUILD
%_buildshell /bin/sh %_buildshell /bin/sh
@ -104,30 +104,85 @@
%_srcrpmdir %{_topdir}/SRPMS %_srcrpmdir %{_topdir}/SRPMS
%_tmppath %{_var}/tmp %_tmppath %{_var}/tmp
%_topdir %{_usrsrc}/redhat %_topdir %{_usrsrc}/redhat
#
#============================================================================== #==============================================================================
# ---- Optional rpmrc macros. # ---- Optional rpmrc macros.
# Macros that are initialized as a side effect of rpmrc and/or spec # Macros that are initialized as a side effect of rpmrc and/or spec
# file parsing. # file parsing.
# #
# Configurable build root path, same as BuildRoot: in a specfile.
# (Note: the configured macro value will override the spec file value).
#
#%buildroot #%buildroot
# The sub-directory (relative to %{_builddir}) where sources are compiled.
#
#%buildsubdir #%buildsubdir
# Configurable distribution information, same as Distribution: in a
# specfile.
#
#%distribution #%distribution
# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files
# marked as %doc should be installed.
#%_excludedocs #%_excludedocs
# The port and machine name of a FTP proxy host running TIS firewall.
#
#%_ftpport #%_ftpport
#%_ftpproxy #%_ftpproxy
# The signature to use and the location of configuration files for
# signing packages with GNU gpg.
#
#%_gpg_name #%_gpg_name
#%_gpg_path #%_gpg_path
# The port and machine name of an HTTP proxy host.
#
#%_httpport #%_httpport
#%_httpproxy #%_httpproxy
# The PATH put into the environment before running %pre/%post et al.
#
%_install_script_path /sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin
# A colon separated list of desired locales to be installed;
# "all" means install all locale specific files.
#
#%_install_langs #%_install_langs
#
# Deprecated.
#%_langpatt #%_langpatt
# A colon separated list of paths where files should *not* be installed.
# Usually, these are network file system mount points.
#
#%_netsharedpath #%_netsharedpath
# Configurable packager information, same as Packager: in a specfile.
#
#%packager #%packager
# The signature to use and the location of configuration files for
# signing packages with PGP.
#
#%_pgp_name #%_pgp_name
#%_pgp_path #%_pgp_path
# Configurable virtual provides (unimplemented, use Provides: ...
# in an rpmrc file).
#
#%_provides #%_provides
# Deprecated.
#
#%_timecheck #%_timecheck
# Configurable vendor information, same as Vendor: in a specfile.
#
#%vendor #%vendor
#============================================================================== #==============================================================================
@ -145,9 +200,9 @@
#============================================================================== #==============================================================================
# ---- Scriptlet template templates. # ---- Scriptlet template templates.
# Global defaults for building scriptlet templates. # Global defaults used for building scriptlet templates.
# #
# XXX legacy configuration. # XXX legacy configuration, this will be eliminated after rpm-3.0.4.
%_preScriptEnvironment \ %_preScriptEnvironment \
RPM_SOURCE_DIR=\"%{_sourcedir}\"\ RPM_SOURCE_DIR=\"%{_sourcedir}\"\
RPM_BUILD_DIR=\"%{_builddir}\"\ RPM_BUILD_DIR=\"%{_builddir}\"\
@ -306,10 +361,7 @@ cd %{u2p:%{_builddir}}\
#============================================================================== #==============================================================================
# ---- configure macros. # ---- configure macros.
# Macro(s) slavishly copied from config.status. # Macro(s) slavishly copied from autoconf's config.status.
# CAVEAT: Only _prefix is currently used (read: supported). Please
# don't expect or rely on these macros keeping their current values
# (or even being defined) in future versions of rpm.
# #
%_prefix @prefix@ %_prefix @prefix@
%_exec_prefix %{_prefix} %_exec_prefix %{_prefix}