summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoey <joey>1999-10-24 23:19:28 +0000
committerjoey <joey>1999-10-24 23:19:28 +0000
commit85ad35770e541b848bf2954424879318da797b84 (patch)
treee1d2f48403055868092bd2abf0f4bc20d8a3e0f3
parentc134395d8d42e8c3dcf16875b84edb1ed28025a4 (diff)
r294: * Fixed problem with dh_installemacsen options not working, patch from
Rafael Laboissiere <rafael@icp.inpg.fr>, Closes: #47738 * Added new dh_installxfonts script by Changwoo Ryu <cwryu@dor17988.kaist.ac.kr>. Closes: #46684 I made some changes, though: - I rewrote lots of this script to be more my style of perl. - I removed all the verbisity from the postinst script fragment, since that is a clear violation of policy. - I made the postinst fail if the mkfontdir, etc commands fail, because this really makes more sense. Consider idempotency. - I moved the test to see if the font dir is really a directory into the dh_ script and out of the snippet. If the maintainer plays tricks on us, mkfontdir will blow up satisfactorally anyway. - So, the snippet is 9 lines long now, down from 20-some. - I realize this isn't following the reccommendations made in Brandon's font policy. I'll fight it out with him. :-) - In postrm fragment, used rmdir -p to remove as many parent directories as I can. - s:/usr/lib/X11/:/usr/X11R6/lib/X11/:g
-rw-r--r--Dh_Getopt.pm77
-rw-r--r--autoscripts/postinst-xfonts8
-rw-r--r--autoscripts/postrm-xfonts18
-rw-r--r--debian/changelog24
-rwxr-xr-xdh_installxfonts35
-rw-r--r--dh_installxfonts.143
6 files changed, 181 insertions, 24 deletions
diff --git a/Dh_Getopt.pm b/Dh_Getopt.pm
index eb6aef98..9254eb06 100644
--- a/Dh_Getopt.pm
+++ b/Dh_Getopt.pm
@@ -7,12 +7,12 @@
package Dh_Getopt;
use strict;
-use Exporter;
-my @ISA=qw(Exporter);
-my @EXPORT=qw(&parseopts);
-
use Dh_Lib;
use Getopt::Long;
+use Exporter;
+#use vars qw{@ISA @EXPORT};
+#@ISA=qw(Exporter);
+#@EXPORT=qw(&aparseopts); # FIXME: for some reason, this doesn't work.
my (%options, %exclude_package);
@@ -31,6 +31,10 @@ sub AddPackage { my($option,$value)=@_;
elsif ($option eq 'p' or $option eq 'package') {
push @{$options{DOPACKAGES}}, $value;
}
+ elsif ($option eq 's' or $option eq 'same-arch') {
+ push @{$options{DOPACKAGES}}, GetPackages('same');
+ $options{DOSAME}=1;
+ }
else {
error("bad option $option - should never happen!\n");
}
@@ -46,15 +50,10 @@ sub AddExclude { my($option,$value)=@_;
push @{$options{EXCLUDE}},$value;
}
-sub import {
- # Enable bundling of short command line options.
- Getopt::Long::config("bundling");
-}
-
# Parse options and return a hash of the values.
sub parseopts {
undef %options;
-
+
my $ret=GetOptions(
"v" => \$options{VERBOSE},
"verbose" => \$options{VERBOSE},
@@ -68,12 +67,15 @@ sub parseopts {
"p=s" => \&AddPackage,
"package=s" => \&AddPackage,
+ "s" => \&AddPackage,
+ "same-arch" => \&AddPackage,
+
"N=s" => \&ExcludePackage,
"no-package=s" => \&ExcludePackage,
"n" => \$options{NOSCRIPTS},
-# "noscripts" => \$options(NOSCRIPTS},
-
+ "noscripts" => \$options{NOSCRIPTS},
+
"x" => \$options{INCLUDE_CONFFILES}, # is -x for some unknown historical reason..
"include-conffiles" => \$options{INCLUDE_CONFFILES},
@@ -82,6 +84,7 @@ sub parseopts {
"d" => \$options{D_FLAG},
"remove-d" => \$options{D_FLAG},
+ "dirs-only" => \$options{D_FLAG},
"r" => \$options{R_FLAG},
"no-restart-on-upgrade" => \$options{R_FLAG},
@@ -95,6 +98,7 @@ sub parseopts {
"u=s", => \$options{U_PARAMS},
"update-rcd-params=s", => \$options{U_PARAMS},
"dpkg-shlibdeps-params=s", => \$options{U_PARAMS},
+ "dpkg-gencontrol-params=s", => \$options{U_PARAMS},
"m=s", => \$options{M_PARAMS},
"major=s" => \$options{M_PARAMS},
@@ -108,30 +112,38 @@ sub parseopts {
"no-act" => \$options{NO_ACT},
"init-script=s" => \$options{INIT_SCRIPT},
+
+ "sourcedir=s" => \$options{SOURCEDIR},
+
+ "destdir=s" => \$options{DESTDIR},
+
+ "number=s" => \$options{number},
+
+ "flavor=s" => \$options{flavor},
);
if (!$ret) {
error("unknown option; aborting");
}
-
+
# Check to see if -V was specified. If so, but no parameters were
# passed, the variable will be defined but empty.
if (defined($options{V_FLAG})) {
$options{V_FLAG_SET}=1;
}
- # Check to see if DH_VERBOSE environment variable was set, if so,
- # make sure verbose is on.
- if ($ENV{DH_VERBOSE} ne undef) {
- $options{VERBOSE}=1;
+ # If we have not been given any packages to act on, assume they
+ # want us to act on them all. Note we have to do this before excluding
+ # packages out, below.
+ if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
+ if ($options{DOINDEP} || $options{DOARCH} || $options{DOSAME}) {
+ # User specified that all arch (in)dep package be
+ # built, and there are none of that type.
+ error("I have no package to build");
+ }
+ push @{$options{DOPACKAGES}},GetPackages();
}
- # Check to see if DH_NO_ACT environment variable was set, if so,
- # make sure no act mode is on.
- if ($ENV{DH_NO_ACT} ne undef) {
- $options{NO_ACT}=1;
- }
-
# Remove excluded packages from the list of packages to act on.
my @package_list;
my $package;
@@ -141,8 +153,25 @@ sub parseopts {
}
}
@{$options{DOPACKAGES}}=@package_list;
-
+
+ # Generate EXCLUDE_FIND.
+ $options{EXCLUDE_FIND}='';
+ foreach (@{$options{EXCLUDE}}) {
+ $options{EXCLUDE_FIND}.="-regex .*".quotemeta($_).".* -or ";
+ }
+ $options{EXCLUDE_FIND}=~s/ -or $//;
+
+ # If there are no packages to act on now, it's an error.
+ if (! defined $options{DOPACKAGES} || ! @{$options{DOPACKAGES}}) {
+ error("I have no package to build");
+ }
+
return %options;
}
+sub import {
+ # Enable bundling of short command line options.
+ Getopt::Long::config("bundling");
+}
+
1
diff --git a/autoscripts/postinst-xfonts b/autoscripts/postinst-xfonts
new file mode 100644
index 00000000..e3e6a1c6
--- /dev/null
+++ b/autoscripts/postinst-xfonts
@@ -0,0 +1,8 @@
+fontdirs="#FONTDIRS#"
+updatecmds="#UPDATECMDS#"
+
+for dir in $fontdirs; do
+ for currentcmd in $updatecmds; do
+ $currentcmd /usr/X11R6/lib/X11/$dir
+ done
+done
diff --git a/autoscripts/postrm-xfonts b/autoscripts/postrm-xfonts
new file mode 100644
index 00000000..53e2b6db
--- /dev/null
+++ b/autoscripts/postrm-xfonts
@@ -0,0 +1,18 @@
+fontdirs="#FONTDIRS#"
+updatecmds="#UPDATECMDS#"
+
+for currentdir in $fontdirs; do
+ longdir=/usr/X11R6/lib/X11/fonts/$currentdir
+ if [ -d $longdir ]; then
+ for file in fonts.dir fonts.alias; do
+ rm -f $file
+ done
+ if [ $(find $currentdir| wc -l) -eq 1 ]; then
+ rmdir -p $longdir
+ else
+ for currentcmd in $updatecmds; do
+ $currentcmd $longdir
+ done
+ fi
+ fi
+done
diff --git a/debian/changelog b/debian/changelog
index f0346307..b412a952 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,27 @@
+debhelper (2.0.62) unstable; urgency=low
+
+ * Fixed problem with dh_installemacsen options not working, patch from
+ Rafael Laboissiere <rafael@icp.inpg.fr>, Closes: #47738
+ * Added new dh_installxfonts script by Changwoo Ryu
+ <cwryu@dor17988.kaist.ac.kr>. Closes: #46684
+ I made some changes, though:
+ - I rewrote lots of this script to be more my style of perl.
+ - I removed all the verbisity from the postinst script fragment, since
+ that is a clear violation of policy.
+ - I made the postinst fail if the mkfontdir, etc commands fail, because
+ this really makes more sense. Consider idempotency.
+ - I moved the test to see if the font dir is really a directory into the
+ dh_ script and out of the snippet. If the maintainer plays tricks on
+ us, mkfontdir will blow up satisfactorally anyway.
+ - So, the snippet is 9 lines long now, down from 20-some.
+ - I realize this isn't following the reccommendations made in Brandon's
+ font policy. I'll fight it out with him. :-)
+ - In postrm fragment, used rmdir -p to remove as many parent directories
+ as I can.
+ - s:/usr/lib/X11/:/usr/X11R6/lib/X11/:g
+
+ -- Joey Hess <joeyh@master.debian.org> Sun, 24 Oct 1999 15:30:53 -0700
+
debhelper (2.0.61) unstable; urgency=low
* Clarified rules.multi2 comment. Closes: #46828
diff --git a/dh_installxfonts b/dh_installxfonts
new file mode 100755
index 00000000..e1a46aab
--- /dev/null
+++ b/dh_installxfonts
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+#
+# Integration with the Debian X11 font policy.
+
+BEGIN { push @INC, "debian", "/usr/share/debhelper" }
+use Dh_Lib;
+init();
+
+foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
+ $TMP=tmpdir($PACKAGE);
+
+ # Find all fint directories in the package build directory.
+ opendir DIR, "$TMP/usr/X11R6/lib/X11/fonts/" || next;
+ my @fontdirs = grep { -d $_ && !/^\./ } (readdir DIR);
+ closedir DIR;
+
+ if (@fontdirs) {
+ # Figure out what commands the postinst will need to call.
+ my @updatecmds=('/usr/bin/X11/mkfontdir');
+ foreach my $f (@fontdirs) {
+ push @updatecmds, '/usr/sbin/update-fonts-alias'
+ if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.alias";
+ # This must come _before_ mkfontdir, thus the unshift.
+ unshift @updatecmds, '/usr/sbin/update-fonts-scale'
+ if -f "$TMP/etc/X11/fonts/$f/$PACKAGE.scale";
+ }
+
+ autoscript($PACKAGE, "postinst", "postinst-xfonts",
+ "s:#FONTDIRS#:".join(' ', @fontdirs).
+ ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");
+ autoscript($PACKAGE, "postrm", "postrm-xfonts",
+ "s:#FONTDIRS#:".join(' ', @fontdirs).
+ ":;s:#UPDATECMDS#:".join(' ', @updatecmds).":");
+ }
+}
diff --git a/dh_installxfonts.1 b/dh_installxfonts.1
new file mode 100644
index 00000000..464fd8fb
--- /dev/null
+++ b/dh_installxfonts.1
@@ -0,0 +1,43 @@
+.TH DH_INSTALLXFONTS 1 "" "Debhelper Commands" "Debhelper Commands"
+.SH NAME
+dh_installxfonts \- register X fonts
+.SH SYNOPSIS
+.B dh_installxfonts
+.I "[debhelper options]"
+.SH "DESCRIPTION"
+dh_installxfonts is a debhelper program that is responsible for
+registering X fonts, so their corresponding fonts.dir, fonts.alias,
+and fonts.scale be rebuilt properly at install time.
+.P
+Before calling this program, you should have installed any X fonts
+provided by your package into the appropriate location in the package build
+directory. Also, your package should depend on xbase-clients (>= 3.3.3.1-5).
+.P
+It automatically generates the postinst and postrm commands needed to
+register X fonts. See
+.BR dh_installdeb (1)
+for an explanation of how this works.
+.SH OPTIONS
+.TP
+.B debhelper options
+See
+.BR debhelper (1)
+for a list of options common to all debhelper commands.
+.SH NOTES
+See
+.BR update-fonts-alias (8)
+,
+.BR update-fonts-scale (8)
+and
+.BR mkfontdir (1x)
+for more information about X font installation.
+.SH ENVIRONMENT
+See
+.BR debhelper (1)
+for a list of environment variables that affect all debhelper commands.
+.SH "SEE ALSO"
+.BR debhelper (1)
+.BR update-fonts-alias (8)
+.BR update-fonts-scale (8)
+.SH AUTHOR
+Changwoo Ryu <cwryu@debian.org>