Bug 114771 - Compile error on Solaris 8 - kcontrol/clock/tzone.cpp uses INITFILE which doesn't exist
Summary: Compile error on Solaris 8 - kcontrol/clock/tzone.cpp uses INITFILE which doe...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kcontrol
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR critical
Target Milestone: ---
Assignee: Daniel Molkentin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-20 17:57 UTC by Steve Evans
Modified: 2010-06-22 19:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
here's a proposed patch (tested on Solaris 10) (3.71 KB, patch)
2005-11-20 02:47 UTC, Stefan Teleman
Details
pls ignore the previous patch -- here's the correct one -- sorry (3.86 KB, patch)
2005-11-20 02:55 UTC, Stefan Teleman
Details
picture of kicker/kcontrol with working timezone settings (43.03 KB, image/png)
2005-11-21 16:04 UTC, Bernd Kuhls
Details
picture of kicker/kcontrol with not working timezone settings (20.79 KB, image/png)
2005-11-21 16:04 UTC, Bernd Kuhls
Details
kcontrol 3.4.2 with working timezones and correct on Solaris (45.24 KB, image/png)
2005-11-21 16:31 UTC, Bernd Kuhls
Details
kcontrol 3.4.2 with working timezones and correct time on Solaris (45.24 KB, image/png)
2005-11-21 16:31 UTC, Bernd Kuhls
Details
kcontrol 3.4.2 with working timezones and correct time on Solaris (45.24 KB, image/png)
2005-11-21 16:32 UTC, Bernd Kuhls
Details
Solaris patch for ktimezones.cpp (1.63 KB, patch)
2005-11-23 05:56 UTC, Stefan Teleman
Details
New Solaris patch for ktimezones.cpp (1.82 KB, patch)
2005-11-23 19:00 UTC, Bernd Kuhls
Details
Merged/complete patch for kdelibs-3.5.3 on Solaris 8 (5.39 KB, patch)
2006-06-01 20:05 UTC, Bernd Kuhls
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Evans 2005-10-20 17:57:14 UTC
Version:            (using KDE KDE 3.4.92)
Installed from:    Compiled From Sources
Compiler:          gcc 3.4.3 
OS:                Solaris

if /bin/bash ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I../..  -I/opt/kde/include -I/opt/qt/include   -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include -DQT_THREAD_SUPPORT -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include  -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DSVR4 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1  -Wno-long-long -Wundef -Wall -W -Wpointer-arith -DNDEBUG -DNO_DEBUG -O2 -I/opt/kde/include -I/gorbag/exta/cad/externals/SOLARIS/gnome2/include/glib-2.0 -I/gorbag/exta/cad/externals/SOLARIS/include -I/opt/qt/include -O2 -fomit-frame-pointer -DNeedVarargsPrototypes=1 -DNeedFunctionPrototypes=1 -pipe -fno-exceptions -mcpu=ultrasparc -Wno-non-virtual-dtor -fno-exceptions -fno-check-new -fno-common -DQT_CLEAN_NAMESPACE -DQT_NO_ASCII_CAST -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -D_GNU_SOURCE  -MT tzone.lo -MD -MP -MF ".deps/tzone.Tpo" -c -o tzone.lo tzone.cpp; \
then mv -f ".deps/tzone.Tpo" ".deps/tzone.Plo"; else rm -f ".deps/tzone.Tpo"; exit 1; fi
tzone.cpp: In member function `void Tzone::save()':
tzone.cpp:100: error: `INITFILE' undeclared (first use this function)
tzone.cpp:100: error: (Each undeclared identifier is reported only once for each function it appears in.)


I can find no definition of INITFILE in the system header files.
Comment 1 Bernd Kuhls 2005-10-29 23:36:05 UTC
Confirmed, gcc-3.3.5, Solaris 9/Sparc
Comment 2 Bernd Kuhls 2005-11-11 21:57:13 UTC
Still present in kdebase-479556 (svn snapshot as of 2005/11/11)
Comment 3 Bernd Kuhls 2005-11-11 22:02:05 UTC
Changing line 94 to

#if defined(USE_SOLARIS1)       // MARCO

and therefore deactivating the new code lets tzone.cpp compile,
don´t know if the code works though.
Comment 4 Steve Evans 2005-11-15 15:29:33 UTC
It will compile if the non Solaris code is used, but it won't do anything, because it does things to the files /etc/timezone, /usr/share/zoneinfo/* and /etc/localtime, none of which exist.
Comment 5 Bernd Kuhls 2005-11-17 14:27:07 UTC
Not fixed yet in kdebase-480851
Comment 6 Bernd Kuhls 2005-11-18 16:14:39 UTC
According to
http://websvn.kde.org/trunk/KDE/kdebase/kcontrol/clock/tzone.cpp?rev=432367&r1=431577&r2=432367

#define INITFILE        "/etc/default/init"

so

--- ./tzone.cpp       2005-11-18 11:48:30.740097000 +0100
+++ ./tzone.cpp 2005-11-18 13:58:09.100142000 +0100
@@ -97,7 +97,7 @@
         tf.setAutoDelete( true );
         QTextStream *ts = tf.textStream();

-        QFile fTimezoneFile(INITFILE);
+        QFile fTimezoneFile("/etc/default/init");
         bool updatedFile = false;

         if (tf.status() == 0 && fTimezoneFile.open(IO_ReadOnly))

Code compiles but the time displayed in kicker bar is wrong.

$ date
Fri Nov 18 16:14:26 CET 2005

Kicker displayes one hour less.

$ cat /etc/default/init
TZ=Europe/Berlin
CMASK=022
LC_COLLATE=de_DE.ISO8859-1
LC_CTYPE=de_DE.ISO8859-1
LC_MESSAGES=de
LC_MONETARY=de_DE.ISO8859-1
LC_NUMERIC=de_DE.ISO8859-1
LC_TIME=de_DE.ISO8859-1
Comment 7 Bernd Kuhls 2005-11-18 18:38:41 UTC
Please solve this bug, its a blocker for Solaris.
Comment 8 Thiago Macieira 2005-11-19 03:48:13 UTC
Raising severity.
Comment 9 Bernd Kuhls 2005-11-20 00:32:26 UTC
Stefan Teleman wrote:
"the current implementation erases the existing /etc/default/init file and 
creates a new file of size 0 (when using Administrator mode). this is a 
no-no, since this is a system file.

ill have a fix for this tomorrow evening at the latest.

--Stefan"
Comment 10 Stefan Teleman 2005-11-20 02:47:21 UTC
Created attachment 13562 [details]
here's a proposed patch (tested on Solaris 10)

here's a proposed patch (tested on Solaris 10). please let me know (stefan
<dot> teleman <at> gmail <dot> com.

--Stefan
Comment 11 Stefan Teleman 2005-11-20 02:55:49 UTC
Created attachment 13563 [details]
pls ignore the previous patch -- here's the correct one -- sorry

i messed up my diff directory ... :-(
Comment 12 Bernd Kuhls 2005-11-21 16:04:14 UTC
Created attachment 13579 [details]
picture of kicker/kcontrol with working timezone settings
Comment 13 Bernd Kuhls 2005-11-21 16:04:43 UTC
Created attachment 13580 [details]
picture of kicker/kcontrol with not working timezone settings
Comment 14 Bernd Kuhls 2005-11-21 16:09:21 UTC
I applied and compiled the patch and the code compiled without problems.
But the time displayed in Kicker is still wrong.
I attached two screenshots, the first
"picture of kicker/kcontrol with working timezone settings"
was made on Gentoo Linux x86 with KDE 3.5 RC1, you can see that
kcontrol and kicker display the same time and lots of cities are
displayed for choosing the timezone.

The second screenshot
"picture of kicker/kcontrol with not working timezone settings"
was done on Solaris 9/Sparc, you can see that kcontrol displayes
the correct time as shown by the date command, but kicker gets
it wrong. Also only UTC can be chosen as timezone, no other choices.
Comment 15 Bernd Kuhls 2005-11-21 16:31:50 UTC
Created attachment 13581 [details]
kcontrol 3.4.2 with working timezones and correct on Solaris
Comment 16 Bernd Kuhls 2005-11-21 16:31:58 UTC
Created attachment 13582 [details]
kcontrol 3.4.2 with working timezones and correct time on Solaris
Comment 17 Bernd Kuhls 2005-11-21 16:32:11 UTC
Created attachment 13583 [details]
kcontrol 3.4.2 with working timezones and correct time on Solaris
Comment 18 Bernd Kuhls 2005-11-21 16:35:03 UTC
Attached a screenshot of kcontrol from KDE 3.4.2 on Solaris 9/Sparc:
"kcontrol 3.4.2 with working timezones and correct time on Solaris"
It was made on the same machine as the other screenshots.
You can see that all timezones are present there and the time displayed
in kicker is also correct on KDE 3.4.2.
Comment 19 Stefan Teleman 2005-11-23 02:46:30 UTC
i think all these 3 screenshots are identical. i don't see any difference.
Comment 20 Stefan Teleman 2005-11-23 02:50:05 UTC
so there is another, different bug, this time in kicker's clock applet: it doesn't read any timezones, consequently it cannot change the timezone to whatever kcontrol tells it to.

i will have a look at this one too.

Comment 21 Stefan Teleman 2005-11-23 02:53:20 UTC
ok now i see all the screenshots. :-)

and there is a third bug: the new KTimezone widget does not work correctly (you only get to see UTC) in the Control Center.

i will look at this too.

so there are a total of three bugs in this report, not just one.


Comment 22 Stefan Teleman 2005-11-23 05:56:53 UTC
Created attachment 13607 [details]
Solaris patch for ktimezones.cpp

Here's a patch for ktimezones.cpp (in kdelibs-3.5.0/kdecore) based on
kde-3.5.0-rc1.

Would you be so kind and test it on S8/S9. i have tested it on S10.

On Solaris, the zone.tab file is actually in ${TZDIR}/tab/zone_sun.tab.

I will look next at the kicker clock applet.

Thank you very much.

--Stefan
Comment 23 Bernd Kuhls 2005-11-23 19:00:04 UTC
Shouldn´t the third "#endif" not be a "#else"?

+#if defined(SOLARIS) || defined(USE_SOLARIS)
+            f.setName(m_zoneinfoDir + "/tab/zone_sun.tab");
+#else                                                      <--- change this
             f.setName(m_zoneinfoDir + "/zone.tab");
+#endif

Instead of hard-coding the path of the zoneinfo:

m_zoneinfoDir = "/usr/share/lib/zoneinfo"

we can use /usr/include/tzfile.h.
Comment 24 Bernd Kuhls 2005-11-23 19:00:51 UTC
Created attachment 13614 [details]
New Solaris patch for ktimezones.cpp
Comment 25 Bernd Kuhls 2005-11-23 19:03:33 UTC
Attached you will find a working patch based on Stefans patch, with this patch
kcontrol displayes all timezones and shows the local timezone correctly.

Also this patch solved the wrong time displayed in kicker clock applet,
all timezones can also be chosen now in kicker clock applet.

So the bugs I mentioned with the attached pictures are all solved here now.
But I guess its too late to included the patches in KDE 3.5, right?
Comment 26 Bernd Kuhls 2006-04-07 18:44:43 UTC
This patch is not included in KDE-3.5.2.
Also "New Solaris patch for ktimezones.cpp" is not enough for Solaris 2.8
because this OS does not have the file /usr/share/lib/zoneinfo/tab/zone_sub.tab

This additional patch is reported to work for Solaris 2.8
http://lists.kde.org/?l=kde-core-devel&m=113313144700395&w=2
Comment 27 Bernd Kuhls 2006-04-07 18:46:40 UTC
"This additional patch is reported to work"
I can confirm it works on Solaris 2.8/Sparc
Comment 28 Christopher Layne 2006-04-30 09:51:52 UTC
Bernd,

I will verify this patch on my Solaris 2.8 (x86) machine.

As a workaround a bit ago, I had actually just downloaded the opensolaris zone tab and hacked that into place on my 2.8 box to make things work. Having constant GMT was very annoying.
Comment 29 Bernd Kuhls 2006-06-01 20:05:02 UTC
Created attachment 16407 [details]
Merged/complete patch for kdelibs-3.5.3 on Solaris 8
Comment 30 Bernd Kuhls 2006-07-31 17:18:01 UTC
According to
http://lists.kde.org/?l=kde-solaris&m=115269249808107&w=2
the patch
http://bugs.kde.org/attachment.cgi?id=16407&action=view
works, please include in SVN
Comment 31 Bernd Kuhls 2006-10-17 17:29:28 UTC
Patch still works for KDE-3.5.5, its a pitty that it was not committed;-) 
Comment 32 Bernd Kuhls 2007-03-22 16:24:31 UTC
Patch still works for KDE-3.5.6, its a pitty that it was not committed;-) 
Comment 33 Bernd Kuhls 2007-05-24 13:05:21 UTC
Patch still works for KDE-3.5.7, its a pitty that it was not committed;-)
Comment 34 Bernd Kuhls 2007-10-23 10:45:23 UTC
Patch still works for KDE-3.5.8, its a pitty that it was not committed;-)
Comment 35 FiNeX 2008-11-11 20:35:35 UTC
Has this issue been solved in KDE 3.5.10?
Comment 36 FiNeX 2008-12-30 14:14:19 UTC
kicker/kcontrol seems no more mantained for KDE 3. If nobody has applied the patch on KDE3.5, probably it is a wontfix.

Anyway i strongly suggest to test and commit this patch to KDE 3.5. 
Comment 37 groot 2010-06-22 19:41:41 UTC
Solaris 8 considered EOL.