]> git.donarmstrong.com Git - debhelper.git/commitdiff
r1695: * dh_gconf: gconf schemas moved to /usr/share/gconf/schemas. Relocate
authorjoey <joey>
Thu, 8 Jul 2004 21:48:14 +0000 (21:48 +0000)
committerjoey <joey>
Thu, 8 Jul 2004 21:48:14 +0000 (21:48 +0000)
    schemas from /etc/gconf/schemas. (Josselin Mouette)
  * dh_gconf: kill gconfd-2 so that the newly installed schemas
    are available straight away. (Josselin Mouette)
  * dh_gconf: fix bashism in restart of gconfd-2
  * dh_gconf: fix innaccuracy in man page; gconfd-2 is HUPPed, not
    killed.
  * dh_scrollkeeper: stop adding scrollkeeper to misc:Depends, since
    the postinst will not run it if it's not installed, and a single run after
    it's installed is sufficient to find all documents. Closes: #256745
  * dh_fixperms: make .ali files mode 444 to prevent recompilation by GNAT.
    For speed, only scan for .ali files in usr/lib/ada. Closes: #245211
  * dh_python: check to make sure compileall.py is available before running it
    in the postinst. Closes: #253112
  * dh_installmodules: install debian/package.modprobe into etc/modprobe.d/
    for module-init-tools. These files can sometimes need to differ from the
    etc/modutils/ files. Closes: #204336, #234495
  * dh_installmanpages is now deprecated.
  * Add a test case for bug #244157, and fixed the inverted ok() parameters
    in the others, and added a few new tests.
  * dh_link: applied GOTO Masanori's patch to fix conversion of existing
    relative symlinks between top level directories. Closes: #244157

13 files changed:
autoscripts/postinst-gconf
autoscripts/postinst-python
autoscripts/postrm-gconf [new file with mode: 0644]
autoscripts/prerm-gconf
debian/changelog
dh_fixperms
dh_gconf
dh_installmanpages
dh_installmodules
dh_link
dh_scrollkeeper
doc/TODO
t/dh_link

index c5ee87d5e0a6fc24dcb062b209e80f7820ea949b..f4a7c82d7f13ec55ad8ee49e14b7af5d9099f041 100644 (file)
@@ -1,5 +1,5 @@
 if [ "$1" = "configure" ]; then
-       SCHEMA_LOCATION=/etc/gconf/schemas
+       SCHEMA_LOCATION=/usr/share/gconf/schemas
        SCHEMA_FILES="#SCHEMAS#"
        for SCHEMA in $SCHEMA_FILES; do
                if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
@@ -8,4 +8,6 @@ if [ "$1" = "configure" ]; then
                                --makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
                fi
        done
+
+       kill -HUP `pidof gconfd-2` >/dev/null 2>&1 || true
 fi
index 6f1f9a5b885e9ebe9005470ccaef5067ef8a88a6..c48d1aa64150120542ca7856dd7c4beeb9c69bb1 100644 (file)
@@ -1,5 +1,5 @@
 PYTHON=#PYVER#
-if which $PYTHON >/dev/null 2>&1; then
+if which $PYTHON >/dev/null 2>&1 && [ -e /usr/lib/$PYTHON/compileall.py ]; then
        DIRLIST="#DIRLIST#"
        for i in $DIRLIST ; do
                $PYTHON -O /usr/lib/$PYTHON/compileall.py -q $i
diff --git a/autoscripts/postrm-gconf b/autoscripts/postrm-gconf
new file mode 100644 (file)
index 0000000..10a47fd
--- /dev/null
@@ -0,0 +1,7 @@
+if [ "$1" = purge ]; then
+       SCHEMA_FILES="#SCHEMAS#"
+       for SCHEMA in $SCHEMA_FILES; do
+               rm -f /etc/gconf/schemas/$SCHEMA
+       done
+       rmdir -p --ignore-fail-on-non-empty /etc/gconf/schemas
+fi
index aaa803e7b7856e49927f03962a2866193125af29..cd7554133ae71639b589e1d9fd9cc24f832a3f21 100644 (file)
@@ -1,5 +1,5 @@
 if [ "$1" = remove ] || [ "$1" = upgrade ]; then
-       SCHEMA_LOCATION=/etc/gconf/schemas
+       SCHEMA_LOCATION=/usr/share/gconf/schemas
        SCHEMA_FILES="#SCHEMAS#"
        for SCHEMA in $SCHEMA_FILES; do
                if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
index 53cce7866b00e375341f9c108296c3653a83e3a0..51cd23e5f5063fd451255bebcf3465a4c0bf5f0d 100644 (file)
@@ -1,6 +1,28 @@
 debhelper (4.2.13) UNRELEASED; urgency=low
 
   * Spanish man page updates from Ruben Porras. Closes: #247382
+  * dh_gconf: gconf schemas moved to /usr/share/gconf/schemas. Relocate
+    schemas from /etc/gconf/schemas. (Josselin Mouette)
+  * dh_gconf: kill gconfd-2 so that the newly installed schemas
+    are available straight away. (Josselin Mouette)
+  * dh_gconf: fix bashism in restart of gconfd-2
+  * dh_gconf: fix innaccuracy in man page; gconfd-2 is HUPPed, not
+    killed.
+  * dh_scrollkeeper: stop adding scrollkeeper to misc:Depends, since
+    the postinst will not run it if it's not installed, and a single run after
+    it's installed is sufficient to find all documents. Closes: #256745
+  * dh_fixperms: make .ali files mode 444 to prevent recompilation by GNAT.
+    For speed, only scan for .ali files in usr/lib/ada. Closes: #245211
+  * dh_python: check to make sure compileall.py is available before running it
+    in the postinst. Closes: #253112
+  * dh_installmodules: install debian/package.modprobe into etc/modprobe.d/
+    for module-init-tools. These files can sometimes need to differ from the
+    etc/modutils/ files. Closes: #204336, #234495
+  * dh_installmanpages is now deprecated.
+  * Add a test case for bug #244157, and fixed the inverted ok() parameters
+    in the others, and added a few new tests.
+  * dh_link: applied GOTO Masanori's patch to fix conversion of existing
+    relative symlinks between top level directories. Closes: #244157
 
  -- Joey Hess <joeyh@debian.org>  Tue,  6 Jul 2004 12:52:30 -0400
 
index 3f3babdcd1b316288a379b5b89419a8dad7f78be..5bd39f3dc495eee84d52dfdcfa48c5c9f4dfb26c 100755 (executable)
@@ -96,6 +96,12 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                }
        }
        
+       # ADA ali files should be mode 444 to avoid recompilation
+       if (-d "$tmp/usr/lib/ada") {
+               complex_doit("find $tmp/usr/lib/ada -type f",
+                       "-name '*.ali' $find_options -print0",
+                       "2>/dev/null | xargs -0r chmod uga-w");
+       }
 }
 
 =head1 SEE ALSO
index a7e0e41956113e6c383b67a6633c5613c4af61c0..769dfa755ac67fd414074612c5a1f3b819b4bb55 100755 (executable)
--- a/dh_gconf
+++ b/dh_gconf
@@ -21,22 +21,36 @@ GConf schemas.
 It automatically generates the postinst and prerm fragments needed
 to register and unregister the schemas in etc/gconf/schemas.
 These fragements will use gconftool-2, so the package should depend on
-gconf2. This rogram will add an apprioriate dependency to ${misc:Depends}.
+gconf2. This program will add an appropriate dependency to ${misc:Depends}.
+
+The postinst script will also signal gconfd-2 so that the newly installed
+schemas are available straight away.
 
 =cut
 
 init();
 
+
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
+       my $old_schemas_dir = "$tmp/etc/gconf/schemas";
+       my $new_schemas_dir = "$tmp/usr/share/gconf/schemas";
+
+       # Migrate schemas from /etc/gconf/schemas to /usr/share/gconf/schemas
+       if (-d $old_schemas_dir) {
+               doit("mkdir -p $new_schemas_dir") unless -d $new_schemas_dir;
+               doit("mv $old_schemas_dir/*.schemas $new_schemas_dir/");
+               doit("rmdir --ignore-fail-on-non-empty $old_schemas_dir");
+       }
 
-       if (-d "$tmp/etc/gconf/schemas") {
+       if (-d "$new_schemas_dir") {
                # Get a list of the schemas
-               my $schemas = `find debian/$package/etc/gconf/schemas -type f -name \*.schemas -printf '%P '`;
+               my $schemas = `find $new_schemas_dir -type f -name \*.schemas -printf '%P '`;
                if ($schemas ne '') {
                        autoscript($package,"postinst","postinst-gconf","s%#SCHEMAS#%$schemas%");
                        autoscript($package,"prerm","prerm-gconf","s%#SCHEMAS#%$schemas%");
-                       addsubstvar($package, "misc:Depends", "gconf2 (>= 2.4.0)");
+                       autoscript($package,"postrm","postrm-gconf","s%#SCHEMAS#%$schemas%");
+                       addsubstvar($package, "misc:Depends", "gconf2 (>= 2.6.2-1)");
                }
        }
 }
index 415c86b7a21ec63aaa5a24be4cba6f548269f8a2..93c841548273782012c5497421681e01b43e2d54 100755 (executable)
@@ -21,7 +21,8 @@ automatically installing man pages into usr/share/man/ and usr/X11R6/man/
 in package build directories.
 
 This is a DWIM-style program, with an interface unlike the rest of
-debhelper. You are encouraged to use L<dh_installman(1)> instead.
+debhelper. It is deprecated, and you are encouraged to use
+L<dh_installman(1)> instead.
 
 dh_installmanpages scans the current directory and all subdirectories for
 filenames that look like man pages. (Note that only real files are looked
@@ -61,6 +62,8 @@ not be processed properly.
 
 =cut
 
+warning("This program is deprecated, switch to dh_installman.");
+
 init();
 
 # Check if a file is a man page, for use by File::Find.
index 28f947cab755e464c36a4b0af09802cbeb77e653..132857a0f5e33736675a37c6f9a0df43424deee6 100755 (executable)
@@ -21,12 +21,15 @@ dh_installmodules is a debhelper program that is responsible for
 registering kernel modules with modutils.
 
 Files named debian/package.modules will be installed as
-etc/modutils/package in the package build directory.
+etc/modutils/package in the package build directory. This is for use by
+modutils. Files named debian/package.modprobe will be installed in
+etc/modprobe.d/package in the package build directory, to be used by
+module-init-tools's version of modprobe.
 
 Then postinst and postrm commands are automatically generated to register
 the modules when the package is installed. See L<dh_installdeb(1)> for an
 explanation of how this works. Note that this will be done for any
-package this program acts on which has either the above-mentioned file, or
+package this program acts on which has either a package.modules file, or
 has .o or .ko files in /lib/modules.
 
 =head1 OPTIONS
@@ -68,21 +71,29 @@ sub find_kernel_modules {
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
        my $tmp=tmpdir($package);
-       my $file=pkgfile($package,"modules");
+       my $modutils_file=pkgfile($package,"modules");
+       my $modprobe_file=pkgfile($package,"modprobe");
 
        if (! -e $tmp) {
                doit("install","-d",$tmp);
        }
 
-       if ($file) {
+       if ($modutils_file) {
                if (! -e "$tmp/etc/modutils") {
                        doit("install","-d","$tmp/etc/modutils");
                }
-               doit("install","-m","0644",$file,"$tmp/etc/modutils/".pkgfilename($package));
+               doit("install","-m","0644",$modutils_file,"$tmp/etc/modutils/".pkgfilename($package));
        }
 
+       if ($modprobe_file) {
+               if (! -e "$tmp/etc/modprobe.d") {
+                       doit("install","-d","$tmp/etc/modprobe.d");
+               }
+               doit("install","-m","0644",$modprobe_file,"$tmp/etc/modprobe.d/".pkgfilename($package));
+       }
+       
        if (! $dh{NOSCRIPTS} &&
-           ($file || find_kernel_modules("$tmp/lib/modules"))) {
+           ($modutils_file || find_kernel_modules("$tmp/lib/modules"))) {
                        autoscript($package,"postinst","postinst-modules","s/#PACKAGE#/$package/");
                        autoscript($package,"postrm","postrm-modules","s/#PACKAGE#/$package/");
        }
diff --git a/dh_link b/dh_link
index 7c51d06ca0fd8b7e2f95811c51634911e8e5a14c..5dd9da3d96843062dd271e3020c073659d76539c 100755 (executable)
--- a/dh_link
+++ b/dh_link
@@ -76,6 +76,39 @@ the X man page foo.1x
 
 =cut
 
+# This expand_path expands all path "." and ".." components, but doesn't
+# resolve symbolic links.
+sub expand_path {
+       my $start = @_ ? shift : '.';
+       my @pathname = split(m:/+:,$start);
+
+       my $entry;
+       my @respath;
+       foreach $entry (@pathname) {
+               if ($entry eq '.' || $entry eq '') {
+                       # Do nothing
+               }
+               elsif ($entry eq '..') {
+                       if ($#respath == -1) {
+                               # Do nothing
+                       }
+                       else {
+                               pop @respath;
+                       }
+               }
+               else {
+                       push @respath, $entry;
+               }
+       }
+
+       my $result;
+       foreach $entry (@respath) {
+               $result .= '/' . $entry;
+       }
+       return $result;
+}
+
+
 init();
 
 foreach my $package (@{$dh{DOPACKAGES}}) {
@@ -126,9 +159,8 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
        
        while (@links) {
                my $dest=pop @links;
-               my $src=pop @links;
+               my $src=expand_path(pop @links);
 
-               # Relavatize src and dest.
                $src=~s:^/::;
                $dest=~s:^/::;
 
index 11d1adb6a3a0d9502b60a3fd6085a7bedb5083fd..7e19ec7f230d0678d0b125e31882d628557f649b 100755 (executable)
@@ -20,9 +20,7 @@ registering OMF files that it finds in package build trees with
 ScrollKeeper.
 
 This command automatically adds maintainer script snippets for registering
-and unregistering files with ScrollKeeper (unless B<-n> is used). A
-dependency on scrollkeeper will be added to C<${misc:Depends}>, so be sure
-your package uses that variable in F<debian/control>. See
+and unregistering files with ScrollKeeper (unless B<-n> is used). See
 L<dh_installdeb(1)> for an explantion of Debhelper maintainer script
 snippets.
 
@@ -70,8 +68,6 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                                autoscript($package,"postinst","postinst-scrollkeeper");
                                autoscript($package,"postrm","postrm-scrollkeeper");
                        }
-                       # scrollkeeper use xml catalogs so we require 0.3.14-5+.
-                       addsubstvar($package, "misc:Depends", "scrollkeeper", ">= 0.3.14-5");
                }
        }
 }
index 2605801ba4aeed29d59bac33da09369a9a9e08f2..bb05d92369042e24cd44175dc23c06d7c23f45aa 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -52,8 +52,7 @@ Deprecated:
   some of them. I'd also like to deprecate/remove debian/compress files, -X is
   a better idea.
 * dh_suidregister. Once nothing in the archive uses it.
-* dh_installmanpages. Only mildly deprecated right now. Once dh_installman
-  catches on, make it emit a warning, and then wait for it to go away.
+* dh_installmanpages.
 * dh_testversion. Remove as soon as nothing uses it.
 * dh_movefiles. I won't hold my breath.
 * debconf-mergetemplates support and the debian/template.ll files and the
index 3ab345e8b4d48cb31b8e518bfbd4f39597f77ab7..68c7d4e573b488aa8d1b04ea967e71872b2e9070 100755 (executable)
--- a/t/dh_link
+++ b/t/dh_link
@@ -1,16 +1,28 @@
 #!/usr/bin/perl
 use Test;
-plan(tests => 3);
+plan(tests => 7);
 
 # It used to not make absolute links in this situation, and it should.
 # #37774
 system("./dh_link","etc/foo","usr/lib/bar");
-ok("/etc/foo",readlink("debian/debhelper/usr/lib/bar"));
+ok(readlink("debian/debhelper/usr/lib/bar"), "/etc/foo");
 
 # let's make sure it makes simple relative links ok.
 system("./dh_link","usr/bin/foo","usr/bin/bar");
-ok("foo",readlink("debian/debhelper/usr/bin/bar"));
+ok(readlink("debian/debhelper/usr/bin/bar"), "foo");
 
 # ok, more complex relative links.
 system("./dh_link","usr/lib/1","usr/bin/2");
-ok("../lib/1",readlink("debian/debhelper/usr/bin/2"));
+ok(readlink("debian/debhelper/usr/bin/2"),"../lib/1");
+
+# Check conversion of realitive symlink to different top-level directory
+# into absolute symlink. (#244157)
+system("mkdir -p debian/debhelper/usr/lib; mkdir -p debian/debhelper/lib; touch debian/debhelper/lib/libm.so; cd debian/debhelper/usr/lib; ln -sf ../../lib/libm.so");
+system("./dh_link");
+ok(readlink("debian/debhelper/usr/lib/libm.so"), "/lib/libm.so");
+
+# Make sure the link conversion didn't change any of the previously made
+# links.
+ok(readlink("debian/debhelper/usr/lib/bar"), "/etc/foo");
+ok(readlink("debian/debhelper/usr/bin/bar"), "foo");
+ok(readlink("debian/debhelper/usr/bin/2"),"../lib/1");