diff --git a/ChangeLog b/ChangeLog index 937e4337..e7858713 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ * Applied patch from zimba-tm, closes patch 1260225 * Fixed ugly gradient bug. closes bug 1255608 * Added $voffset + * Removed metar code. It sucked. 2005-08-12 * Multiple unit additions and modifications diff --git a/Makefile.am b/Makefile.am index 7dfcc3a5..335695e7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -28,11 +28,6 @@ if BUILD_CAIRO cairo = cairo.c endif -if BUILD_METAR -metar = ftp.c metarinfo.c -METAR_LIBS = -lmetar -endif - if BUILD_MLDONKEY mldonkey = mldonkey.c endif @@ -42,7 +37,7 @@ x11 = x11.c endif conky_SOURCES = common.c fs.c top.c $(linux) mail.c mixer.c $(seti) $(mpd) \ - $(solaris) $(freebsd) $(netbsd) $(cairo) conky.c conky.h $(x11) $(metar) \ + $(solaris) $(freebsd) $(netbsd) $(cairo) conky.c conky.h $(x11) \ $(mldonkey) remoted.c remoted.h remotec.c remotec.h conky_LDFLAGS = $(X11_LIBS) $(XFT_LIBS) $(CAIRO_LIBS) @@ -55,7 +50,7 @@ LIBS = -lm -lpthread # conky.1 is in EXTRA_DIST in case that someone doesn't have help2man EXTRA_DIST = conkyrc.sample conky.1 conky.x \ - app-admin/conky/conky-1.2.ebuild + app-admin/conky/conky-1.2.ebuild app-admin/conky/conky-1.9999.ebuild EXTRA_conky_SOURCES = seti.c linux.c solaris.c freebsd.c netbsd.c mpd.c libmpdclient.c \ -cairo.c libmpdclient.h top.h mldonkey.c ftp.c metarinfo.c ftp.h metarinfo.h x11.c \ No newline at end of file +cairo.c libmpdclient.h top.h mldonkey.c ftp.c ftp.h x11.c \ No newline at end of file diff --git a/Makefile.in b/Makefile.in index 06abcc32..70d1a980 100644 --- a/Makefile.in +++ b/Makefile.in @@ -56,8 +56,8 @@ binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am__conky_SOURCES_DIST = common.c fs.c top.c linux.c mail.c mixer.c \ seti.c mpd.c libmpdclient.c solaris.c freebsd.c netbsd.c \ - cairo.c conky.c conky.h x11.c ftp.c metarinfo.c mldonkey.c \ - remoted.c remoted.h remotec.c remotec.h + cairo.c conky.c conky.h x11.c mldonkey.c remoted.c remoted.h \ + remotec.c remotec.h @BUILD_LINUX_TRUE@am__objects_1 = linux.$(OBJEXT) @BUILD_SETI_TRUE@am__objects_2 = seti.$(OBJEXT) @BUILD_MPD_TRUE@am__objects_3 = mpd.$(OBJEXT) libmpdclient.$(OBJEXT) @@ -66,17 +66,15 @@ am__conky_SOURCES_DIST = common.c fs.c top.c linux.c mail.c mixer.c \ @BUILD_NETBSD_TRUE@am__objects_6 = netbsd.$(OBJEXT) @BUILD_CAIRO_TRUE@am__objects_7 = cairo.$(OBJEXT) @BUILD_X11_TRUE@am__objects_8 = x11.$(OBJEXT) -@BUILD_METAR_TRUE@am__objects_9 = ftp.$(OBJEXT) metarinfo.$(OBJEXT) -@BUILD_MLDONKEY_TRUE@am__objects_10 = mldonkey.$(OBJEXT) +@BUILD_MLDONKEY_TRUE@am__objects_9 = mldonkey.$(OBJEXT) am_conky_OBJECTS = common.$(OBJEXT) fs.$(OBJEXT) top.$(OBJEXT) \ $(am__objects_1) mail.$(OBJEXT) mixer.$(OBJEXT) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ conky.$(OBJEXT) $(am__objects_8) $(am__objects_9) \ - $(am__objects_10) remoted.$(OBJEXT) remotec.$(OBJEXT) + remoted.$(OBJEXT) remotec.$(OBJEXT) conky_OBJECTS = $(am_conky_OBJECTS) -am__DEPENDENCIES_1 = -conky_DEPENDENCIES = $(am__DEPENDENCIES_1) +conky_DEPENDENCIES = DEFAULT_INCLUDES = -I. -I$(srcdir) -I. depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -116,8 +114,6 @@ BUILD_FREEBSD_FALSE = @BUILD_FREEBSD_FALSE@ BUILD_FREEBSD_TRUE = @BUILD_FREEBSD_TRUE@ BUILD_LINUX_FALSE = @BUILD_LINUX_FALSE@ BUILD_LINUX_TRUE = @BUILD_LINUX_TRUE@ -BUILD_METAR_FALSE = @BUILD_METAR_FALSE@ -BUILD_METAR_TRUE = @BUILD_METAR_TRUE@ BUILD_MLDONKEY_FALSE = @BUILD_MLDONKEY_FALSE@ BUILD_MLDONKEY_TRUE = @BUILD_MLDONKEY_TRUE@ BUILD_MPD_FALSE = @BUILD_MPD_FALSE@ @@ -204,12 +200,10 @@ target_alias = @target_alias@ @BUILD_FREEBSD_TRUE@freebsd = freebsd.c @BUILD_NETBSD_TRUE@netbsd = netbsd.c @BUILD_CAIRO_TRUE@cairo = cairo.c -@BUILD_METAR_TRUE@metar = ftp.c metarinfo.c -@BUILD_METAR_TRUE@METAR_LIBS = -lmetar @BUILD_MLDONKEY_TRUE@mldonkey = mldonkey.c @BUILD_X11_TRUE@x11 = x11.c conky_SOURCES = common.c fs.c top.c $(linux) mail.c mixer.c $(seti) $(mpd) \ - $(solaris) $(freebsd) $(netbsd) $(cairo) conky.c conky.h $(x11) $(metar) \ + $(solaris) $(freebsd) $(netbsd) $(cairo) conky.c conky.h $(x11) \ $(mldonkey) remoted.c remoted.h remotec.c remotec.h conky_LDFLAGS = $(X11_LIBS) $(XFT_LIBS) $(CAIRO_LIBS) @@ -218,10 +212,10 @@ man_MANS = conky.1 # conky.1 is in EXTRA_DIST in case that someone doesn't have help2man EXTRA_DIST = conkyrc.sample conky.1 conky.x \ - app-admin/conky/conky-1.2.ebuild + app-admin/conky/conky-1.2.ebuild app-admin/conky/conky-1.9999.ebuild EXTRA_conky_SOURCES = seti.c linux.c solaris.c freebsd.c netbsd.c mpd.c libmpdclient.c \ -cairo.c libmpdclient.h top.h mldonkey.c ftp.c metarinfo.c ftp.h metarinfo.h x11.c +cairo.c libmpdclient.h top.h mldonkey.c ftp.c ftp.h x11.c all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -320,7 +314,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpdclient.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mail.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/metarinfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mixer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mldonkey.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mpd.Po@am__quote@ diff --git a/app-admin/conky/conky-1.9999.ebuild b/app-admin/conky/conky-1.9999.ebuild index a39fab27..8398de05 100644 --- a/app-admin/conky/conky-1.9999.ebuild +++ b/app-admin/conky/conky-1.9999.ebuild @@ -11,17 +11,15 @@ HOMEPAGE="http://conky.sf.net" LICENSE="BSD" SLOT="0" KEYWORDS="~amd64 ~ppc ~sparc ~x86" -IUSE="truetype seti metar X" +IUSE="truetype seti X" RDEPEND="virtual/libc X? ( virtual/x11 ) truetype? ( >=media-libs/freetype-2 ) seti? ( sci-astronomy/setiathome ) - metar? ( dev-libs/mdsplib ) " DEPEND="truetype? ( >=media-libs/freetype-2 ) - metar? ( dev-libs/mdsplib ) X? ( virtual/x11 ) >=sys-devel/automake-1.4 sys-devel/autoconf @@ -41,7 +39,6 @@ src_unpack() { src_compile() { econf \ $(use_enable truetype xft) \ - $(use_enable metar) \ $(use_enable seti) \ $(use_enable x x11) \ --enable-double-buffer \ diff --git a/common.c b/common.c index 4a1986bd..f61d6b85 100644 --- a/common.c +++ b/common.c @@ -223,14 +223,6 @@ void update_stuff() if (NEED(INFO_LOADAVG)) update_load_average(); -#ifdef METAR - if (NEED(INFO_METAR) - && current_update_time - last_metar_update > 1200.9 - && info.looped) { - update_metar(); - last_metar_update = current_update_time; - } -#endif if ((NEED(INFO_MEM) || NEED(INFO_BUFFERS)) && current_update_time - last_meminfo_update > 6.9) { update_meminfo(); diff --git a/config.h.in b/config.h.in index ef702cb4..14cca633 100644 --- a/config.h.in +++ b/config.h.in @@ -33,9 +33,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the header file. */ -#undef HAVE_METAR_H - /* Define to 1 if you have the `popen' function. */ #undef HAVE_POPEN @@ -90,9 +87,6 @@ /* Xdbe */ #undef HAVE_XDBE -/* Define if you want metar stats (weather information) */ -#undef METAR - /* Define if you want MLDonkey support */ #undef MLDONKEY diff --git a/configure b/configure index 615ade54..99280a65 100755 --- a/configure +++ b/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar BUILD_LINUX_TRUE BUILD_LINUX_FALSE BUILD_SOLARIS_TRUE BUILD_SOLARIS_FALSE BUILD_FREEBSD_TRUE BUILD_FREEBSD_FALSE BUILD_NETBSD_TRUE BUILD_NETBSD_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP BUILD_SETI_TRUE BUILD_SETI_FALSE BUILD_MPD_TRUE BUILD_MPD_FALSE BUILD_CAIRO_TRUE BUILD_CAIRO_FALSE CAIROCONFIG BUILD_METAR_TRUE BUILD_METAR_FALSE BUILD_MLDONKEY_TRUE BUILD_MLDONKEY_FALSE BUILD_X11_TRUE BUILD_X11_FALSE XFTCONFIG X11_LIBS XFT_LIBS LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar BUILD_LINUX_TRUE BUILD_LINUX_FALSE BUILD_SOLARIS_TRUE BUILD_SOLARIS_FALSE BUILD_FREEBSD_TRUE BUILD_FREEBSD_FALSE BUILD_NETBSD_TRUE BUILD_NETBSD_FALSE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP BUILD_SETI_TRUE BUILD_SETI_FALSE BUILD_MPD_TRUE BUILD_MPD_FALSE BUILD_CAIRO_TRUE BUILD_CAIRO_FALSE CAIROCONFIG BUILD_MLDONKEY_TRUE BUILD_MLDONKEY_FALSE BUILD_X11_TRUE BUILD_X11_FALSE XFTCONFIG X11_LIBS XFT_LIBS LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -858,7 +858,6 @@ Optional Features: --enable-seti enable if you want SETI at Home stats default=no --enable-mpd enable if you want MPD support default=no --enable-cairo enable if you want Cairo support default=no - --enable-metar enable if you want metar stats (weather information) default=no --enable-mldonkey enable if you want MLDonkey support default=no --enable-x11 enable if you want X11 support default=yes @@ -3917,190 +3916,6 @@ _ACEOF fi -want_metar=no -# Check whether --enable-metar or --disable-metar was given. -if test "${enable_metar+set}" = set; then - enableval="$enable_metar" - want_metar="$enableval" -fi; - - - -if test x$want_metar == xyes; then - BUILD_METAR_TRUE= - BUILD_METAR_FALSE='#' -else - BUILD_METAR_TRUE='#' - BUILD_METAR_FALSE= -fi - -if test x$want_metar == xyes; then - -for ac_header in metar.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - METAR_MISSING=yes -fi - -done - - if test "x$METAR_MISSING" = xyes; then - { { echo "$as_me:$LINENO: error: something went wrong when checking for mdsplib, you're probably missing headers or it's not installed" >&5 -echo "$as_me: error: something went wrong when checking for mdsplib, you're probably missing headers or it's not installed" >&2;} - { (exit 1); exit 1; }; } - fi - -cat >>confdefs.h <<\_ACEOF -#define METAR 1 -_ACEOF - -fi - - - want_mldonkey=no # Check whether --enable-mldonkey or --disable-mldonkey was given. @@ -6681,13 +6496,6 @@ echo "$as_me: error: conditional \"BUILD_CAIRO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi -if test -z "${BUILD_METAR_TRUE}" && test -z "${BUILD_METAR_FALSE}"; then - { { echo "$as_me:$LINENO: error: conditional \"BUILD_METAR\" was never defined. -Usually this means the macro was only invoked conditionally." >&5 -echo "$as_me: error: conditional \"BUILD_METAR\" was never defined. -Usually this means the macro was only invoked conditionally." >&2;} - { (exit 1); exit 1; }; } -fi if test -z "${BUILD_MLDONKEY_TRUE}" && test -z "${BUILD_MLDONKEY_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"BUILD_MLDONKEY\" was never defined. Usually this means the macro was only invoked conditionally." >&5 @@ -7296,8 +7104,6 @@ s,@BUILD_MPD_FALSE@,$BUILD_MPD_FALSE,;t t s,@BUILD_CAIRO_TRUE@,$BUILD_CAIRO_TRUE,;t t s,@BUILD_CAIRO_FALSE@,$BUILD_CAIRO_FALSE,;t t s,@CAIROCONFIG@,$CAIROCONFIG,;t t -s,@BUILD_METAR_TRUE@,$BUILD_METAR_TRUE,;t t -s,@BUILD_METAR_FALSE@,$BUILD_METAR_FALSE,;t t s,@BUILD_MLDONKEY_TRUE@,$BUILD_MLDONKEY_TRUE,;t t s,@BUILD_MLDONKEY_FALSE@,$BUILD_MLDONKEY_FALSE,;t t s,@BUILD_X11_TRUE@,$BUILD_X11_TRUE,;t t diff --git a/configure.in b/configure.in index 49f7a70d..64240717 100644 --- a/configure.in +++ b/configure.in @@ -143,25 +143,6 @@ if test "$want_cairo" = "yes"; then fi fi -dnl metar -dnl - -want_metar=no -AC_ARG_ENABLE(metar, -[ --enable-metar enable if you want metar stats (weather information) [default=no]], - [want_metar="$enableval"]) - -AM_CONDITIONAL(BUILD_METAR, test x$want_metar == xyes) -if test x$want_metar == xyes; then -AC_CHECK_HEADERS([metar.h], [], [METAR_MISSING=yes]) - if test "x$METAR_MISSING" = xyes; then - AC_MSG_ERROR([something went wrong when checking for mdsplib, you're probably missing headers or it's not installed]) - fi - AC_DEFINE(METAR, 1, [Define if you want metar stats (weather information)]) -fi -dnl - - dnl dnl MLDonkey diff --git a/conky.c b/conky.c index e53e9a12..8d661029 100644 --- a/conky.c +++ b/conky.c @@ -773,21 +773,6 @@ enum text_object_type { OBJ_mpd_length, OBJ_mpd_percent, #endif -#ifdef METAR - OBJ_metar_ob_time, - OBJ_metar_temp, - OBJ_metar_tempf, - OBJ_metar_windchill, - OBJ_metar_dew_point, - OBJ_metar_rh, - OBJ_metar_windspeed, - OBJ_metar_windspeed_km, - OBJ_metar_windspeed_mph, - OBJ_metar_winddir, - OBJ_metar_swinddir, - OBJ_metar_cloud, - OBJ_metar_u2d_time, -#endif }; struct text_object { @@ -1379,31 +1364,6 @@ int a = stippled_borders, b = 1; (void) scan_bar(arg, &obj->data.pair.a, &obj->data.pair.b); END OBJ(seti_credit, INFO_SETI) END #endif -#ifdef METAR - OBJ(metar_ob_time, INFO_METAR) - END - OBJ(metar_temp, INFO_METAR) - END - OBJ(metar_tempf, INFO_METAR) - END - OBJ(metar_windchill, INFO_METAR) - END - OBJ(metar_dew_point, INFO_METAR) - END - OBJ(metar_rh, INFO_METAR) - END - OBJ(metar_windspeed, INFO_METAR) - END - OBJ(metar_windspeed_km, INFO_METAR) - END - OBJ(metar_windspeed_mph, INFO_METAR) - END - OBJ(metar_winddir, INFO_METAR) - END - OBJ(metar_swinddir, INFO_METAR) - END OBJ(metar_cloud, INFO_METAR) - END OBJ(metar_u2d_time, INFO_METAR) END -#endif #ifdef MPD OBJ(mpd_artist, INFO_MPD) END OBJ(mpd_title, INFO_MPD) @@ -2446,158 +2406,6 @@ static void generate_text() } -#ifdef METAR - // Hmm, it's expensive to calculate this shit every time FIXME - OBJ(metar_ob_time) { - if (data.ob_hour != INT_MAX - && data.ob_minute != INT_MAX - && metar_worked) - format_seconds(p, n, - data.ob_hour * - 3600 + - data.ob_minute * - 60); - else - format_seconds(p, n, 0); - } - OBJ(metar_temp) { - if (data.temp != INT_MAX && metar_worked) - snprintf(p, n, "%i", data.temp); - else - snprintf(p, n, "-"); - } - OBJ(metar_tempf) { - if (data.temp != INT_MAX && metar_worked) - snprintf(p, n, "%'.1f", - (data.temp + - 40) * 9.0 / 5 - 40); - else - snprintf(p, n, "-"); - } - OBJ(metar_windchill) { - if (data.temp != INT_MAX - && data.winData.windSpeed != INT_MAX - && metar_worked) - snprintf(p, n, "%i", - calculateWindChill(data. - temp, - data. - winData. - windSpeed)); - else - snprintf(p, n, "-"); - } - OBJ(metar_dew_point) { - if (data.dew_pt_temp != INT_MAX - && metar_worked) - snprintf(p, n, "%i", - data.dew_pt_temp); - else - snprintf(p, n, "-"); - } - OBJ(metar_rh) { - if (data.temp != INT_MAX - && data.dew_pt_temp != INT_MAX - && metar_worked) - snprintf(p, n, "%i", - calculateRelativeHumidity - (data.temp, - data.dew_pt_temp)); - else - snprintf(p, n, "-"); - } - OBJ(metar_windspeed) { - if (data.winData.windSpeed != INT_MAX - && metar_worked) - snprintf(p, n, "%i", - data.winData.windSpeed); - else - snprintf(p, n, "-"); - } - OBJ(metar_windspeed_km) { - if (data.winData.windSpeed != INT_MAX - && metar_worked) - snprintf(p, n, "%'.2f", - (data.winData.windSpeed * 1.852)); - else - snprintf(p, n, "-"); - } - OBJ(metar_windspeed_mph) { - if (data.winData.windSpeed != INT_MAX - && metar_worked) - snprintf(p, n, "%'.2f", - (data.winData.windSpeed * 1.151)); - else - snprintf(p, n, "-"); - } - OBJ(metar_winddir) { - if (data.winData.windDir != INT_MAX - && metar_worked) - snprintf(p, n, "%s", - calculateWindDirectionString - (data.winData.windDir)); - else - snprintf(p, n, "-"); - } - OBJ(metar_swinddir) { - if (data.winData.windDir != INT_MAX - && metar_worked) - snprintf(p, n, "%s", - calculateShortWindDirectionString - (data.winData.windDir)); - else - snprintf(p, n, "-"); - } - - OBJ(metar_cloud) { - if (data.cldTypHgt[0].cloud_type[0] != '\0' - && metar_worked) { - if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], "SKC") == 0) - snprintf(p, n, - "Clear Sky"); - else if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], - "CLR") == 0) - snprintf(p, n, - "Clear Sky"); - else if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], - "FEW") == 0) - snprintf(p, n, - "Few clouds"); - else if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], - "SCT") == 0) - snprintf(p, n, - "Scattered clouds"); - else if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], - "BKN") == 0) - snprintf(p, n, - "Broken clouds"); - else if (strcmp - (&data.cldTypHgt[0]. - cloud_type[0], - "OVC") == 0) - snprintf(p, n, "Overcast"); - else - snprintf(p, n, - "Checking..."); - } else - snprintf(p, n, "Checking..."); - } - OBJ(metar_u2d_time) { - format_seconds(p, n, - (int) last_metar_update % - (3600 * 24) + 3600); - } -#endif break; } @@ -3355,20 +3163,6 @@ static void draw_stuff() XdbeSwapBuffers(display, &swap, 1); } #endif -/*#ifdef METAR wtf is this for exactly? aside from trying to cause segfaults? -if (metar_station != NULL) { - free(metar_station); - metar_station = NULL; -} -if (metar_server != NULL) { - free(metar_server); - metar_server = NULL; -} -if (metar_path != NULL) { - free(metar_path); - metar_path = NULL; -} -#endif*/ #endif /* X11 */ } #ifdef X11 @@ -3785,12 +3579,6 @@ static void set_default_configurations(void) mlconfig.mldonkey_login = NULL; mlconfig.mldonkey_password = NULL; #endif -#ifdef METAR - metar_station = NULL; - metar_server = NULL; - metar_path = NULL; - last_metar_update = 0; -#endif } static void load_config_file(const char *f) @@ -4156,28 +3944,6 @@ else if (strcasecmp(name, a) == 0 || strcasecmp(name, a) == 0) + 1); strcpy(seti_dir, value); } -#endif -#ifdef METAR - CONF("metar_station") { - metar_station = (char *) - malloc(strlen(value) - + 5); - strcpy(metar_station, value); - strcat(metar_station, ".TXT"); - } - CONF("metar_server") { - metar_server = (char *) - malloc(strlen(value) - + 1); - strcpy(metar_server, value); - } - CONF("metar_path") { - metar_path = (char *) - malloc(strlen(value) - + 1); - strcpy(metar_path, value); - - } #endif CONF("text") { if (text != original_text) diff --git a/conky.h b/conky.h index c5fb1e14..9f832ce1 100644 --- a/conky.h +++ b/conky.h @@ -36,10 +36,6 @@ #define TEXT_BUFFER_SIZE 1024 -#ifdef METAR -#include -#endif - #include #define ERR(s, varargs...) \ @@ -110,9 +106,6 @@ enum { INFO_MPD = 15, #endif INFO_TOP = 16, -#ifdef METAR - INFO_METAR = 17, -#endif #ifdef MLDONKEY INFO_MLDONKEY = 18, #endif @@ -307,29 +300,8 @@ struct process { float totalmem; }; -#ifdef METAR -double last_metar_update; -extern char *metar_station; -extern char *metar_server; -extern char *metar_path; -extern char ftp_ok; -extern char metar_worked; -extern Decoded_METAR data; - -extern int calculateRelativeHumidity(int, int); -extern int calculateWindChill(int, int); -extern int knTokph(int); -extern const char *calculateWindDirectionString(int); -extern const char *calculateShortWindDirectionString(int); - -void update_metar(); -#endif - - - void update_top(); - /* fs-stuff is possibly system dependant (in fs.c) */ void update_fs_stats(void); diff --git a/metarinfo.c b/metarinfo.c deleted file mode 100644 index 96ef23f4..00000000 --- a/metarinfo.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Conky, a system monitor, based on torsmo - * - * This program is licensed under BSD license, read COPYING - * - * $Id$ - */ - -#include "conky.h" -#include -#include "ftp.h" -#include -#include -#include -#include "metarinfo.h" - -/* for threads */ -static int status = 0; - - -int calculateRelativeHumidity(int temp, int dew) -{ - float rh = 0.0; - rh = 100.0 * powf((112 - (0.1 * temp) + dew) / - (112 + (0.9 * temp)), 8); - return (int) rh; -} - -int calculateWindChill(int temperatureC, int windKn) -{ - double windKmh = windKn * 1.852; - return (int) (13.112 + 0.6215 * temperatureC - - 11.37 * powf(windKmh, - .16) + - 0.3965 * temperatureC * powf(windKmh, .16)); -} - -/*Should no longer be needed -int knTokph(int knSpeed) -{ - return (knSpeed * 1.852); -} -*/ -const char *calculateWindDirectionString(int degree) -{ - if (degree < 22.5) { - return "North"; - } else if (degree < 67.5) { - return "Northeast"; - } else if (degree < 112.5) { - return "East"; - } else if (degree < 157.5) { - return "Southeast"; - } else if (degree < 202.5) { - return "South"; - } else if (degree < 247.5) { - return "Southwest"; - } else if (degree < 292.5) { - return "West"; - } else if (degree < 337.5) { - return "Northwest"; - } else { - return "North"; - } -} -const char *calculateShortWindDirectionString(int degree) -{ - if (degree < 22.5) { - return "N"; - } else if (degree < 67.5) { - return "NE"; - } else if (degree < 112.5) { - return "E"; - } else if (degree < 157.5) { - return "SE"; - } else if (degree < 202.5) { - return "S"; - } else if (degree < 247.5) { - return "SW"; - } else if (degree < 292.5) { - return "W"; - } else if (degree < 337.5) { - return "NW"; - } else { - return "N"; - } -} - -void ftpData(void *userData, const char *data, int len) -{ - if (userData) { - } // do nothing to make stupid warning go away - if (len <= 0) - return; - - if (data != NULL) { - line = strdup(data); - } -} - -extern unsigned int sleep(unsigned int); - -void *fetch_ftp() -{ - // try three times if it fails - int tries = 0; - do { - if (tries > 0) { - /* this happens too often, so i'll leave it commented fprintf(stderr, "METAR update failed for some reason, retry %i\n", tries); */ - sleep(15); /* give it some time in case the server is busy or down */ - } - - tries++; - if (strlen(metar_station) != 8) { - ERR("You didn't supply a valid METAR station code\n"); - return NULL; - } - if (metar_server == NULL) - metar_server = strdup("weather.noaa.gov"); - if (metar_path == NULL) - metar_path = - strdup("/data/observations/metar/stations"); - - int res; - initFtp(); - res = connectFtp(metar_server, 0); - if (res < 0) { - ERR("Couldn't connect to %s, retrying\n", - metar_server); - continue; - } - res = changeFtpDirectory(metar_path); - if (res < 0) { - ERR("Metar update failed (couldn't CWD to %s)\n", - metar_path); - disconnectFtp(); - continue; - } - if (res == 0) { - ERR("Metar update failed\n"); - continue; - } - if (getFtp(ftpData, NULL, metar_station) < 0) { - ERR("Failed to get file %s\n", metar_station); - } - - disconnectFtp(); - if (line != NULL) { - dcdNetMETAR(line, &data); - free(line); - line = NULL; - ftp_ok = 1; - metar_worked = 1; - } else { - ftp_ok = 0; - } - - } while (ftp_ok == 0 && tries < 3); - status = 1; - return NULL; -} - -static pthread_t thread1; - -void update_metar() -{ - int iret1; - if (!status) { - status = 2; - iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL); - } else if (status == 2) { /* thread is still running. let's kill it and start again */ - /*pthread_cancel(thread1); - status = 2; - iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL);*/ - /* - * actually, lets do nothing for a while - */ - } else if (status == 1) { /* status must be 1 */ - pthread_join(thread1, NULL); - status = 2; - iret1 = pthread_create(&thread1, NULL, fetch_ftp, NULL); - } - -} diff --git a/metarinfo.h b/metarinfo.h deleted file mode 100644 index 76a1aa0b..00000000 --- a/metarinfo.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Conky, a system monitor, based on torsmo - * - * This program is licensed under BSD license, read COPYING - * - * $Id$ - */ - -#include -#include -#include - -int calculateRelativeHumidity(int, int); -int calculateWindChill(int, int); -//int knTokph(int); -const char *calculateWindDirectionString(int); -const char *calculateShortWindDirectionString(int); - -char *line = NULL; -char *metar_station = NULL; -char *metar_server = NULL; -char *metar_path = NULL; -char ftp_ok = 0; -char metar_worked = 0; - -Decoded_METAR data;