Finer control for %_deps_optimization (ALT#30476)

0: disabled
1: old behaviour with %_deps_optimization=0
2: old behaviour with %_deps_optimization=1
3: old behaviour with %_deps_optimization=2
This commit is contained in:
Igor Vlasenko 2014-11-19 08:31:11 +02:00 committed by Dmitry V. Levin
parent decd789cf4
commit 83f32e64e2
2 changed files with 16 additions and 10 deletions

View File

@ -773,18 +773,20 @@ void pruneExtraRDeps(struct Req *r, Spec spec)
int processInterdep(Spec spec)
{
struct Req *r = makeRequires(spec, 1);
pruneDebuginfoSrc(r, spec);
liftDebuginfoDeps(r, spec);
r = freeRequires(r);
r = makeRequires(spec, 2);
int optlevel = rpmExpandNumeric("%{?_deps_optimization}%{?!_deps_optimization:2}");
if (optlevel >= 2) {
struct Req *r;
int optlevel = rpmExpandNumeric("%{?_deps_optimization}%{?!_deps_optimization:3}");
if (optlevel >= 1) {
r = makeRequires(spec, 1);
pruneDebuginfoSrc(r, spec);
liftDebuginfoDeps(r, spec);
r = freeRequires(r);
}
if (optlevel >= 3) {
r = makeRequires(spec, 2);
pruneExtraDeps(r, spec);
pruneExtraRDeps(r, spec);
r = freeRequires(r);
}
r = freeRequires(r);
return 0;
}

View File

@ -15,8 +15,12 @@ deps_opt_enabled (void)
if (!initialized)
{
int optlevel = rpmExpandNumeric("%{?_deps_optimization}%{?!_deps_optimization:2}");
initialized = 1;
enabled = rpmExpandNumeric ("%{?_deps_optimization}%{?!_deps_optimization:1}");
if (optlevel >= 2)
{
enabled = 1;
}
}
return enabled;