From 5b15d9622bf0995a33805e92102c80aae600dea2 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Thu, 14 Jul 2005 13:04:47 +0000 Subject: [PATCH] 2002-01-24 Havoc Pennington Author: hp Date: 2002-01-24 23:10:02 GMT 2002-01-24 Havoc Pennington * 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 --- ChangeLog | 8 ++++++++ autogen.sh | 20 +++++++++++++++----- pkg.c | 39 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 515f698..bcc44e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-01-24 Havoc Pennington + + * 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 + 2001-10-28 Havoc Pennington * pkg.c: track position of package in the path search order, diff --git a/autogen.sh b/autogen.sh index 5e1d22f..3bf4085 100755 --- a/autogen.sh +++ b/autogen.sh @@ -21,7 +21,15 @@ DIE=0 DIE=1 } -(automake --version) < /dev/null > /dev/null 2>&1 || { +AUTOMAKE=automake-1.4 +ACLOCAL=aclocal-1.4 + +($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { + AUTOMAKE=automake + ACLOCAL=aclocal +} + +($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { echo echo "You must have automake installed to compile $PROJECT." echo "Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.2d.tar.gz" @@ -51,20 +59,22 @@ perl -p -i.bak -e "s/[a-zA-Z0-9]+_DATA/noinst_DATA/g" `find glib-1.2.8 -name Mak perl -p -i.bak -e "s/info_TEXINFOS/noinst_TEXINFOS/g" `find glib-1.2.8 -name Makefile.am` perl -p -i.bak -e "s/man_MANS/noinst_MANS/g" `find glib-1.2.8 -name Makefile.am` -(cd glib-1.2.8 && automake) +(cd glib-1.2.8 && $AUTOMAKE) if test -z "$*"; then echo "I am going to run ./configure with no arguments - if you wish " echo "to pass any to it, please specify them on the $0 command line." fi -echo aclocal $ACLOCAL_FLAGS -aclocal $ACLOCAL_FLAGS +libtoolize --copy --force + +echo $ACLOCAL $ACLOCAL_FLAGS +$ACLOCAL $ACLOCAL_FLAGS # optionally feature autoheader (autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader -automake -a $am_opt +$AUTOMAKE -a $am_opt autoconf cd $ORIGDIR 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* @@ -1196,6 +1212,14 @@ comparison_to_str (ComparisonType comparison) return "???"; } +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) { @@ -1203,14 +1227,23 @@ packages_foreach (gpointer key, gpointer value, gpointer data) 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)); } -- 2.39.5