[gobolinux-users] KDE: Create new.... symlink???

Michael Homer gobo-users-dufus at wotfun.com
Tue Sep 11 23:04:51 UTC 2007


On 9/12/07, Michael Dickson <mike at communicatezing.com> wrote:
> On Monday 10 September 2007 4:30:51 am Michael Homer wrote:
> > On 9/10/07, Jonas Karlsson <jonka750 at student.liu.se> wrote:
> > > On Mon, 10 Sep 2007 06:29:39 +0200, Michael Homer
> <gobo-users-dufus at wotfun.com> wrote:
> > > > On 9/8/07, Michael Dickson <mike at communicatezing.com> wrote:
> > > >> On Friday 07 September 2007 3:48:43 am Jonas Karlsson wrote:
> > > >> > 2007/9/7, kenneth marken <k-marken at online.no>:
> > > >> > > On Friday 07 September 2007 08:35:55 Michael Homer wrote:
> > > >> > > > On 9/7/07, Andy Feldman <nereusren at gmail.com> wrote:
> > > >> > > > > On Thursday 06 September 2007 18:43, Michael Homer wrote:
> > > >> > > > > > On 9/7/07, Michael Dickson <mike at communicatezing.com> wrote:
> > > >> > > > > > > I just noticed that when I right-click on the Desktop and
> > > >> > > > > > > choose Create New -> "..."
> > > >> > > > > > > the resulting file is a symlink, not the real file!
> > > >> > > > > >
> > > >> > > > > > What's the "..." here? Where does the symlink point? I can't
> > > >> > > > > > duplicate this here.
> > > >> > > > >
> > > >> > > > > I get the same thing. If I right-click in Konqueror file
> > > >> > > > > browser and choose "Create New" > "Text File...", it creates a
> > > >> > > > > symlink to
> > > >> > > > > /Programs/KDE-Base/3.5.3/Shared/templates/.source/TextFile.txt
> > > >> > > > >. Similarly with all the other file types that appear in that
> > > >> > > > > section of the "Create New" submenu. It's not restricted to
> > > >> > > > > the entries from KDE-Base: Creating a new office text document
> > > >> > > > > makes a link to
> > > >> > > > > /Programs/KOffice/1.6.1/Shared/templates/.source/TextDocument.
> > > >> > > > >kwt.
> > > >> > > >
> > > >> > > > It doesn't for me for any of them (ls -l confirms it), and so
> > > >> > > > far as I can tell I have basically the same setup as the
> > > >> > > > original poster, although there are a couple of KDE components
> > > >> > > > that are still at 3.5.6 (-Network is one, I don't remember the
> > > >> > > > other). So I can't explain what's going on for everybody else...
> > > >> > >
> > > >> > > wild guess, when kde does a "create new" what it does its copy a
> > > >> > > existing file into place under a new name. or atleast thats how it
> > > >> > > looks. so can it be that it ends up copying the symbolic links
> > > >> > > that gobo use rather then the files in question?
> > > >> > >
> > > >> > > hmm, only thing i know i have done is to recompile kde-base so as
> > > >> > > to get smb support. outside of that im using binary packages as
> > > >> > > much as possible.
> > > >> >
> > > >> > I think the difference in setup is that those that get the symlink
> > > >> > has other templates installed, which would make SymlinkProgram
> > > >> > expand every directory and make the files links, instead of how
> > > >> > Michael (and I) have it where the link is
> > > >> > /System/Links/Shared/templates ->
> > > >> > /Programs/KDE-Base/3.5.6/Shared/templates and
> > > >> > /System/Links/Shared/templates/.source/foo is a real document.
> > > >> >
> > > >> > Konqueror should read the link, so this should be reported as a bug
> > > >> > upstream.
> > > >>
> > > >> Nice catch Jonas.  That does work.  Of course, this prevents any
> > > >> KOffice items from showing up...
> > > >>
> > > >> Natually, using hard links to the individual files (with the exception
> > > >> of emptydir) in .source works fine.
> > > >>
> > > >> I've opened KDE Bug #149628 on this issue, referencing this thread.
> > > >
> > > > I have attached a patch to this bug that seems to fix the problem,
> > > > hopefully it will be applied. I have attached one suitable for
> > > > dropping in the Recipe directory for KDE-Base to this message. Give it
> > > > a try. If it works for everybody else I'll check in a new revision
> > > > tomorrow.
> > >
> > > Great! I was looking at doing a patch almost exactly like this. However
> > > I would have put the readlink code addition a bit higher up, in the
> > > parseFile function just when the file is recognized as an old-style
> > > template. After, or maybe replacing some of the code:
> > >
> > >                      // No dest, this is an old-style template
> > >                      (*templ).entryType = TEMPLATE;
> > >                      (*templ).templatePath = (*templ).filePath; // we'll
> > > copy the file
> > >
> > > to resolve the link when or before the path is copied. I think that when
> > > the readlink code is where you have placed it you will apply it to
> > > unnecessary files, but I really don't know. I haven't done any patches
> > > for KDE before either. :)
> >
> > It almost certainly does apply to unnecessary files (it doesn't even
> > consider whether the destination is remote), but it definitely doesn't
> > miss any it should hit. I don't think it matters much (performance
> > isn't really an issue for this user-level operation), but I might try
> > it tomorrow, or you're welcome to have a crack.
> >
> > If they do still consider it a feature this way, I think we should
> > package the patch with the recipe. It's a pretty important fix for our
> > particular setup, and it's a much better one than hacking
> > SymlinkProgram to special-case /S/L/S/templates/.sources somehow.
>
> It may apply to unnecessary files in Gobo, but I agree with Michael Homer that
> this doesn't matter; I just can't come up with a case where you want to be
> picky.
>
> I'd say that Michael Homer's patch is Good Enough then.  At least for
> Gobolinux.  But that isn't my job.
I have committed KDE-Base 3.5.7-r2 with this patch included. `Compile
KDE-Base` will fix the problem for anybody affected once the recipe
propagates to the store (in the next twelve hours). I have also
uploaded a binary package (or rather, it's uploading now, give it five
minutes) to http://e.geek.nz/files/gobo/KDE-Base--3.5.7--i686.tar.bz2
for those that prefer.
-Michael


More information about the gobolinux-users mailing list