Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/snap: implement userd command as replacement for snapd-xdg-open #3260

Merged
merged 84 commits into from
Aug 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
46a9432
cmd/snapd: add --user argument to start user instance
morphis May 2, 2017
169b142
daemon: implement basic dbus service part
morphis May 2, 2017
f4e173c
data/systemd: add systemd service unit for the snapd user instance
morphis May 2, 2017
b8c31e3
daemon/user: add test cases for the SafeLauncher implementation
morphis May 2, 2017
3f8f542
daemon: refactor daemon into a interface structure
morphis May 2, 2017
c41ebcf
debian: add transitional package for snapd-xdg-open
morphis May 2, 2017
5bbb9bb
daemon/user: correct formatting according to gofmt
morphis May 3, 2017
b0babff
Add godbus to our vendor file
morphis May 3, 2017
8109a38
daemon/user: use correct error handling
morphis May 3, 2017
d7f1aea
tests: add test case for snapd --user
morphis May 3, 2017
41a5709
debian: add proper replaces/breaks for snapd-xdg-open
morphis May 4, 2017
59ccf07
daemon/user: extend set of unit tests for the daemon implementation
morphis May 4, 2017
a7de2c2
tests/main: add description for snapd --user test case
morphis May 4, 2017
6216329
tests/upgrade: add test case to verify snapd-xdg-open migration
morphis May 4, 2017
5381db5
Also drop snapd-xdg-open on test cleanup
morphis May 5, 2017
9684c11
data/upstart: add job definition for the snapd --user instance
morphis May 8, 2017
adf835a
debian: fix installation of our systemd/upstart service files
morphis May 8, 2017
0bf51cb
tests/upgrade: purge snapd-xdg-open on restore
morphis May 8, 2017
bd5e6ad
data: add global makefile which takes care about upstart and systemd
morphis May 9, 2017
9d91bf2
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis May 29, 2017
cb2a694
cmd,daemon: fix review comments
morphis May 29, 2017
39d0a68
tests: use pkgdb functions for new snapd --user test cases
morphis May 29, 2017
2d410ca
tests: specify not allowed systems correctly
morphis May 29, 2017
1c9e37e
tests: fix pkgdb dependency
morphis May 29, 2017
1ba7608
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jun 1, 2017
f6825ad
many: rework user service implementation to be part of the snap command
morphis Jun 1, 2017
304fe24
tests/main: extend test case for snap userd after rework
morphis Jun 2, 2017
2e7c3db
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jun 19, 2017
5130d8f
Use a dbus session service configuration instead of systemd
morphis Jun 19, 2017
a7615bb
Switch to io.snapcraft*
morphis Jun 19, 2017
7d851a5
Revert changes in snapd code
morphis Jun 19, 2017
8a52fef
tests/uprade: don't reference not existing apt.sh anymore
morphis Jun 19, 2017
ffabd40
packaging: include dbus service configuration file
morphis Jun 19, 2017
650e6be
packaging: drop left over things from upstart job configuration
morphis Jun 19, 2017
51f914d
packaging/ubuntu-16.04: correct a few more things
morphis Jun 19, 2017
2794891
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jun 26, 2017
30a3473
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jul 6, 2017
db2a2ee
tests/main: fix snap userd test case
morphis Jul 7, 2017
905aec0
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jul 10, 2017
2bafc31
Add support for Ubuntu 14.04
morphis Jul 11, 2017
4946fc0
Wait for dbus service to be up and running before starting the test
morphis Jul 11, 2017
bccd1c8
Use session instead of system bus
morphis Jul 11, 2017
36e3cc5
Drop stop of not existing service unit
morphis Jul 11, 2017
e2145db
Don't fail if package can't be purged on restore
morphis Jul 12, 2017
e193577
tests: don't run upgrade test on 14.04
morphis Jul 14, 2017
48bae99
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Jul 17, 2017
4befed2
Don't fail when we purge snapd-xdg-open as it might not be present
morphis Jul 18, 2017
57d1ce0
Install dbus service file on Fedora/openSUSE
morphis Jul 18, 2017
5f61d01
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Aug 1, 2017
a2e0f1d
Respect review comments
morphis Aug 1, 2017
6364b02
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Aug 2, 2017
8a3a84d
tests/main: use correct object path for safe-launcher
morphis Aug 2, 2017
91303a9
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Aug 2, 2017
aa65ec5
tests/main: use SNAP_MOUNT_DIR instead of SNAPMOUNTDIR
morphis Aug 2, 2017
ef810c3
Merge branch 'master' into f/snapd-user-instance
morphis Aug 7, 2017
f649d89
tests/main: install/purge dbus-x11 for dbus tests
morphis Aug 7, 2017
a7ff87c
Merge remote-tracking branch 'origin/master' into f/snapd-user-instance
morphis Aug 17, 2017
94d37ab
address review feedback
mvo5 Aug 23, 2017
dcdeb10
Use testutil.MockCommand() in safelauncher_test.go
mvo5 Aug 23, 2017
475ff96
add makeAccessDeniedError for safelauncher.go
mvo5 Aug 23, 2017
d497289
address review feedback
mvo5 Aug 23, 2017
7e9f696
rename cmd_userd ifaces to dbusifaces to avoid confusion with our sna…
mvo5 Aug 23, 2017
0c23762
Merge remote-tracking branch 'upstream/master' into HEAD
mvo5 Aug 23, 2017
c8d73d9
fix opensuse build failure
mvo5 Aug 23, 2017
1f3049a
remove some unused code
mvo5 Aug 23, 2017
eabbd00
ensure cmd_userd honors when the tomb gets killed
mvo5 Aug 23, 2017
e726d73
improve cmd_userd.go error message
mvo5 Aug 23, 2017
c37d23a
improve snap-userd test
mvo5 Aug 23, 2017
528dd75
add missing stop
mvo5 Aug 23, 2017
65625d9
tests/main/snap-userd/task.yaml: do not fail if test-snap-userd.scope…
mvo5 Aug 23, 2017
3ab33bc
rename dbus package to userd
mvo5 Aug 24, 2017
bb185e7
rename io.snapcraft.SafeLauncher -> io.snapcraft.Launcher
mvo5 Aug 24, 2017
fcb0890
address review feedback
mvo5 Aug 24, 2017
d740c70
add org.freedesktop.DBus.Peer to launcherIntrospectionXML
mvo5 Aug 25, 2017
d5a4b1d
add tests for cmdUserd
mvo5 Aug 25, 2017
bfcb309
use org.freedesktop.DBus.Peer.Ping in snap-userd spread test
mvo5 Aug 25, 2017
804dcbb
extract details from cmd_userd into userd/userd.go
mvo5 Aug 25, 2017
5c2884b
Refactor userd code and extract testutil.DBusTest helper
mvo5 Aug 25, 2017
cdbe78e
add dbus to the build-dependencies
mvo5 Aug 25, 2017
1782192
DBusTest: do not crash if no dbus-daemon is found
mvo5 Aug 25, 2017
0ac7b57
also require dbus-launch in DBusTest
mvo5 Aug 25, 2017
3e04c6d
change fedora/snapd.spec as requested by Neal Gompa
mvo5 Aug 25, 2017
cf2ac03
fix circular import
mvo5 Aug 28, 2017
278ac67
fix upgrade test, the version of snapd-xdg-open is not always 0.0.0~1…
mvo5 Aug 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ cmd/*/*.[1-9]

# auto-generated systemd units
data/systemd/*.service

# auto-generated dbus services
data/dbus/*.service

data/info

# test-driver
Expand Down
74 changes: 74 additions & 0 deletions cmd/snap/cmd_userd.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// -*- Mode: Go; indent-tabs-mode: t -*-

/*
* Copyright (C) 2017 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

package main

import (
"fmt"
"os"
"os/signal"
"syscall"

"github.com/jessevdk/go-flags"

"github.com/snapcore/snapd/i18n"
"github.com/snapcore/snapd/userd"
)

type cmdUserd struct {
userd userd.Userd
}

var shortUserdHelp = i18n.G("Start the userd service")
var longUserdHelp = i18n.G("The userd command starts the snap user session service.")

func init() {
cmd := addCommand("userd",
shortAbortHelp,
longAbortHelp,
func() flags.Commander {
return &cmdUserd{}
},
nil,
[]argDesc{},
)
cmd.hidden = true
}

func (x *cmdUserd) Execute(args []string) error {
if len(args) > 0 {
return ErrExtraArgs
}

if err := x.userd.Init(); err != nil {
return err
}
x.userd.Start()

ch := make(chan os.Signal)
signal.Notify(ch, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR1)
select {
case sig := <-ch:
fmt.Fprintf(Stdout, "Exiting on %s.\n", sig)
case <-x.userd.Dying():
// something called Stop()
}

return x.userd.Stop()
}
70 changes: 70 additions & 0 deletions cmd/snap/cmd_userd_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// -*- Mode: Go; indent-tabs-mode: t -*-

/*
* Copyright (C) 2016 Canonical Ltd
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/

package main_test

import (
"os"
"syscall"
"time"

. "gopkg.in/check.v1"

snap "github.com/snapcore/snapd/cmd/snap"
"github.com/snapcore/snapd/testutil"
)

type userdSuite struct {
BaseSnapSuite
testutil.DBusTest
}

var _ = Suite(&userdSuite{})

func (s *userdSuite) TestUserdBadCommandline(c *C) {
_, err := snap.Parser().ParseArgs([]string{"userd", "extra-arg"})
c.Assert(err, ErrorMatches, "too many arguments for command")
}

func (s *userdSuite) TestUserd(c *C) {
go func() {
defer func() {
me, err := os.FindProcess(os.Getpid())
c.Assert(err, IsNil)
me.Signal(syscall.SIGUSR1)
}()

needle := "io.snapcraft.Launcher"
for i := 0; i < 10; i++ {
for _, objName := range s.SessionBus.Names() {
if objName == needle {
return
}
time.Sleep(1 * time.Second)
}

}
c.Fatalf("%s does not appeared on the bus", needle)
}()

rest, err := snap.Parser().ParseArgs([]string{"userd"})
c.Assert(err, IsNil)
c.Check(rest, DeepEquals, []string{})
c.Check(s.Stdout(), Equals, "Exiting on user defined signal 1.\n")
}
3 changes: 3 additions & 0 deletions data/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
all install clean:
$(MAKE) -C systemd $@
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for using $(MAKE)

$(MAKE) -C dbus $@
31 changes: 31 additions & 0 deletions data/dbus/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

BINDIR := /usr/bin
DBUSSERVICESDIR := /usr/share/dbus-1/services

SERVICES_GENERATED := $(patsubst %.service.in,%.service,$(wildcard *.service.in))
SERVICES := ${SERVICES_GENERATED}

%.service: %.service.in
cat $< | sed 's:@bindir@:${BINDIR}:g' | cat > $@

all: ${SERVICES}

install: ${SERVICES}
install -D -m 0644 -t ${DESTDIR}/${DBUSSERVICESDIR} $^

clean:
rm -f ${SERVICES_GENERATED}
3 changes: 3 additions & 0 deletions data/dbus/io.snapcraft.Launcher.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[D-BUS Service]
Name=io.snapcraft.Launcher
Exec=@bindir@/snap userd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like libexecdir thing to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the regular snap binary that provides the userd subcommand. So we need bindir here unless I miss something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct, though I expected this to be implemented in a libexecdir command, as users shouldn't usually do things here. Not a biggie, though.

16 changes: 16 additions & 0 deletions interfaces/builtin/unity7.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,23 @@ const unity7ConnectedPlugAppArmor = `
/usr/bin/xdg-open ixr,
/usr/share/applications/{,*} r,
/usr/bin/dbus-send ixr,

# This allow access to the first version of the snapd-xdg-open
# version which was shipped outside of snapd
dbus (send)
bus=session
path=/
interface=com.canonical.SafeLauncher
member=OpenURL
peer=(label=unconfined),
# ... and this allows access to the new xdg-open service which
# is now part of snapd itself.
dbus (send)
bus=session
path=/io/snapcraft/Launcher
interface=io.snapcraft.Launcher
member=OpenURL
peer=(label=unconfined),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🎉


# input methods (ibus)
# subset of ibus abstraction
Expand Down Expand Up @@ -303,6 +314,11 @@ dbus (send)
bus=session
interface=com.canonical.SafeLauncher.OpenURL
peer=(label=unconfined),
# new url helper (part of snap userd)
dbus (send)
bus=session
interface=io.snapcraft.Launcher.OpenURL
peer=(label=unconfined),

# dbusmenu
dbus (send)
Expand Down
5 changes: 3 additions & 2 deletions packaging/fedora/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ autoreconf --force --install --verbose
popd

# Build systemd units
pushd ./data/systemd
pushd ./data/
make BINDIR="%{_bindir}" LIBEXECDIR="%{_libexecdir}" \
SYSTEMDSYSTEMUNITDIR="%{_unitdir}" \
SNAP_MOUNT_DIR="%{_sharedstatedir}/snapd/snap" \
Expand Down Expand Up @@ -441,7 +441,7 @@ rm -fv %{buildroot}%{_bindir}/ubuntu-core-launcher
popd

# Install all systemd units
pushd ./data/systemd
pushd ./data/
%make_install SYSTEMDSYSTEMUNITDIR="%{_unitdir}" BINDIR="%{_bindir}" LIBEXECDIR="%{_libexecdir}"
# Remove snappy core specific units
rm -fv %{buildroot}%{_unitdir}/snapd.system-shutdown.service
Expand Down Expand Up @@ -560,6 +560,7 @@ popd
%ghost %dir %{_sharedstatedir}/snapd/snap/bin
%dir %{_localstatedir}/snap
%ghost %{_sharedstatedir}/snapd/state.json
%{_datadir}/dbus-1/services/io.snapcraft.Launcher.service

%files -n snap-confine
%doc cmd/snap-confine/PORTING
Expand Down
3 changes: 2 additions & 1 deletion packaging/opensuse-42.2/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ install -d %buildroot/snap/bin
install -m 644 -D packaging/opensuse-42.2/permissions %buildroot/%{_sysconfdir}/permissions.d/snapd
install -m 644 -D packaging/opensuse-42.2/permissions.paranoid %buildroot/%{_sysconfdir}/permissions.d/snapd.paranoid
# Install the systemd units
make -C data/systemd install DESTDIR=%{buildroot} SYSTEMDSYSTEMUNITDIR=%{_unitdir}
make -C data install DESTDIR=%{buildroot} SYSTEMDSYSTEMUNITDIR=%{_unitdir}
for s in snapd.autoimport.service snapd.system-shutdown.service snap-repair.timer snap-repair.service snapd.core-fixup.service; do
rm -f %buildroot/%{_unitdir}/$s
done
Expand Down Expand Up @@ -291,6 +291,7 @@ esac
%{_libexecdir}/snapd/complete.sh
%{_libexecdir}/snapd/etelpmoc.sh
%{_mandir}/man1/snap.1.gz
/usr/share/dbus-1/services/io.snapcraft.Launcher.service

%changelog

9 changes: 9 additions & 0 deletions packaging/ubuntu-14.04/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends: autoconf,
autotools-dev,
bash-completion,
debhelper (>= 9),
dbus,
dh-apparmor,
dh-autoreconf,
dh-golang (>=1.7),
Expand Down Expand Up @@ -118,3 +119,11 @@ Section: oldlibs
Pre-Depends: dpkg (>= 1.15.7.2)
Description: Transitional package for snap-confine
This is a transitional dummy package. It can safely be removed.

Package: snapd-xdg-open
Architecture: any
Depends: snapd (= ${binary:Version}), ${misc:Depends}
Section: oldlibs
Pre-Depends: dpkg (>= 1.15.7.2)
Description: Transitional package for snapd-xdg-open
This is a transitional dummy package. It can safely be removed.
1 change: 1 addition & 0 deletions packaging/ubuntu-14.04/rules
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ override_dh_install:
# and now the normal install rules
install --mode=0644 debian/snapd.system-shutdown.service debian/snapd/$(SYSTEMD_UNITS_DESTDIR)
$(MAKE) -C cmd install DESTDIR=$(CURDIR)/debian/tmp

dh_install

override_dh_auto_install: snap.8
Expand Down
13 changes: 11 additions & 2 deletions packaging/ubuntu-16.04/control
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Build-Depends: autoconf,
autotools-dev,
bash-completion,
debhelper (>= 9),
dbus,
dh-apparmor,
dh-autoreconf,
dh-golang (>=1.7),
Expand Down Expand Up @@ -64,8 +65,8 @@ Depends: adduser,
systemd,
${misc:Depends},
${shlibs:Depends}
Replaces: ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9), snap-confine (<< 2.23), ubuntu-core-launcher (<< 2.22)
Breaks: ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9), snap-confine (<< 2.23), ubuntu-core-launcher (<< 2.22)
Replaces: ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9), snap-confine (<< 2.23), ubuntu-core-launcher (<< 2.22), snapd-xdg-open (<< 0.0.0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally, thank you again for doing this :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is an insane number of Breaks/Replaces directives!

Breaks: ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9), snap-confine (<< 2.23), ubuntu-core-launcher (<< 2.22), snapd-xdg-open (<< 0.0.0)
Conflicts: snap (<< 2013-11-29-1ubuntu1)
Built-Using: ${Built-Using} ${misc:Built-Using}
Description: Tool to interact with Ubuntu Core Snappy.
Expand Down Expand Up @@ -112,3 +113,11 @@ Section: oldlibs
Pre-Depends: dpkg (>= 1.15.7.2)
Description: Transitional package for snapd
This is a transitional dummy package. It can safely be removed.

Package: snapd-xdg-open
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keeping this as separate package will break for users using only "apt-get upgrade" (vs dist-upgrade) if snapd gets a dependency on it.
...it was one of the main reasons to actually start discussing to move snapd-xdg-open into snapd in the beginning to actually get it into distros that have not seeded it (like elementary) without introducing a package dependency.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to snap-confine btw ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will stay a separate package but produced by the snapd source package so we can migrate people away from the other snapd-xdg-open deb package. That was the idea. Didn't tested yet this works well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, but that means you have to either add a recommends (in which case the package will never be installed for users only doing "apt-get upgrade") or you add a hard dependency in which case users of "apt-get upgrade" will get an upgrade error. we have tons of bugs for that case from snap-confine which was one of the reasons to include it without a separate package, keeping a separate binary package looks to me like we are exactly re-introducing the same problem again just with another package now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need one or another way to get the snapd-xdg-open package removed from installations out there. If we have a binary package produced by two different source packages but the second one has a higher version as the first one isn't then the one from the first source package overwritten?

The Recommends is for sure missing. Any other ways how we can achieve this?

Copy link
Contributor

@ogra1 ogra1 May 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, include the binaries in snapd and have the proper breaks/replaces lines (and perhaps a provides) in the snapd package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, including the binaries in the snapd package was the plan. Will add the Breaks/Replaces line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @mvo5 - I think we just want to have this in the main snapd package and have snapd-xdg-open as an empty transitional package.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zyga that is what we already do here. But leaving this to @mvo5 to approve.

Architecture: any
Depends: snapd (= ${binary:Version}), ${misc:Depends}
Section: oldlibs
Pre-Depends: dpkg (>= 1.15.7.2)
Description: Transitional package for snapd-xdg-open
This is a transitional dummy package. It can safely be removed.
13 changes: 7 additions & 6 deletions packaging/ubuntu-16.04/rules
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ override_dh_auto_build:
cd cmd && ( ./configure --prefix=/usr --libexecdir=/usr/lib/snapd $(VENDOR_ARGS))
$(MAKE) -C cmd all

# Generate the real systemd units out of the available templates
$(MAKE) -C data/systemd all
# Generate the real systemd/dbus config files
$(MAKE) -C data all

override_dh_auto_test:
dh_auto_test -- $(GCCGOFLAGS)
Expand Down Expand Up @@ -210,10 +210,11 @@ override_dh_install:
cp -R share/locale debian/snapd/usr/share; \
fi

# install snapd's systemd units, done here instead of
# debian/snapd.install because the ubuntu/14.04 release
# branch adds/changes bits here
$(MAKE) -C data/systemd install DESTDIR=$(CURDIR)/debian/snapd/ SYSTEMDSYSTEMUNITDIR=$(SYSTEMD_UNITS_DESTDIR)
# install snapd's systemd units / upstart jobs, done
# here instead of debian/snapd.install because the
# ubuntu/14.04 release branch adds/changes bits here
$(MAKE) -C data install DESTDIR=$(CURDIR)/debian/snapd/ \
SYSTEMDSYSTEMUNITDIR=$(SYSTEMD_UNITS_DESTDIR)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish we had one spelling for this variable.


$(MAKE) -C cmd install DESTDIR=$(CURDIR)/debian/tmp

Expand Down
1 change: 1 addition & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ suites:
fi
. $TESTSLIB/pkgdb.sh
distro_purge_package snapd
distro_purge_package snapd-xdg-open || true

tests/unit/:
summary: Suite to run unit tests (non-go and different go runtimes)
Expand Down
3 changes: 3 additions & 0 deletions tests/main/interfaces-dbus/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ prepare: |
. "$TESTSLIB/dirs.sh"
. "$TESTSLIB/pkgdb.sh"

distro_install_package dbus-x11

echo "Give a snap declaring a dbus slot in installed"
snap install --edge test-snapd-dbus-provider

Expand Down Expand Up @@ -54,6 +56,7 @@ restore: |
else
systemctl stop dbus-provider
fi
distro_purge_package dbus-x11

execute: |
CONNECTED_PATTERN="test-snapd-dbus-provider:dbus-test +test-snapd-dbus-consumer"
Expand Down
Loading