https://bugs.kde.org/show_bug.cgi?id=436437

            Bug ID: 436437
           Summary: plasma-workspace 93f9ef030 broke my autostart scripts
                    -- bad symlink conversion
           Product: plasmashell
           Version: master
          Platform: Other
                OS: Other
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: k...@davidedmundson.co.uk
          Reporter: 1i5t5.dun...@cox.net
                CC: plasma-b...@kde.org
  Target Milestone: 1.0

... and what's worse, reverting to before it didn't fix them again as the
conversion had already broken them.  Thus, despite my finding that commit in
the log relatively quickly and believing it to be the culprit, because
reverting to before it didn't fix things, it took me hours to figure out what
had happened.

There's actually two bugs.  This is the first one.

I'll start with a description of the previous situation:  All the files in
autostart-scripts before the conversion were (differently named) symlinks to
the same bash script file, named autostart-disabler.  That script looks like
this (file delimited by the >>>>/<<<< marks):

>>>>
#!/bin/bash

# following line uncommented: autostart scripts disabled
#exit

# get my (symlink?) basename
me=${0##*/}

# exit if it's not *.sh
[[ $me == *.sh ]] || exit

# trim the .sh
me=${me%.sh}

# set special path
OLDPATH="$PATH"
PATH="$HOME/bin/autostart:$PATH"
# runit
exec $me
<<<<

The idea is that if I'm testing something and want to disable my autostart
scripts, I can disable them all with a quick uncomment of that exit line.  The
script then gets the basename, checks for and strips the .sh extension, adds a
priority path to the autostart subdir within my user bin directory, and
executes the result, normally a shellscript or symlink in that bin/autostart
subdir that invokes the executable I actually want to run.


Of course the converter played havoc with all that, setting the same
autostart-disabler shellscript in all the exec lines of the created *.desktop
files so they'd launch the shellscript directly instead of via the symlinks
that provided the information to the script that it was actually looking for,
that being the name of the symlink formerly used to launch it, so it could
launch the desired executable accordingly.  Of course started directly like
that the name didn't match the *.sh pattern so the script simply exited.  Not
that it could have figured out what to actually start if it didn't exit there.


Now it's arguably not reasonable to expect the converter to figure out all that
and properly convert things, but one /could/ expect it to popup a notice saying
that it had converted the scripts in the autostart-scripts dir and the user
might wish to verify the conversion, so the user would at least have some clue
what happened if the converter wasn't smart enough and something broke, as it
did for me.

And/or it could do some sort of minimal sanity check, like ensuring that if the
files there are symlinks, no two point to the same target, erroring out with a
note to check them and perhaps a link to a page on how to do the conversion
manually if necessary.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to