From: marc Date: Sun, 25 Jan 1998 17:03:30 +0000 (+0000) Subject: New rpmrc entry BuildShell can used to set the shell used for build scripts. X-Git-Tag: rpm-4.4-release~3781 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2ae55b71cba7599bf5441e3f97874e76f26c3ba7;p=platform%2Fupstream%2Frpm.git New rpmrc entry BuildShell can used to set the shell used for build scripts. Default is /bin/sh. CVS patchset: 1977 CVS date: 1998/01/25 17:03:30 --- diff --git a/CHANGES b/CHANGES index 0904cb6..1f29b3e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ 2.4.100 -> 2.5 - handle files with spaces (put double quotes around them) + - new rpmrc setting, buildshell, can be used to set shell + used for build scripts (default is /bin/sh) 2.4.99 -> 2.4.100: - fixed handling of --rebuild and --recompile diff --git a/build/build.c b/build/build.c index c7c2339..1ba91b7 100644 --- a/build/build.c +++ b/build/build.c @@ -99,6 +99,7 @@ int doScript(Spec spec, int what, char *name, StringBuf sb, int test) char *scriptName; int pid; int status; + char *buildShell; switch (what) { case RPMBUILD_PREP: @@ -164,7 +165,8 @@ int doScript(Spec spec, int what, char *name, StringBuf sb, int test) rpmMessage(RPMMESS_NORMAL, "Executing: %s\n", name); if (!(pid = fork())) { - execl("/bin/sh", "/bin/sh", "-e", scriptName, scriptName, NULL); + buildShell = rpmGetVar(RPMVAR_BUILDSHELL); + execl(buildShell, buildShell, "-e", scriptName, scriptName, NULL); rpmError(RPMERR_SCRIPT, "Exec of %s failed (%s)", scriptName, name); FREE(scriptName); diff --git a/lib/rpmlib.h b/lib/rpmlib.h index 3d6712b..0437bec 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -215,8 +215,9 @@ extern const struct headerSprintfExtension rpmHeaderFormats[]; #define RPMVAR_GZIPBIN 36 #define RPMVAR_RPMFILENAME 37 #define RPMVAR_PROVIDES 38 +#define RPMVAR_BUILDSHELL 39 -#define RPMVAR_NUM 39 /* number of RPMVAR entries */ +#define RPMVAR_NUM 40 /* number of RPMVAR entries */ char * rpmGetVar(int var); int rpmGetBooleanVar(int var); diff --git a/lib/rpmrc.c b/lib/rpmrc.c index a361ce7..883847a 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -101,6 +101,7 @@ static struct tableType tables[RPM_MACHTABLE_COUNT] = { static struct rpmOption optionTable[] = { { "builddir", RPMVAR_BUILDDIR, 0, 0 }, { "buildroot", RPMVAR_BUILDROOT, 0, 0 }, + { "buildshell", RPMVAR_BUILDSHELL, 0, 0 }, { "dbpath", RPMVAR_DBPATH, 0, 1 }, { "defaultdocdir", RPMVAR_DEFAULTDOCDIR, 0, 0 }, { "distribution", RPMVAR_DISTRIBUTION, 0, 0 }, @@ -465,6 +466,7 @@ static void setDefaults(void) { rpmSetVar(RPMVAR_SIGTYPE, "none"); rpmSetVar(RPMVAR_DEFAULTDOCDIR, "/usr/doc"); rpmSetVar(RPMVAR_TOPDIR, "/usr/src/redhat"); + rpmSetVar(RPMVAR_BUILDSHELL, "/bin/sh"); } int rpmReadRC(char * file) {