From 9f35fb43733452c2e979dec182347e0b250567ea Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 11 Jan 2000 15:22:35 +0000 Subject: [PATCH] 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 --- CHANGES | 2 ++ lib/transaction.c | 2 ++ lib/uninstall.c | 9 +++++- macros.in | 70 +++++++++++++++++++++++++++++++++++++++++------ 4 files changed, 73 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index da539dda1..44e5c4523 100644 --- a/CHANGES +++ b/CHANGES @@ -38,6 +38,8 @@ - add several BuildRoot FTW policies. - add manpage for gendiff (pbrown@redhat.com). - 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 - add --eval to find result of macro expansion. diff --git a/lib/transaction.c b/lib/transaction.c index ace8f98a0..860473da7 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1091,9 +1091,11 @@ static void skipFiles(TFI_t * fi, int noDocs) if (s) { languages = (const char **) splitString(s, strlen(s), ':'); xfree(s); +#ifdef DYING /* XXX LINGUAS/LANG is used by the installer so leave alone for now */ } else if ((s = getenv("LINGUAS")) || (s = getenv("LANG")) || (s = "en")) { languages = (const char **) splitString(s, strlen(s), ':'); +#endif } else languages = NULL; diff --git a/lib/uninstall.c b/lib/uninstall.c index 87c8230d5..874f1279f 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -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++) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]); diff --git a/macros.in b/macros.in index af441e603..d66e67e04 100644 --- a/macros.in +++ b/macros.in @@ -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): # @@ -72,7 +72,7 @@ # ---- Required rpmrc macros. # Macros that used to be initialized as a side effect of rpmrc parsing. # 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 %_buildshell /bin/sh @@ -104,30 +104,85 @@ %_srcrpmdir %{_topdir}/SRPMS %_tmppath %{_var}/tmp %_topdir %{_usrsrc}/redhat -# + #============================================================================== # ---- Optional rpmrc macros. # Macros that are initialized as a side effect of rpmrc and/or spec # file parsing. # +# Configurable build root path, same as BuildRoot: in a specfile. +# (Note: the configured macro value will override the spec file value). +# #%buildroot + +# The sub-directory (relative to %{_builddir}) where sources are compiled. +# #%buildsubdir + +# Configurable distribution information, same as Distribution: in a +# specfile. +# #%distribution + +# Boolean (i.e. 1 == "yes", 0 == "no") that controls whether files +# marked as %doc should be installed. #%_excludedocs + +# The port and machine name of a FTP proxy host running TIS firewall. +# #%_ftpport #%_ftpproxy + +# The signature to use and the location of configuration files for +# signing packages with GNU gpg. +# #%_gpg_name #%_gpg_path + +# The port and machine name of an HTTP proxy host. +# #%_httpport #%_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 + +# +# Deprecated. #%_langpatt + +# A colon separated list of paths where files should *not* be installed. +# Usually, these are network file system mount points. +# #%_netsharedpath + +# Configurable packager information, same as Packager: in a specfile. +# #%packager + +# The signature to use and the location of configuration files for +# signing packages with PGP. +# #%_pgp_name #%_pgp_path + +# Configurable virtual provides (unimplemented, use Provides: ... +# in an rpmrc file). +# #%_provides + +# Deprecated. +# #%_timecheck + +# Configurable vendor information, same as Vendor: in a specfile. +# #%vendor #============================================================================== @@ -145,9 +200,9 @@ #============================================================================== # ---- 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 \ RPM_SOURCE_DIR=\"%{_sourcedir}\"\ RPM_BUILD_DIR=\"%{_builddir}\"\ @@ -306,10 +361,7 @@ cd %{u2p:%{_builddir}}\ #============================================================================== # ---- configure macros. -# Macro(s) slavishly copied from 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. +# Macro(s) slavishly copied from autoconf's config.status. # %_prefix @prefix@ %_exec_prefix %{_prefix}