mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-05-05 16:58:06 +02:00
Handle pcfiledir variable like normal variable
Rather than responding to the pcfiledir variable specially, store it in the hash table with all the other package specific variables. This does result in pcfiledir showing up in the --print-variables output.
This commit is contained in:
parent
30437b47c8
commit
9294307b21
3 changed files with 10 additions and 10 deletions
|
|
@ -12,13 +12,14 @@ RESULT=1.0.0
|
|||
run_test --modversion simple
|
||||
|
||||
# --print-variables, make sure having no variables doesn't crash
|
||||
RESULT=""
|
||||
RESULT="pcfiledir"
|
||||
run_test --print-variables no-variables
|
||||
|
||||
RESULT="exec_prefix
|
||||
prefix
|
||||
libdir
|
||||
includedir"
|
||||
includedir
|
||||
pcfiledir"
|
||||
run_test --print-variables simple
|
||||
|
||||
# --print-provides
|
||||
|
|
|
|||
11
parse.c
11
parse.c
|
|
@ -990,9 +990,6 @@ parse_line (Package *pkg, const char *untrimmed, const char *path,
|
|||
++p;
|
||||
while (*p && isspace ((guchar)*p))
|
||||
++p;
|
||||
|
||||
if (pkg->vars == NULL)
|
||||
pkg->vars = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
if (define_prefix && strcmp (tag, prefix_variable) == 0)
|
||||
{
|
||||
|
|
@ -1114,7 +1111,13 @@ parse_package_file (const char *path, gboolean ignore_requires,
|
|||
debug_spew ("No pcfiledir determined for package\n");
|
||||
pkg->pcfiledir = g_strdup ("???????");
|
||||
}
|
||||
|
||||
|
||||
if (pkg->vars == NULL)
|
||||
pkg->vars = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
/* Variable storing directory of pc file */
|
||||
g_hash_table_insert (pkg->vars, "pcfiledir", pkg->pcfiledir);
|
||||
|
||||
str = g_string_new ("");
|
||||
|
||||
while (read_one_line (f, str))
|
||||
|
|
|
|||
4
pkg.c
4
pkg.c
|
|
@ -1028,10 +1028,6 @@ package_get_var (Package *pkg,
|
|||
if (varval == NULL && pkg->vars)
|
||||
varval = g_strdup (g_hash_table_lookup (pkg->vars, var));
|
||||
|
||||
/* Magic "pcfiledir" variable */
|
||||
if (varval == NULL && pkg->pcfiledir && strcmp (var, "pcfiledir") == 0)
|
||||
varval = g_strdup (pkg->pcfiledir);
|
||||
|
||||
return varval;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue