Merge lp://staging/~ted/unity8/no-home-applications into lp://staging/unity8

Proposed by Ted Gould
Status: Work in progress
Proposed branch: lp://staging/~ted/unity8/no-home-applications
Merge into: lp://staging/unity8
Prerequisite: lp://staging/~ted/unity8/username-from-uid
Diff against target: 86 lines (+21/-6)
7 files modified
data/unity8-filewatcher.conf (+3/-4)
debian/control (+2/-1)
debian/rules (+1/-1)
debian/unity8.click-hook (+4/-0)
debian/unity8.install (+1/-0)
tools/CMakeLists.txt (+2/-0)
tools/unity8-launcher-refresh (+8/-0)
To merge this branch: bzr merge lp://staging/~ted/unity8/no-home-applications
Reviewer Review Type Date Requested Status
Michael Terry Needs Information
Unity8 CI Bot continuous-integration Needs Fixing
Review via email: mp+291305@code.staging.launchpad.net

Commit message

Use a Click hook instead of a file watch to detect installed applications

Description of the change

Currently a file watch is being used, which has a hard coded home directory in it. We can avoid that hard coded directory and the file watch by using a Click hook to send the signal. Abstracted the signal into a shell script so that both can call the same script.

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2329
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1023/
Executed test runs:
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/580
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial,testname=qmluitests.sh/580
    FAILURE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=phone-armhf,release=vivid+overlay,testname=autopilot.sh/580/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1371
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1341
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/1341
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1341
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial/1341/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1341
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1341/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/1023/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

I like this, but a couple comments:

- The old code looked in ~/.local/share/applications, but this now looks just in .cache/unity8/click-desktops. (A) I don't have that directory on my phone, who makes that? and (B) the old location covered more than just clicks. Though I guess that would be sufficient for the Touch use case.

- The script's dbus check could more nicely look like:

set -a

if [ -z "$DBUS_SESSION_BUS_ADDRESS" -a -n "$XDG_RUNTIME_DIR" ] ; then
 . "$XDG_RUNTIME_DIR/dbus-session"
fi

review: Needs Information
Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2016-04-26 at 12:10 +0000, Michael Terry wrote:
> - The old code looked in ~/.local/share/applications, but this now
> looks just in .cache/unity8/click-desktops.
To be clear, it doesn't "look in", it gets called when that directory
is updated. The actual existence of the directory isn't important to
this. So the person calling it is click itself, there is no file watch.
> (A) I don't have that directory on my phone, who makes that? and
Click will make the directory when the hook runs. If you build a deb
and install it on your device you'll have to log in and out to make it
appear. But for anyone updating with images it should be when the
update.
> (B) the old location covered more than just clicks. Though I guess
> that would be sufficient for the Touch use case.
Yes, that's what I was targeting, but if there are use-cases for the
home directory we can talk about it.
> - The script's dbus check could more nicely look like:
>
> set -a
>
> if [ -z "$DBUS_SESSION_BUS_ADDRESS" -a -n "$XDG_RUNTIME_DIR" ] ; then
> . "$XDG_RUNTIME_DIR/dbus-session"
> fi
>

I'm not sure if the click user hooks always end up with XDG_RUNTIME_DIR
set. They're basically run through Python code that changes user in
cases of sideloading. It seems if XDG_RUNTIME_DIR is set, it is likely
that the dbus variables are set.

Revision history for this message
Michael Terry (mterry) wrote :

>> (A) I don't have that directory on my phone, who makes that? and
> Click will make the directory when the hook runs. If you build a deb
> and install it on your device you'll have to log in and out to make it
> appear. But for anyone updating with images it should be when the
> update.

Does the directory not stay around? I was testing on a phone with installed clicks and that directory didn't exist.

Or are you saying that the click makes the directory, puts a desktop file in it, runs this hook, then deletes the directory?

Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in data/unity8-filewatcher.conf
1 conflicts encountered.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Conflict not merged for over a month, putting back to Work In Progress to clear the queue

Unmerged revisions

2329. By Ted Gould

Update to trunk and g_get_user_name()

2328. By Ted Gould

Handle not having the session bus environment variable set

2327. By Ted Gould

Grabbing syscall branch

2326. By Ted Gould

Remove dependence on a specific home directory by using a click hook for refresh

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches