[28260] in Source-Commits

home help back first fref pref prev next nref lref last post

dconf-config commit: Ship a flag file; switch to Makefile

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Jun 18 09:38:43 2014

Date: Wed, 18 Jun 2014 09:38:36 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201406181338.s5IDcaQV007063@drugstore.mit.edu>
To: source-commits@MIT.EDU

https://github.com/mit-athena/dconf-config/commit/9549cd39ecd81378c753ca9faf9793240f7d78d0
commit 9549cd39ecd81378c753ca9faf9793240f7d78d0
Author: Jonathan Reed <jdreed@mit.edu>
Date:   Wed Jun 18 07:37:08 2014 -0400

    Ship a flag file; switch to Makefile
    
    Because someone might uninstall but not purge dconf-config, we
    should ensure the package is installed before executing the
    Xsession.d code.  Unfortunately, the dconf profile is also a
    conffile.  So we ship a flag file, and test for that, because
    running dpkg-query takes forever on -cluster
    
    Also, switch to a Makefile and let dh_auto_foo deal, rather than
    an override in dh_install

 Makefile                              |   16 ++++++++++++++++
 debian/10debathena-copy-dconf         |    6 +++++-
 debian/changelog                      |    9 +++++++++
 debian/debathena-dconf-config.install |    1 +
 debian/generate_dconf_user.sh         |   13 -------------
 debian/pkg-installed                  |    3 +++
 debian/rules                          |    5 -----
 7 files changed, 34 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..a3b9706
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,16 @@
+CODENAME = $(shell lsb_release -sc)
+
+.PHONY: clean all install
+
+all: athena_user
+
+athena_user:
+	@echo "user-db:user_$(CODENAME)" > $@
+	@echo "system-db:athena" >> $@
+
+install: athena_user
+	mkdir -p $(DESTDIR)/etc/dconf/profile
+	install -m 0644 athena_user $(DESTDIR)/etc/dconf/profile
+
+clean:
+	rm -f athena_user
diff --git a/debian/10debathena-copy-dconf b/debian/10debathena-copy-dconf
index adfd58c..1edca0c 100644
--- a/debian/10debathena-copy-dconf
+++ b/debian/10debathena-copy-dconf
@@ -25,7 +25,11 @@ get_user_dconf_profile() {
 
 ATHENA_DCONF_PROFILE=/etc/dconf/profile/athena_user
 PROFILE_DIR=${XDG_CONFIG_HOME:-"$HOME/.config"}/dconf
-if [ -f "$ATHENA_DCONF_PROFILE" ] && \
+# Because the dconf profile is a conffile, we can't use its existence
+# as proof the package is installed.  (It could have been removed but
+# not purged.  So instead, we'll abuse the changelog for this test.
+if [ -f "/usr/share/debathena-dconf-config/pkg-installed" ] && \
+    [ -f "$ATHENA_DCONF_PROFILE" ] && \
     [ "$DEBATHENA_HOME_TYPE" = afs ] && \
     ! [ -e "$HOME/.config/debathena/skip_dconf_config" ]; then
     dbname="user_$(lsb_release -sc)"
diff --git a/debian/changelog b/debian/changelog
index 1b33ade..8e61743 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+debathena-dconf-config (1.1) unstable; urgency=low
+
+  * Ship a flag file for whose existence the Xsession.d scripts can
+    test (Trac: #1489)
+  * Generate the user profile in a Makefile rather than a dh_install
+    override
+
+ -- Jonathan Reed <jdreed@mit.edu>  Wed, 18 Jun 2014 09:38:16 -0400
+
 debathena-dconf-config (1.0) unstable; urgency=low
 
   * Initial release.
diff --git a/debian/debathena-dconf-config.install b/debian/debathena-dconf-config.install
index 8967b70..b1e589d 100644
--- a/debian/debathena-dconf-config.install
+++ b/debian/debathena-dconf-config.install
@@ -1 +1,2 @@
 debian/10debathena-copy-dconf etc/X11/Xsession.d
+debian/pkg-installed usr/share/debathena-dconf-config
diff --git a/debian/generate_dconf_user.sh b/debian/generate_dconf_user.sh
deleted file mode 100755
index 736b8a5..0000000
--- a/debian/generate_dconf_user.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-user_db="user"
-codename=$(lsb_release -sc 2>/dev/null)
-if [ -n "$codename" ]; then
-    # Profile names may only contain [[:alnum:]] and '_'
-    user_db="user_${codename}"
-fi
-
-cat <<EOF
-user-db:${user_db}
-system-db:athena
-EOF
diff --git a/debian/pkg-installed b/debian/pkg-installed
new file mode 100644
index 0000000..2d70fe3
--- /dev/null
+++ b/debian/pkg-installed
@@ -0,0 +1,3 @@
+This is a flag file for use by the Xsession.d snippets to determine
+if the package is installed (as opposed to, say, erased by not purged,
+leaving its conffiles around).
diff --git a/debian/rules b/debian/rules
index ff5aae8..2d33f6a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,8 +2,3 @@
 
 %:
 	dh $@
-
-override_dh_install:
-	dh_install
-	mkdir -p debian/debathena-dconf-config/etc/dconf/profile
-	debian/generate_dconf_user.sh > debian/debathena-dconf-config/etc/dconf/profile/athena_user

home help back first fref pref prev next nref lref last post