[debian-edu-commits] debian-edu/ 129/183: Add daily cron-job to package that checks if the cache of profile assignments is up-to-date and regenerates it if not.

Alexander Alemayhu ccscanf-guest at moszumanska.debian.org
Wed Jun 11 16:48:40 UTC 2014


This is an automated email from the git hooks/post-receive script.

ccscanf-guest pushed a commit to branch master
in repository desktop-profiles.

commit 5dc97acec4d7062829c5ae237a33aba4db6c9880
Author: Bart Cornelis <cobaco at linux.be>
Date:   Tue Dec 12 22:15:07 2006 +0000

    Add daily cron-job to package that checks if the
    cache of profile assignments is up-to-date and
    regenerates it if not.
    
    and have dh_installlisting add a snippet to the postinst
    to regenerate the cache whenever it adds a metadata file
---
 TODO                      | 14 +++-----------
 debian/cron.daily         |  3 +++
 debian/postinst           |  6 ++++++
 debian/rules              |  4 +++-
 dh_installlisting         |  9 ++++++++-
 postinst-desktop-profiles |  4 ++++
 6 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/TODO b/TODO
index 60f2d88..7b8eb04 100644
--- a/TODO
+++ b/TODO
@@ -1,12 +1,4 @@
-Next Revision:
-- Find out why the profile-manager.kmdr script doesn't work with the KDE 3.4 kommander package
-  -> done, new script needs to be checked on 3.3
-
-- Find docs on the kiosk system of XFCE 4.2 available, sofar all I've found is
-    -> panel: http://www.loculus.nl/xfce/documentation/docs-4.2/xfce4-panel.html#panel-kiosk
-    -> xfce4-session: 
-
-- switch debian-edu-config + desktop-base to use desktop-profiles
-- talk to gconf-maintainers, to have gconf support for this package built-in
-  (current system-wide gconf path file needs replacing with the one from this package)
+- create man-page for update-profile-cache
+- further document/improve performance (cache in non-simple case?)
+- option to not ignore already existing values of the various values
 - build usefull (example) profiles and point to them in docu (for accessibility?)
diff --git a/debian/cron.daily b/debian/cron.daily
new file mode 100644
index 0000000..ace4117
--- /dev/null
+++ b/debian/cron.daily
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+update-profile-cache
diff --git a/debian/postinst b/debian/postinst
index 7712ca5..3917730 100755
--- a/debian/postinst
+++ b/debian/postinst
@@ -3,4 +3,10 @@
 # source debconf library
 . /usr/share/debconf/confmodule
 
+
+if(  ( test "$1" = "configure" ) && 
+     ( test -x "$(which update-profile-cache 2>/dev/null)" ) ); then
+  update-profile-cache;
+fi;
+
 #DEBHELPER#
diff --git a/debian/rules b/debian/rules
index 7a9303a..ef649e8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -37,9 +37,11 @@ binary-indep: build install
 	dh_installchangelogs
 	dh_installdocs
 	dh_installmenu
+	dh_installcron
 	dh_installman desktop-profiles.7 list-desktop-profiles.1 dh_installlisting.1 profile-manager.1 path2listing.1
-	dh_install dh_installlisting profile-manager usr/bin
+	dh_install dh_installlisting update-profile-cache profile-manager usr/bin
 	dh_install listingmodule get_desktop-profiles_variables path usr/share/desktop-profiles/
+	dh_install postinst-desktop-profiles usr/share/debhelper/autoscripts/
 	dh_link usr/share/desktop-profiles/path usr/share/doc/desktop-profiles/examples/path
 	dh_install profile-snippet zlogin-snippet usr/share/doc/desktop-profiles/examples
 	dh_install tests.tgz usr/share/doc/desktop-profiles
diff --git a/dh_installlisting b/dh_installlisting
index 5fc81bd..6f8904f 100755
--- a/dh_installlisting
+++ b/dh_installlisting
@@ -18,7 +18,8 @@ B<dh_installlisting> [S<B<debhelper options>>] [S<B<filename(s)>>]
 dh_installlisting is a debhelper program that handles installing listing files
 used by the desktop-profiles package into the correct location in package
 builddirectories (NOTE: this command is provided by the desktop-profiles 
-package, so don't forget to build-depends on it). 
+package, so don't forget to build-depends on it). It also updates the cache
+of profile assignments (when it exists) to reflect the added metadata.
 
 If a file named debian/package.listing exists (or debian/listing in case of the 
 main package) it is installed in etc/desktop-profiles. In addition any files 
@@ -66,6 +67,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
       }
       
     }
+    # if we're not installing desktop-profiles itself, the autoscript isn't yet present
+    if ( "$package" ne "desktop-profiles") {
+      # Make sure the postinst regenerates runs /usr/bin/update-profile-cache
+      # to ensure en up-to-date cache of profile assignments
+      autoscript("$package","postinst","postinst-desktop-profiles");
+    }  
   }  
 	
   # Add desktop-profiles to the dependencies if necesary
diff --git a/postinst-desktop-profiles b/postinst-desktop-profiles
new file mode 100644
index 0000000..9a80cd0
--- /dev/null
+++ b/postinst-desktop-profiles
@@ -0,0 +1,4 @@
+if(  ( test "$1" = "configure" ) && 
+     ( test -x "$(which update-profile-cache 2>/dev/null)" ) ); then
+  update-profile-cache;
+fi;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/pkg-team/desktop-profiles.git



More information about the debian-edu-commits mailing list