From a5088c098a534504de8859f7e634c62db50ba324 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 4 Feb 2021 17:48:29 +0200 Subject: [PATCH 1/3] qt3: remove Not used by any other package, and has vulnerabilities. Close #99841 , Close #96827, Close #90955. --- pkgs/development/libraries/qt-3/builder.sh | 38 -------- pkgs/development/libraries/qt-3/default.nix | 92 ------------------- pkgs/development/libraries/qt-3/qt-pwd.patch | 15 --- .../libraries/qt-3/qt3-gcc4.6.0.patch | 23 ----- pkgs/development/libraries/qt-3/setup-hook.sh | 1 - pkgs/development/libraries/qt-3/strip.patch | 18 ---- pkgs/development/libraries/qt-3/xrandr.patch | 42 --------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 4 - 9 files changed, 1 insertion(+), 233 deletions(-) delete mode 100644 pkgs/development/libraries/qt-3/builder.sh delete mode 100644 pkgs/development/libraries/qt-3/default.nix delete mode 100644 pkgs/development/libraries/qt-3/qt-pwd.patch delete mode 100644 pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch delete mode 100644 pkgs/development/libraries/qt-3/setup-hook.sh delete mode 100644 pkgs/development/libraries/qt-3/strip.patch delete mode 100644 pkgs/development/libraries/qt-3/xrandr.patch diff --git a/pkgs/development/libraries/qt-3/builder.sh b/pkgs/development/libraries/qt-3/builder.sh deleted file mode 100644 index 460ae17766af..000000000000 --- a/pkgs/development/libraries/qt-3/builder.sh +++ /dev/null @@ -1,38 +0,0 @@ -source $stdenv/setup - - -preConfigure() { - - # Patch some of the configure files a bit to get of global paths. - # (Buildings using stuff in those paths will fail anyway, but it - # will cause ./configure misdetections). - for i in config.tests/unix/checkavail config.tests/*/*.test mkspecs/*/qmake.conf; do - echo "patching $i..." - substituteInPlace "$i" \ - --replace " /lib" " /FOO" \ - --replace "/usr" "/FOO" - done -} - - -# !!! TODO: -system-libmng -configureFlags="-prefix $out $configureFlags" -dontAddPrefix=1 - -configureScript=configureScript -configureScript() { - echo yes | ./configure $configureFlags - export LD_LIBRARY_PATH=$(pwd)/lib -} - - -postInstall() { - # Qt's `make install' is broken; it copies ./bin/qmake, which - # is a symlink to ./qmake/qmake. So we end up with a dangling - # symlink. - rm $out/bin/qmake - cp -p qmake/qmake $out/bin -} - - -genericBuild diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix deleted file mode 100644 index b2d818a2972d..000000000000 --- a/pkgs/development/libraries/qt-3/default.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ lib, stdenv, fetchurl -, xftSupport ? true, libXft ? null -, xrenderSupport ? true, libXrender ? null -, xrandrSupport ? true, libXrandr ? null -, xineramaSupport ? true, libXinerama ? null -, cursorSupport ? true, libXcursor ? null -, threadSupport ? true -, mysqlSupport ? false, libmysqlclient ? null -, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms -, openglSupport ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms -, libGL ? null, libGLU ? null, libXmu ? null -, xlibsWrapper, xorgproto, zlib, libjpeg, libpng, which -}: - -assert xftSupport -> libXft != null; -assert xrenderSupport -> xftSupport && libXrender != null; -assert xrandrSupport -> libXrandr != null; -assert cursorSupport -> libXcursor != null; -assert mysqlSupport -> libmysqlclient != null; -assert openglSupport -> libGL != null && libGLU != null && libXmu != null; - -stdenv.mkDerivation { - name = "qt-3.3.8"; - - builder = ./builder.sh; - - setupHook = ./setup-hook.sh; - - src = fetchurl { - url = "http://download.qt.io/archive/qt/3/qt-x11-free-3.3.8.tar.bz2"; - sha256 = "0jd4g3bwkgk2s4flbmgisyihm7cam964gzb3pawjlkhas01zghz8"; - }; - - nativeBuildInputs = [ which ]; - propagatedBuildInputs = [libpng xlibsWrapper libXft libXrender zlib libjpeg]; - - hardeningDisable = [ "format" ]; - - configureFlags = let - mk = cond: name: "-${lib.optionalString (!cond) "no-"}${name}"; - in [ - "-v" - "-system-zlib" "-system-libpng" "-system-libjpeg" - "-qt-gif" - "-I${xorgproto}/include" - (mk threadSupport "thread") - (mk xrenderSupport "xrender") - (mk xrandrSupport "xrandr") - (mk xineramaSupport "xinerama") - (mk xrandrSupport "xrandr") - (mk xftSupport "xft") - ] ++ lib.optionals openglSupport [ - "-dlopen-opengl" - "-L${libGL}/lib" "-I${libGLU}/include" - "-L${libXmu.out}/lib" "-I${libXmu.dev}/include" - ] ++ lib.optionals xrenderSupport [ - "-L${libXrender.out}/lib" "-I${libXrender.dev}/include" - ] ++ lib.optionals xrandrSupport [ - "-L${libXrandr.out}/lib" "-I${libXrandr.dev}/include" - ] ++ lib.optionals xineramaSupport [ - "-L${libXinerama.out}/lib" "-I${libXinerama.dev}/include" - ] ++ lib.optionals cursorSupport [ - "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" - ] ++ lib.optionals mysqlSupport [ - "-qt-sql-mysql" "-L${libmysqlclient}/lib/mysql" "-I${libmysqlclient}/include/mysql" - ] ++ lib.optionals xftSupport [ - "-L${libXft.out}/lib" "-I${libXft.dev}/include" - "-L${libXft.freetype.out}/lib" "-I${libXft.freetype.dev}/include" - "-L${libXft.fontconfig.lib}/lib" "-I${libXft.fontconfig.dev}/include" - ]; - - patches = [ - # Don't strip everything so we can get useful backtraces. - ./strip.patch - - # Build on NixOS. - ./qt-pwd.patch - - # randr.h and Xrandr.h need not be in the same prefix. - ./xrandr.patch - - # Make it build with gcc 4.6.0 - ./qt3-gcc4.6.0.patch - ]; - - passthru = {inherit mysqlSupport;}; - - meta = with lib; { - license = with licenses; [ gpl2 qpl ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/development/libraries/qt-3/qt-pwd.patch b/pkgs/development/libraries/qt-3/qt-pwd.patch deleted file mode 100644 index 763f785726b7..000000000000 --- a/pkgs/development/libraries/qt-3/qt-pwd.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ruN qt-x11-free-3.3.3/configure qt-x11-free-3.3.3.new/configure ---- qt-x11-free-3.3.3/configure 2004-06-14 11:18:55.000000000 +0200 -+++ qt-x11-free-3.3.3.new/configure 2005-11-12 19:39:43.000000000 +0100 -@@ -16,9 +16,9 @@ - relconf=`basename $0` - # the directory of this script is the "source tree" - relpath=`dirname $0` --relpath=`(cd $relpath; /bin/pwd)` -+relpath=`(cd $relpath; pwd)` - # the current directory is the "build tree" or "object tree" --outpath=`/bin/pwd` -+outpath=`pwd` - - # later cache the command line in config.status - OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"` diff --git a/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch b/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch deleted file mode 100644 index c1a903c130c7..000000000000 --- a/pkgs/development/libraries/qt-3/qt3-gcc4.6.0.patch +++ /dev/null @@ -1,23 +0,0 @@ -I picked it here: -https://bugs.archlinux.org/task/23915 - ---- qt-x11-free-3.3.8b/src/tools/qmap.h~ 2008-01-15 19:09:13.000000000 +0000 -+++ qt-x11-free-3.3.8b/src/tools/qmap.h 2011-04-11 00:16:04.000000000 +0100 -@@ -50,6 +50,7 @@ - #endif // QT_H - - #ifndef QT_NO_STL -+#include - #include - #include - #endif ---- qt-x11-free-3.3.8b/src/tools/qvaluelist.h~ 2008-01-15 19:09:13.000000000 +0000 -+++ qt-x11-free-3.3.8b/src/tools/qvaluelist.h 2011-04-11 00:16:49.000000000 +0100 -@@ -48,6 +48,7 @@ - #endif // QT_H - - #ifndef QT_NO_STL -+#include - #include - #include - #endif diff --git a/pkgs/development/libraries/qt-3/setup-hook.sh b/pkgs/development/libraries/qt-3/setup-hook.sh deleted file mode 100644 index db1a2529ff54..000000000000 --- a/pkgs/development/libraries/qt-3/setup-hook.sh +++ /dev/null @@ -1 +0,0 @@ -export QTDIR=@out@ diff --git a/pkgs/development/libraries/qt-3/strip.patch b/pkgs/development/libraries/qt-3/strip.patch deleted file mode 100644 index a0c9fa738898..000000000000 --- a/pkgs/development/libraries/qt-3/strip.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -rc qt-x11-free-3.3.3-orig/mkspecs/linux-g++/qmake.conf qt-x11-free-3.3.3/mkspecs/linux-g++/qmake.conf -*** qt-x11-free-3.3.3-orig/mkspecs/linux-g++/qmake.conf 2004-08-05 16:42:57.000000000 +0200 ---- qt-x11-free-3.3.3/mkspecs/linux-g++/qmake.conf 2005-03-02 12:25:55.000000000 +0100 -*************** -*** 85,90 **** - QMAKE_DEL_FILE = rm -f - QMAKE_DEL_DIR = rmdir - QMAKE_STRIP = strip -! QMAKE_STRIPFLAGS_LIB += --strip-unneeded - QMAKE_CHK_DIR_EXISTS = test -d - QMAKE_MKDIR = mkdir -p ---- 85,90 ---- - QMAKE_DEL_FILE = rm -f - QMAKE_DEL_DIR = rmdir - QMAKE_STRIP = strip -! QMAKE_STRIPFLAGS_LIB += --strip-debug - QMAKE_CHK_DIR_EXISTS = test -d - QMAKE_MKDIR = mkdir -p diff --git a/pkgs/development/libraries/qt-3/xrandr.patch b/pkgs/development/libraries/qt-3/xrandr.patch deleted file mode 100644 index 0389c7fdd068..000000000000 --- a/pkgs/development/libraries/qt-3/xrandr.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff -rc qt-x11-free-3.3.6-orig/config.tests/x11/xrandr.test qt-x11-free-3.3.6/config.tests/x11/xrandr.test -*** qt-x11-free-3.3.6-orig/config.tests/x11/xrandr.test 2006-09-14 14:00:08.000000000 +0200 ---- qt-x11-free-3.3.6/config.tests/x11/xrandr.test 2006-09-14 14:10:39.000000000 +0200 -*************** -*** 52,69 **** - INCDIRS="$IN_INCDIRS $XDIRS /FOO/include /include" - F= - for INCDIR in $INCDIRS; do -! if [ -f $INCDIR/$INC -a -f $INCDIR/$INC2 ]; then - F=yes -! XRANDR_H=$INCDIR/$INC - RANDR_H=$INCDIR/$INC2 -! [ "$VERBOSE" = "yes" ] && echo " Found $INC in $INCDIR" - break - fi - done - if [ -z "$F" ] - then - XRANDR=no -! [ "$VERBOSE" = "yes" ] && echo " Could not find $INC anywhere in $INCDIRS" - fi - fi - ---- 52,69 ---- - INCDIRS="$IN_INCDIRS $XDIRS /FOO/include /include" - F= - for INCDIR in $INCDIRS; do -! if [ -f $INCDIR/$INC2 ]; then - F=yes -! # XRANDR_H=$INCDIR/$INC - RANDR_H=$INCDIR/$INC2 -! [ "$VERBOSE" = "yes" ] && echo " Found $INC2 in $INCDIR" - break - fi - done - if [ -z "$F" ] - then - XRANDR=no -! [ "$VERBOSE" = "yes" ] && echo " Could not find $INC2 anywhere in $INCDIRS" - fi - fi - diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 95a063331b27..f0a7294a3b56 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -550,6 +550,7 @@ mapAliases ({ retroshare06 = retroshare; gtk-recordmydesktop = throw "gtk-recordmydesktop has been removed from nixpkgs, as it's unmaintained and uses deprecated libraries"; # added 2019-12-10 qt-recordmydesktop = throw "qt-recordmydesktop has been removed from nixpkgs, as it's abandoned and uses deprecated libraries"; # added 2019-12-10 + qt-3 = throw "qt-3 has been removed from nixpkgs, as it's unmaintained and insecure"; # added 2021-02-15 rfkill = throw "rfkill has been removed, as it's included in util-linux"; # added 2020-08-23 riak-cs = throw "riak-cs is not maintained anymore"; # added 2020-10-14 rkt = throw "rkt was archived by upstream"; # added 2020-05-16 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a863bac1a73..718653411110 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16200,10 +16200,6 @@ in qolibri = libsForQt5.callPackage ../applications/misc/qolibri { }; - qt3 = callPackage ../development/libraries/qt-3 { - libpng = libpng12; - }; - qt4 = qt48; qt48 = callPackage ../development/libraries/qt-4.x/4.8 { From 1cdf4d2d19d7c880767293b7c9ca7d1351a0591b Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 5 Feb 2021 21:28:07 +0200 Subject: [PATCH 2/3] lprof: remove Broken since a long time ago, and was not updated upstream since 2013. --- pkgs/tools/graphics/lprof/default.nix | 38 ------------------- .../graphics/lprof/keep-environment.patch | 16 -------- pkgs/tools/graphics/lprof/lcms-1.17.patch | 13 ------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 - 5 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 pkgs/tools/graphics/lprof/default.nix delete mode 100644 pkgs/tools/graphics/lprof/keep-environment.patch delete mode 100644 pkgs/tools/graphics/lprof/lcms-1.17.patch diff --git a/pkgs/tools/graphics/lprof/default.nix b/pkgs/tools/graphics/lprof/default.nix deleted file mode 100644 index a1c81f16f2bd..000000000000 --- a/pkgs/tools/graphics/lprof/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ lib, stdenv, fetchurl, sconsPackages, qt3, lcms1, libtiff, vigra }: - -/* how to calibrate your monitor: - Eg see https://wiki.archlinux.org/index.php/ICC_Profiles#Loading_ICC_Profiles -*/ -stdenv.mkDerivation { - name = "lprof-1.11.4.1"; - nativeBuildInputs = [ sconsPackages.scons_3_0_1 ]; - buildInputs = [ qt3 lcms1 libtiff vigra ]; - - hardeningDisable = [ "format" ]; - - preConfigure = '' - export QTDIR=${qt3} - export qt_directory=${qt3} - ''; - - src = fetchurl { - url = "mirror://sourceforge/lprof/lprof/lprof-1.11.4/lprof-1.11.4.1.tar.gz"; - sha256 = "0q8x24fm5yyvm151xrl3l03p7hvvciqnkbviprfnvlr0lyg9wsrn"; - }; - - sconsFlags = "SYSLIBS=1"; - preBuild = '' - export CXX=g++ - ''; - prefixKey = "PREFIX="; - - patches = [ ./lcms-1.17.patch ./keep-environment.patch ]; - - meta = { - description = "Little CMS ICC profile construction set"; - homepage = "https://sourceforge.net/projects/lprof"; - license = lib.licenses.gpl2; - platforms = lib.platforms.linux; - broken = true; # Broken since 2020-07-28 (https://hydra.nixos.org/build/135234622) - }; -} diff --git a/pkgs/tools/graphics/lprof/keep-environment.patch b/pkgs/tools/graphics/lprof/keep-environment.patch deleted file mode 100644 index 7d0beaed587a..000000000000 --- a/pkgs/tools/graphics/lprof/keep-environment.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- lprof-1.11.4.1.org/SConstruct 2006-06-06 02:11:32.000000000 +0100 -+++ lprof-1.11.4.1/SConstruct 2017-08-29 12:56:13.425654683 +0100 -@@ -22,12 +22,7 @@ - # opts.Add(BoolOption('qt-mt-lib', 'Flag used to set QT library to either qt-mt or qt. Value of 1 = qt-mt, 0 = qt.', 'yes')) - - # setup base environment --env = Environment( -- ENV = { -- 'PATH' : os.environ[ 'PATH' ], -- 'HOME' : os.environ[ 'HOME' ], # required for distcc -- 'LDFLAGS' : '' -- }, options = opts) -+env = Environment(ENV = os.environ, options = opts) - - opts.Update(env) - opts.Save('lprof.conf', env) # Save, so user doesn't have to diff --git a/pkgs/tools/graphics/lprof/lcms-1.17.patch b/pkgs/tools/graphics/lprof/lcms-1.17.patch deleted file mode 100644 index a88471e143fd..000000000000 --- a/pkgs/tools/graphics/lprof/lcms-1.17.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/src/liblprof/lcmsprf.h 2007-08-31 15:36:20.000000000 -0700 -+++ b/src/liblprof/lcmsprf.h 2007-08-31 15:37:39.000000000 -0700 -@@ -67,6 +67,9 @@ - #define mmax(a,b) ((a) > (b)?(a):(b)) - #endif - -+#if LCMS_VERSION > 116 -+typedef int BOOL; -+#endif - - /* Misc operations ------------------------------------------------------------------------ */ - - diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index f0a7294a3b56..82e36dbd2a8d 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -342,6 +342,7 @@ mapAliases ({ linux-steam-integration = throw "linux-steam-integration has been removed, as the upstream project has been abandoned"; # added 2020-05-22 loadcaffe = throw "loadcaffe has been removed, as the upstream project has been abandoned"; # added 2020-03-28 + lprof = throw "lprof has been removed as it's unmaintained upstream and broken in nixpkgs since a while ago"; # added 2021-02-15 lttngTools = lttng-tools; # added 2014-07-31 lttngUst = lttng-ust; # added 2014-07-31 lua5_1_sockets = lua51Packages.luasocket; # added 2017-05-02 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 718653411110..9e78007ef48a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4155,8 +4155,6 @@ in lp_solve = callPackage ../applications/science/math/lp_solve { }; - lprof = callPackage ../tools/graphics/lprof { }; - fastlane = callPackage ../tools/admin/fastlane { }; fatresize = callPackage ../tools/filesystems/fatresize {}; From 24542ed59344ff8379fef42dcfaf13a778f379d8 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Fri, 5 Feb 2021 21:36:53 +0200 Subject: [PATCH 3/3] taskjuggler: remove unused files --- .../misc/taskjuggler/2.x/default.nix | 75 ------------------- .../misc/taskjuggler/2.x/timezone-glibc.patch | 48 ------------ 2 files changed, 123 deletions(-) delete mode 100644 pkgs/applications/misc/taskjuggler/2.x/default.nix delete mode 100644 pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch diff --git a/pkgs/applications/misc/taskjuggler/2.x/default.nix b/pkgs/applications/misc/taskjuggler/2.x/default.nix deleted file mode 100644 index 0235c8af7c53..000000000000 --- a/pkgs/applications/misc/taskjuggler/2.x/default.nix +++ /dev/null @@ -1,75 +0,0 @@ -{stdenv, fetchurl, -zlib, libpng, libjpeg, perl, expat, qt3, -libX11, libXext, libSM, libICE, -}: - -stdenv.mkDerivation rec { - name = "taskjuggler-2.4.3"; - src = fetchurl { - url = "http://www.taskjuggler.org/download/${name}.tar.bz2"; - sha256 = "14gkxa2vwfih5z7fffbavps7m44z5bq950qndigw2icam5ks83jl"; - }; - - buildInputs = - [zlib libpng libX11 libXext libSM libICE perl expat libjpeg] - ; - - patches = [ ./timezone-glibc.patch ]; - - preConfigure = '' - for i in $(grep -R "/bin/bash" . | sed 's/:.*//'); do - substituteInPlace $i --replace /bin/bash $(type -Pp bash) - done - for i in $(grep -R "/usr/bin/perl" . | sed 's/:.*//'); do - substituteInPlace $i --replace /usr/bin/perl ${perl}/bin/perl - done - - # Fix install - for i in docs/en/Makefile.in Examples/BigProject/Common/Makefile.in Examples/BigProject/Makefile.in Examples/BigProject/Project1/Makefile.in Examples/BigProject/Project2/Makefile.in Examples/FirstProject/Makefile.in Examples/ShiftSchedule/Makefile.in; do - # Do not use variable substitution because there is some text after the last '@' - substituteInPlace $i --replace 'docprefix = @PACKAGES_DIR@' 'docprefix = $(docdir)/' - done - - # Comment because the ical export need the KDE support. - for i in Examples/FirstProject/AccountingSoftware.tjp; do - substituteInPlace $i --replace "icalreport" "# icalreport" - done - - for i in TestSuite/testdir TestSuite/createrefs \ - TestSuite/Scheduler/Correct/Expression.sh; do - substituteInPlace $i --replace '/bin/rm' 'rm' - done - - # Some tests require writing at $HOME - HOME=$TMPDIR - ''; - - configureFlags = [ - "--without-arts" "--disable-docs" - "--x-includes=${libX11.dev}/include" - "--x-libraries=${libX11.out}/lib" - "--with-qt-dir=${qt3}" - ]; - - preInstall = '' - mkdir -p $out/share/emacs/site-lisp/ - cp Contrib/emacs/taskjug.el $out/share/emacs/site-lisp/ - ''; - - # kde_locale is not defined when installing without kde. - installFlags = [ "kde_locale=\${out}/share/locale" ]; - - meta = { - homepage = "http://www.taskjuggler.org"; - license = lib.licenses.gpl2; - description = "Project management tool"; - longDescription = '' - TaskJuggler is a modern and powerful, Open Source project management - tool. Its new approach to project planing and tracking is more - flexible and superior to the commonly used Gantt chart editing - tools. It has already been successfully used in many projects and - scales easily to projects with hundreds of resources and thousands of - tasks. - ''; - }; -} diff --git a/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch b/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch deleted file mode 100644 index f599e8a1730c..000000000000 --- a/pkgs/applications/misc/taskjuggler/2.x/timezone-glibc.patch +++ /dev/null @@ -1,48 +0,0 @@ -From the discussion in http://groups.google.com/group/taskjuggler-users/browse_thread/thread/f65a3efd4dcae2fc/a44c711a9d28ebee?show_docid=a44c711a9d28ebee - -From: Chris Schlaeger -Date: Sat, 27 Feb 2010 06:33:35 +0000 (+0100) -Subject: Try to fix time zone check for glibc 2.11. -X-Git-Url: http://www.taskjuggler.org/cgi-bin/gitweb.cgi?p=taskjuggler.git;a=commitdiff_plain;h=2382ed54f90c3c899badb3f56aaa2b3b5dba361e;hp=c666c5068312fec7db75e17d1c567d94127d1dda - -Try to fix time zone check for glibc 2.11. - -Reported-by: Lee ---- - -diff --git a/taskjuggler/Utility.cpp b/taskjuggler/Utility.cpp -index 5e2bf21..9b7fce2 100644 ---- a/taskjuggler/Utility.cpp -+++ b/taskjuggler/Utility.cpp -@@ -206,16 +206,28 @@ setTimezone(const char* tZone) - - /* To validate the tZone value we call tzset(). It will convert the zone - * into a three-letter acronym in case the tZone value is good. If not, it -- * will just copy the wrong value to tzname[0] (glibc < 2.5) or fall back -- * to UTC. */ -+ * will -+ * - copy the wrong value to tzname[0] (glibc < 2.5) -+ * - or fall back to UTC (glibc >= 2.5 && < 2.11) -+ * - copy the part before the '/' to tzname[0] (glibc >= 2.11). -+ */ - tzset(); -+ char* region = new(char[strlen(tZone) + 1]); -+ region[0] = 0; -+ if (strchr(tZone, '/')) -+ { -+ strcpy(region, tZone); -+ *strchr(region, '/') = 0; -+ } - if (timezone2tz(tZone) == 0 && -- (strcmp(tzname[0], tZone) == 0 || -+ (strcmp(tzname[0], tZone) == 0 || strcmp(tzname[0], region) == 0 || - (strcmp(tZone, "UTC") != 0 && strcmp(tzname[0], "UTC") == 0))) - { - UtilityError = QString(i18n("Illegal timezone '%1'")).arg(tZone); -+ delete region; - return false; - } -+ delete region; - - if (!LtHashTab) - return true;