Merge ~sudipmuk/ubuntu/+source/zeitgeist:merge-lp2044300-noble into ubuntu/+source/zeitgeist:debian/sid

Proposed by Sudip Mukherjee
Status: Merged
Merge reported by: Andreas Hasenack
Merged at revision: ea439386985cadf1bd4590919f3f0b6e9a14914d
Proposed branch: ~sudipmuk/ubuntu/+source/zeitgeist:merge-lp2044300-noble
Merge into: ubuntu/+source/zeitgeist:debian/sid
Diff against target: 316 lines (+256/-1)
6 files modified
debian/changelog (+41/-0)
debian/control (+2/-1)
debian/patches/fix-monitor-test.patch (+43/-0)
debian/patches/nodisplay_autostart.patch (+14/-0)
debian/patches/pre_populator.patch (+153/-0)
debian/patches/series (+3/-0)
Reviewer Review Type Date Requested Status
Simon Quigley (community) Approve
Andreas Hasenack Needs Information
Utkarsh Gupta (community) Needs Information
Canonical Server Reporter Pending
git-ubuntu import Pending
Review via email: mp+456270@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

PPA: https://launchpad.net/~sudipmuk/+archive/ubuntu/zeitgeist-merge/

Test Steps:
1. install gnome-activity-journal in a noble installation.
2. gnome-activity-journal will fail to run.
3. update zeitgeist with this version.
4. Run gnome-activity-journal now and it will execute.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hey there!

Thanks for raising this much, much appreciated. This is great as-is but here are some points that'd make it EVEN better:

- https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=95fd328c45f72fa0f3895900216ad0726e86139e -> it misses the DEP-3 headers. I am aware that you're just rebasing the new version and you're not really adding the patch itself. But whilst at it, if you could really add DEP-3 headers to a patch, that'd be EXCELLENT!

See: https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=a6cff2e5ac675b90cc574a26dc953f452aa9a00c for example. It has the DEP-3 headers and tells me why it's needed, some bug history, et al.

I generally look at it because sometimes we shouldn't really be merging stuff as-is and carry-forwarding the tech-debt but actively be looking at drop the delta wherever and whenever possible.

Now, OTOH, look at https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=e940d9763d0fba97dc8504ed382e01210a43f08d -> it gives me a quick description but doesn't tell me if it's coming from upstream or was it written by downstream, is there an upstream bug? a downstream bug? or? and I spend my time looking at things, et al. That's why DEP-3 headers are really useful.

- https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=2ab99989a22d2e07bfc28e5eae942bd8283c1aa7 -> did you verify if that's still needed? why? :)

So except for the above question and a general pointer (first point), it mostly looks good! :D

review: Needs Information
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Hi Utkarsh,

Thanks for looking into this.

On Sat, 25 Nov 2023 at 17:04, Utkarsh Gupta
<email address hidden> wrote:
>
> Review: Needs Information
>
> Hey there!
>
> Thanks for raising this much, much appreciated. This is great as-is but here are some points that'd make it EVEN better:
>
> - https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=95fd328c45f72fa0f3895900216ad0726e86139e -> it misses the DEP-3 headers. I am aware that you're just rebasing the new version and you're not really adding the patch itself. But whilst at it, if you could really add DEP-3 headers to a patch, that'd be EXCELLENT!

I could not find any bug report which might explain this patch. Seems
to be an Ubuntu specific patch and introduced in
zeitgeist_0.9.14-0ubuntu1.

>
> See: https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=a6cff2e5ac675b90cc574a26dc953f452aa9a00c for example. It has the DEP-3 headers and tells me why it's needed, some bug history, et al.
>
> I generally look at it because sometimes we shouldn't really be merging stuff as-is and carry-forwarding the tech-debt but actively be looking at drop the delta wherever and whenever possible.
>
> Now, OTOH, look at https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=e940d9763d0fba97dc8504ed382e01210a43f08d -> it gives me a quick description but doesn't tell me if it's coming from upstream or was it written by downstream, is there an upstream bug? a downstream bug? or? and I spend my time looking at things, et al. That's why DEP-3 headers are really useful.

This one seems to fix LP: #962265 but I could not find a way to be
sure and so not confident enough to add DEP-3 headers to the patch.
Again, this also was introduced in zeitgeist_0.9.14-0ubuntu1.

>
> - https://git.launchpad.net/~sudipmuk/ubuntu/+source/zeitgeist/commit/?id=2ab99989a22d2e07bfc28e5eae942bd8283c1aa7 -> did you verify if that's still needed? why? :)

Yes, this is still needed. My initial build failed as I did not have
this one disabled. I have done a diff of the buildinfo and saw there
are version mismatch of many packages between Debian and Ubuntu. One
of the mismatch is still causing the issue in Ubuntu, but I don't know
which one yet.

--
Regards
Sudip

Revision history for this message
Simon Chopin (schopin) wrote :

Hi!

Thank you for the contribution, and for following up on Utkarsh's review.

Luckily, the person that did the 0.9.14-0ubuntu1 (ricotz) is still around, so I asked them directly what this was for: https://irclogs.ubuntu.com/2023/11/29/%23ubuntu-devel.html#t14:12

TL;DR: we're not sure why the patch exists, and it's likely it's not needed anymore.

Would you be willing to test a version with that patch dropped?

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

Hi Simon,

On Wed, 29 Nov 2023 at 18:37, Simon Chopin <email address hidden> wrote:
>
> Hi!
>
> Thank you for the contribution, and for following up on Utkarsh's review.
>
> Luckily, the person that did the 0.9.14-0ubuntu1 (ricotz) is still around, so I asked them directly what this was for: https://irclogs.ubuntu.com/2023/11/29/%23ubuntu-devel.html#t14:12

Thanks for following up with Rico.

>
> TL;DR: we're not sure why the patch exists, and it's likely it's not needed anymore.
>
> Would you be willing to test a version with that patch dropped?

I have dropped the patch "add_datahub_autostart_delay.patch" and
tested on a Noble installation and did not notice any problem.
And so the branch is now updated and also pushed to new PPA at
https://launchpad.net/~sudipmuk/+archive/ubuntu/zeitgeist-merge-1/

--
Regards
Sudip

Revision history for this message
Graham Inggs (ginggs) wrote :

Please mention the dropped patch in the changelog and the reason (outside of Remaining Changes), something like:

  * Dropped add_datahub_autostart_delay.patch, no longer required

or

  * Dropped changes:
    - add_datahub_autostart_delay.patch, no longer required

9f3e8e5... by Sudip Mukherjee

d/p/nodisplay_autostart.patch: Don't show in Startup Applications

Signed-off-by: Sudip Mukherjee <email address hidden>

2fba154... by Sudip Mukherjee

d/p/pre_populator.patch: Pre-populate the log with some events

Signed-off-by: Sudip Mukherjee <email address hidden>

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

> Please mention the dropped patch in the changelog and the reason (outside of
> Remaining Changes), something like:
>
> * Dropped add_datahub_autostart_delay.patch, no longer required
>
> or
>
> * Dropped changes:
> - add_datahub_autostart_delay.patch, no longer required

sorry, missed that. I have now re-done the changes as the git commit to drop the patch was also missing.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Tags ok, thanks for pushing those!

First pass:

$ git range-diff sudipmuk/old/debian..sudipmuk/logical/1.0.3-4ubuntu1 sudipmuk/new/debian..merge-lp2044300-noble
 1: f024545 = 1: b4d8957 d/p/add_datahub_autostart_delay.patch: Delay datahub autostart
 2: 77a362f = 2: 4b3347e d/p/nodisplay_autostart.patch: Don't show in Startup Applications
 3: a30b8dd ! 3: ca050ff d/p/pre_populator.patch: Pre-populate the log with some events
    @@ debian/patches/pre_populator.patch (new)
     +Description: Pre-populate the log with some events so that the dash isn't empty on first run.
     +
     +=== modified file 'src/Makefile.am'
    ++Bug-Ubuntu: https://launchpad.net/bugs/962265
    ++Forwarded: not-needed
     +---
     + datahub/Makefile.am | 1
     + datahub/pre-populator.vala | 117 +++++++++++++++++++++++++++++++++++++++++
 -: ------- > 4: 209e96a Drop d/p/add_datahub_autostart_delay.patch: no longer required
 -: ------- > 5: 66af12c Modify skip-failing-tests.patch: skip the test that still fails in Ubuntu as in the previous version
 -: ------- > 6: 23099ff merge-changelogs
 -: ------- > 7: 1fcd0ed reconstruct-changelog
 -: ------- > 8: c71981c update-maintainer
 -: ------- > 9: f2c0fec changelog

a) I see you added a bit of dep3 headers to d/p/pre_populator.patch

b) 209e96a (drop add_datahub_autostart_delay) is almost a revert of b4d8957 (add datahub_autostart_delay), but had to also touch nodisplay_autostart.patch because of context. In general, when dropping patches, you can just not apply it when rebasing on top of new/debian. No need to apply and then revert. Then in the range-diff output we would clearly see that one commit was dropped, and another one was added to nodisplay_autostart.patch to adjust for the changed context.

c) 66af12c Modify skip-failing-tests.patch: skip the test that still fails in Ubuntu as in the previous version

That is an "added change". It's delta we didn't have before, and that you are adding now. We like to call out to these in the changelog with a "Added changes" entry, like below:

  * Merge with Debian unstable. Remaining changes: (LP: #2044300)
    - Add nodisplay_autostart.patch: Don't show in Startup Applications
    - Add pre_populator.patch: Pre-populate the log with some events
      so that the Unity dash isn't empty on first run.
  * Added changes:
    - Modify skip-failing-tests.patch: skip the test that still fails
      in Ubuntu as in the previous version.
  * Dropped changes:
    - add_datahub_autostart_delay.patch, no longer required.

In the next merge, the "added changes" can be part of the "remaining changes", if it still makes sense to keep.

That being said, are you saying that in ubuntu we need to skip more tests than in debian? What is the reason again, different package versions? We like to know why, so that it's easier to re-evaluate the patch in the future, and see if we can stop disabling tests.

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

Do we know if d/p/pre_populator.patch is still necessary? The linked bug is about unity, and we don't ship than anymore for quite some time.

review: Needs Information
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :
Download full text (4.3 KiB)

Hi Andreas,

Thanks for looking into this.

On Fri, 8 Dec 2023 at 21:41, Andreas Hasenack
<email address hidden> wrote:
>
> Tags ok, thanks for pushing those!
>
> First pass:
>
>
> $ git range-diff sudipmuk/old/debian..sudipmuk/logical/1.0.3-4ubuntu1 sudipmuk/new/debian..merge-lp2044300-noble
> 1: f024545 = 1: b4d8957 d/p/add_datahub_autostart_delay.patch: Delay datahub autostart
> 2: 77a362f = 2: 4b3347e d/p/nodisplay_autostart.patch: Don't show in Startup Applications
> 3: a30b8dd ! 3: ca050ff d/p/pre_populator.patch: Pre-populate the log with some events
> @@ debian/patches/pre_populator.patch (new)
> +Description: Pre-populate the log with some events so that the dash isn't empty on first run.
> +
> +=== modified file 'src/Makefile.am'
> ++Bug-Ubuntu: https://launchpad.net/bugs/962265
> ++Forwarded: not-needed
> +---
> + datahub/Makefile.am | 1
> + datahub/pre-populator.vala | 117 +++++++++++++++++++++++++++++++++++++++++
> -: ------- > 4: 209e96a Drop d/p/add_datahub_autostart_delay.patch: no longer required
> -: ------- > 5: 66af12c Modify skip-failing-tests.patch: skip the test that still fails in Ubuntu as in the previous version
> -: ------- > 6: 23099ff merge-changelogs
> -: ------- > 7: 1fcd0ed reconstruct-changelog
> -: ------- > 8: c71981c update-maintainer
> -: ------- > 9: f2c0fec changelog
>
> a) I see you added a bit of dep3 headers to d/p/pre_populator.patch

Yes, Utkarsh asked me to add the dep3 headers, and that bug seems to
the reason of the patch but tbh, I am not entirely sure as there is no
other information in the patch or changelog.

>
> b) 209e96a (drop add_datahub_autostart_delay) is almost a revert of b4d8957 (add datahub_autostart_delay), but had to also touch nodisplay_autostart.patch because of context. In general, when dropping patches, you can just not apply it when rebasing on top of new/debian. No need to apply and then revert. Then in the range-diff output we would clearly see that one commit was dropped, and another one was added to nodisplay_autostart.patch to adjust for the changed context.

Yes, that's what I did initially. But if you see
https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageMerging.md#split-commits
the step mentioned splitting the old changes in logincal changes. And
https://github.com/canonical/ubuntu-maintainers-handbook/blob/main/PackageMerging.md#purpose-of-logical-tag
explains why the logincal change has been done. To quote that "The
logical tag is the cleanest possible representation of a previous
Ubuntu delta". And, so when I rebase those logical changes on top of
new/debian those commits will be added. So, unless I modify the commit
while adding the logical changes, I think there is no other way to
drop the patch. And modifying while making the logical change means I
am not splitting the old delta properly. But please correct me if I am
wrong.

>
> c) 66af12c Modify skip-failing-tests.patch: skip the test that still fails in Ubuntu as in the previous version
>
> That is an "added change". It's delta we didn't have before, and that you are adding now. We...

Read more...

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

On Fri, 8 Dec 2023 at 21:42, Andreas Hasenack
<email address hidden> wrote:
>
> Review: Needs Information
>
> Do we know if d/p/pre_populator.patch is still necessary? The linked bug is about unity, and we don't ship than anymore for quite some time.

Please correct me if I'm wrong but I think Unity is now renamed as
Lomiri which is still being used by UBports,

--
Regards
Sudip

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

> So, unless I modify the commit while adding the logical changes,

That's what I meant. You keep the logical tag intact, it still represents the clean delta, but when applying it on top of new/debian, then you can do whatever you want. And here is where you would drop a change that was adopted by debian, for example.

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

On Mon, 11 Dec 2023 at 13:08, Andreas Hasenack
<email address hidden> wrote:
>
> > So, unless I modify the commit while adding the logical changes,
>
> That's what I meant. You keep the logical tag intact, it still represents the clean delta, but when applying it on top of new/debian, then you can do whatever you want. And here is where you would drop a change that was adopted by debian, for example.

Right, Sorry I was confused before. I have now pushed again and
hopefully I have done the right thing this time.

--
Regards
Sudip

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

> Tags ok, thanks for pushing those!
>

<snip>
.
>
> That being said, are you saying that in ubuntu we need to skip more tests than
> in debian? What is the reason again, different package versions? We like to
> know why, so that it's easier to re-evaluate the patch in the future, and see
> if we can stop disabling tests.

I am blocked here. Now commented on the upstream issue at https://gitlab.freedesktop.org/zeitgeist/zeitgeist/-/issues/4.

b62e3b1... by Sudip Mukherjee

d/p/fix-monitor-test.patch: do not link with libzeitgeist-datamodel

Signed-off-by: Sudip Mukherjee <email address hidden>

933342c... by Sudip Mukherjee

merge-changelogs

02ccd0e... by Sudip Mukherjee

reconstruct-changelog

663dfe7... by Sudip Mukherjee

update-maintainer

ea43938... by Sudip Mukherjee

changelog

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote (last edit ):

Pushed new changes. A new patch which will fix the test in Ubuntu. Also forwrded the patch in an unstream issue.
Buildlog is at https://launchpadlibrarian.net/705607547/buildlog_ubuntu-noble-amd64.zeitgeist_1.0.4-5ubuntu1_BUILDING.txt.gz

Revision history for this message
Aaron Rainbolt (arraybolt3) wrote :

Latest iteration looks good to me, with the minor exception of the DEP-3 header on /debian/patches/pre_populator.patch. tsimonq2 is uploading with the header fixed.

Revision history for this message
Simon Quigley (tsimonq2) :
review: Approve
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was uploaded and is in noble already, marking the MP as merged.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 965789a..358f22b 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,17 @@
6+zeitgeist (1.0.4-5ubuntu1) noble; urgency=low
7+
8+ * Merge with Debian unstable. Remaining changes: (LP: #2044300)
9+ - Add nodisplay_autostart.patch: Don't show in Startup Applications
10+ - Add pre_populator.patch: Pre-populate the log with some events
11+ so that the Unity dash isn't empty on first run.
12+ * Added changes:
13+ - Add fix-monitor-test.patch: monitor test is failing in Ubuntu if it
14+ is linked with libzeitgeist-datamodel.
15+ * Dropped changes:
16+ - add_datahub_autostart_delay.patch, no longer required.
17+
18+ -- Sudip Mukherjee <sudipm.mukherjee@gmail.com> Mon, 25 Dec 2023 17:37:52 +0000
19+
20 zeitgeist (1.0.4-5) unstable; urgency=medium
21
22 * fix source helper tool copyright-check
23@@ -125,6 +139,17 @@ zeitgeist (1.0.3-5) unstable; urgency=medium
24
25 -- Jelmer Vernooij <jelmer@debian.org> Tue, 24 Aug 2021 20:22:44 +0100
26
27+zeitgeist (1.0.3-4ubuntu1) hirsute; urgency=low
28+
29+ [ Ubuntu Merge-o-Matic ]
30+ * Merge from Debian unstable. Remaining changes:
31+ - Add add_datahub_autostart_delay.patch: Don't start for a little while
32+ - Add nodisplay_autostart.patch: Don't show in Startup Applications
33+ - Add pre_populator.patch: Pre-populate the log with some events
34+ so that the Unity dash isn't empty on first run.
35+
36+ -- Brian Murray <brian@ubuntu.com> Fri, 02 Apr 2021 10:19:47 -0700
37+
38 zeitgeist (1.0.3-4) unstable; urgency=medium
39
40 * QA upload.
41@@ -159,6 +184,22 @@ zeitgeist (1.0.3-1) unstable; urgency=medium
42
43 -- Boyuan Yang <byang@debian.org> Thu, 31 Dec 2020 15:04:29 -0500
44
45+zeitgeist (1.0.2-3ubuntu2) focal; urgency=medium
46+
47+ * No-change rebuild for libgcc-s1 package name change.
48+
49+ -- Matthias Klose <doko@ubuntu.com> Sun, 22 Mar 2020 17:04:32 +0100
50+
51+zeitgeist (1.0.2-3ubuntu1) focal; urgency=medium
52+
53+ * Resynchronize with Debian. Remaining changes:
54+ - Add add_datahub_autostart_delay.patch: Don't start for a little while
55+ - Add nodisplay_autostart.patch: Don't show in Startup Applications
56+ - Add pre_populator.patch: Pre-populate the log with some events
57+ so that the Unity dash isn't empty on first run.
58+
59+ -- Rico Tzschichholz <ricotz@ubuntu.com> Tue, 28 Jan 2020 14:51:17 +0100
60+
61 zeitgeist (1.0.2-3) unstable; urgency=high
62
63 * QA upload.
64diff --git a/debian/control b/debian/control
65index 8faff93..b541fbc 100644
66--- a/debian/control
67+++ b/debian/control
68@@ -1,7 +1,8 @@
69 Source: zeitgeist
70 Section: utils
71 Priority: optional
72-Maintainer: Debian semweb Team <team+semweb@tracker.debian.org>
73+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
74+XSBC-Original-Maintainer: Debian semweb Team <team+semweb@tracker.debian.org>
75 Uploaders:
76 Jonas Smedegaard <dr@jones.dk>,
77 Build-Depends:
78diff --git a/debian/patches/fix-monitor-test.patch b/debian/patches/fix-monitor-test.patch
79new file mode 100644
80index 0000000..8230082
81--- /dev/null
82+++ b/debian/patches/fix-monitor-test.patch
83@@ -0,0 +1,43 @@
84+Description: do not link with libzeitgeist-datamodel
85+Forwarded: https://gitlab.freedesktop.org/zeitgeist/zeitgeist/-/issues/27
86+Last-Update: 2023-12-25
87+---
88+
89+diff --git a/test/c/Makefile.am b/test/c/Makefile.am
90+index 9a840c2b..46612eb3 100644
91+--- a/test/c/Makefile.am
92++++ b/test/c/Makefile.am
93+@@ -21,6 +21,12 @@ AM_LDFLAGS = \
94+ $(ZEITGEIST_LIBS) \
95+ $(NULL)
96+
97++test_monitor_LDFLAGS = \
98++ $(top_builddir)/libzeitgeist/libzeitgeist-2.0.la \
99++ $(GIO_UNIX_LIBS) \
100++ $(ZEITGEIST_LIBS) \
101++ $(NULL)
102++
103+ check_PROGRAMS = \
104+ test-timerange \
105+ test-timestamp \
106+diff --git a/test/direct/Makefile.am b/test/direct/Makefile.am
107+index 56061c28..780c5acd 100644
108+--- a/test/direct/Makefile.am
109++++ b/test/direct/Makefile.am
110+@@ -43,6 +43,13 @@ AM_LDFLAGS = \
111+ $(top_builddir)/src/libzeitgeist-engine.la \
112+ $(NULL)
113+
114++monitor_test_LDFLAGS = \
115++ -export-dynamic -no-undefined \
116++ $(top_builddir)/libzeitgeist/libzeitgeist-2.0.la \
117++ $(top_builddir)/libzeitgeist/libzeitgeist-internal.la \
118++ $(top_builddir)/src/libzeitgeist-engine.la \
119++ $(NULL)
120++
121+ check_PROGRAMS = \
122+ datamodel-test \
123+ datasource-test \
124+--
125+2.39.2
126+
127diff --git a/debian/patches/nodisplay_autostart.patch b/debian/patches/nodisplay_autostart.patch
128new file mode 100644
129index 0000000..145a2a3
130--- /dev/null
131+++ b/debian/patches/nodisplay_autostart.patch
132@@ -0,0 +1,14 @@
133+Description: Clean up Startup Applications dialog by hiding default apps
134+Author: Michael Terry <michael.terry@canonical.com>
135+Bug-Ubuntu: https://launchpad.net/bugs/803917
136+Forwarded: not-needed
137+---
138+ data/zeitgeist-datahub.desktop.in | 1 +
139+ 1 file changed, 1 insertion(+)
140+
141+--- a/data/zeitgeist-datahub.desktop.in
142++++ b/data/zeitgeist-datahub.desktop.in
143+@@ -5,2 +5,3 @@ Exec=zeitgeist-datahub
144+ Terminal=false
145+ Type=Application
146++NoDisplay=true
147diff --git a/debian/patches/pre_populator.patch b/debian/patches/pre_populator.patch
148new file mode 100644
149index 0000000..7986db5
150--- /dev/null
151+++ b/debian/patches/pre_populator.patch
152@@ -0,0 +1,153 @@
153+Description: Pre-populate the log with some events so that the dash isn't empty on first run.
154+
155+=== modified file 'src/Makefile.am'
156+Bug-Ubuntu: https://launchpad.net/bugs/962265
157+Forwarded: not-needed
158+---
159+ datahub/Makefile.am | 1
160+ datahub/pre-populator.vala | 117 +++++++++++++++++++++++++++++++++++++++++
161+ datahub/zeitgeist-datahub.vala | 3 +
162+ 3 files changed, 121 insertions(+)
163+
164+--- a/datahub/Makefile.am
165++++ b/datahub/Makefile.am
166+@@ -30,6 +30,7 @@ zeitgeist_datahub_VALASOURCES = \
167+ desktop-launch-listener.vala \
168+ kde-recent-document-provider.vala \
169+ recent-manager-provider.vala \
170++ pre-populator.vala \
171+ utils.vala \
172+ zeitgeist-datahub.vala \
173+ $(NULL)
174+--- /dev/null
175++++ b/datahub/pre-populator.vala
176+@@ -0,0 +1,117 @@
177++/*
178++ * Copyright (C) 2012 Canonical Ltd.
179++ *
180++ * This program is free software: you can redistribute it and/or modify
181++ * it under the terms of the GNU Lesser General Public License as published by
182++ * the Free Software Foundation, either version 3 of the License, or
183++ * (at your option) any later version.
184++ *
185++ * This program is distributed in the hope that it will be useful,
186++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
187++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
188++ * GNU Lesser General Public License for more details.
189++ *
190++ * You should have received a copy of the GNU Lesser General Public License
191++ * along with this program. If not, see <http://www.gnu.org/licenses/>.
192++ *
193++ * Authored by Michal Hruby <michal.mhr@gmail.com>
194++ *
195++ */
196++
197++using Zeitgeist;
198++
199++public class PrePopulator : DataProvider
200++{
201++ public PrePopulator (DataHub datahub)
202++ {
203++ GLib.Object (unique_id: "com.canonical,datahub,pre-populator",
204++ name: "Pre-populate the log",
205++ description: "Pushes a couple of events so Ubuntu Dash home is not empty when doing new install",
206++ datahub: datahub);
207++ }
208++
209++ // if vala didn't have bug in construct-only properties, the properties
210++ // would be construct-only
211++ public override string unique_id { get; construct set; }
212++ public override string name { get; construct set; }
213++ public override string description { get; construct set; }
214++
215++ public override DataHub datahub { get; construct set; }
216++ public override bool enabled { get; set; default = true; }
217++ public override bool register { get; construct set; default = true; }
218++
219++ construct
220++ {
221++ }
222++
223++ public override void start ()
224++ {
225++ this.prepare_events.begin ();
226++ }
227++
228++ private Event event_for_desktop_file (string desktop_file, int64 timestamp)
229++ {
230++ var event = new Event ();
231++ event.timestamp = timestamp;
232++ var subject = new Subject ();
233++
234++ event.actor = "application://zeitgeist-datahub.desktop";
235++ event.interpretation = Zeitgeist.ZG.ACCESS_EVENT;
236++ event.manifestation = Zeitgeist.ZG.USER_ACTIVITY;
237++ event.add_subject (subject);
238++
239++ subject.uri = "application://%s".printf (desktop_file);
240++ subject.interpretation = Zeitgeist.NFO.SOFTWARE;
241++ subject.manifestation = Zeitgeist.NFO.SOFTWARE_ITEM;
242++ subject.mimetype = "application/x-desktop";
243++
244++ return event;
245++ }
246++
247++ private async void prepare_events ()
248++ {
249++ var arr = new GenericArray<Event> ();
250++ var ts = Timestamp.from_now ();
251++ // the timestamp is in milliseconds, we can safely increment it
252++ // (dash will display latest first)
253++ arr.add (event_for_desktop_file ("rhythmbox.desktop", ++ts));
254++ arr.add (event_for_desktop_file ("org.gnome.Calculator.desktop", ++ts));
255++ arr.add (event_for_desktop_file ("org.gnome.gedit.desktop", ++ts));
256++ arr.add (event_for_desktop_file ("org.gnome.Totem.desktop", ++ts));
257++ arr.add (event_for_desktop_file ("thunderbird.desktop", ++ts));
258++ arr.add (event_for_desktop_file ("yelp.desktop", ++ts));
259++
260++ try
261++ {
262++ var log = new Zeitgeist.Log ();
263++ var ids = yield log.find_event_ids (new TimeRange.anytime (),
264++ new GLib.GenericArray<Zeitgeist.Event> (),
265++ StorageState.ANY,
266++ 1,
267++ ResultType.MOST_RECENT_EVENTS,
268++ null);
269++
270++ if (ids.length == 0)
271++ {
272++ // pre-populate only if there are no events at all
273++ items_available (arr);
274++
275++ Timeout.add_seconds (5, prepare_events.callback);
276++ yield;
277++ }
278++
279++ var registry = new DataSourceRegistry ();
280++ // this is one-time only module, disable ourselves when done
281++ yield registry.set_data_source_enabled (unique_id, false, null);
282++ }
283++ catch (Error err)
284++ {
285++ warning ("%s", err.message);
286++ }
287++ }
288++
289++ public override void stop ()
290++ {
291++ }
292++}
293++
294+--- a/datahub/zeitgeist-datahub.vala
295++++ b/datahub/zeitgeist-datahub.vala
296+@@ -122,6 +122,9 @@ public class DataHub : Object, DataHubSe
297+
298+ providers.prepend (new DesktopLaunchListener (this));
299+
300++ // Ubuntu-specific
301++ providers.prepend (new PrePopulator (this));
302++
303+ foreach (unowned DataProvider prov in providers)
304+ {
305+ bool enabled = true;
306diff --git a/debian/patches/series b/debian/patches/series
307index b3195fe..b930c90 100644
308--- a/debian/patches/series
309+++ b/debian/patches/series
310@@ -3,3 +3,6 @@
311 skip-failing-tests.patch
312 startup-database-vacuum.patch
313 add_german_translation.patch
314+nodisplay_autostart.patch
315+pre_populator.patch
316+fix-monitor-test.patch

Subscribers

People subscribed via source and target branches