summaryrefslogtreecommitdiff
path: root/pkg.c
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2005-07-14 13:04:47 +0000
committerArch Librarian <arch@canonical.com>2005-07-14 13:04:47 +0000
commit5b15d9622bf0995a33805e92102c80aae600dea2 (patch)
tree9fd66fb5a987fd00d93a5c33a345acd7dc939496 /pkg.c
parent4722cb5782c1bae583e61b1876d1e58e5c720b88 (diff)
downloadpkg-config-5b15d9622bf0995a33805e92102c80aae600dea2.tar.gz
2002-01-24 Havoc Pennington <hp@redhat.com>
Author: hp Date: 2002-01-24 23:10:02 GMT 2002-01-24 Havoc Pennington <hp@redhat.com> * pkg.c (print_package_list): make the output halfway attractive * autogen.sh: use automake-1.4 aclocal-1.4 if found * pkg.c (verify_package): add a warning about -I/usr/include in cflags
Diffstat (limited to 'pkg.c')
-rw-r--r--pkg.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/pkg.c b/pkg.c
index d09de8f..bf5b334 100644
--- a/pkg.c
+++ b/pkg.c
@@ -661,6 +661,22 @@ verify_package (Package *pkg)
g_slist_free (requires);
g_slist_free (conflicts);
+
+ iter = pkg->I_cflags;
+ while (iter != NULL)
+ {
+ /* we put things in canonical -I/usr/include (vs. -I /usr/include) format,
+ * but if someone changes it later we may as well be robust
+ */
+ if (strcmp (iter->data, "-I/usr/include") == 0 ||
+ strcmp (iter->data, "-I /usr/include") == 0)
+ {
+ verbose_error ("Package %s has -I/usr/include in Cflags; this may cause problems and is not recommended\n",
+ pkg->name);
+ }
+
+ iter = iter->next;
+ }
}
static char*
@@ -1197,20 +1213,37 @@ comparison_to_str (ComparisonType comparison)
}
static void
+max_len_foreach (gpointer key, gpointer value, gpointer data)
+{
+ int *mlen = data;
+
+ *mlen = MAX (*mlen, strlen (key));
+}
+
+static void
packages_foreach (gpointer key, gpointer value, gpointer data)
{
Package *pkg = get_package (key);
if (pkg != NULL)
{
- printf ("%s \t\t%s - %s\n",
- pkg->key, pkg->name, pkg->description);
+ char *pad;
+
+ pad = g_strnfill (GPOINTER_TO_INT (data) - strlen (pkg->key), ' ');
+
+ printf ("%s%s%s - %s\n",
+ pkg->key, pad, pkg->name, pkg->description);
+
+ g_free (pad);
}
}
void
print_package_list (void)
{
- g_hash_table_foreach (locations, packages_foreach, NULL);
+ int mlen = 0;
+
+ g_hash_table_foreach (locations, max_len_foreach, &mlen);
+ g_hash_table_foreach (locations, packages_foreach, GINT_TO_POINTER (mlen + 1));
}