Explorar el Código

Rename /usr/lib/dpkg/maintscript-helper in /usr/bin/dpkg-maintscript-helper

It is a public interface even if working around known limitations.
Raphaël Hertzog hace 16 años
padre
commit
aa26f83c4b

+ 3 - 0
debian/changelog

@@ -23,6 +23,9 @@ dpkg (1.15.7.2) UNRELEASED; urgency=low
     to match the new location. Closes: #580774
   * Drop mention of PKG_CONFIG_LIBDIR in dpkg-buildpackage(1), the feature has
     been removed in 1.15.6.
+  * Rename /usr/lib/dpkg/maintscript-helper into
+    /usr/bin/dpkg-maintscript-helper, it is a public interface even if working
+    around known limitations.
 
   [ Guillem Jover ]
   * Add powerpcspe support to ostable and triplettable.

+ 2 - 2
debian/dpkg.install

@@ -6,25 +6,25 @@ etc/alternatives
 usr/bin/dpkg
 usr/bin/dpkg-deb
 usr/bin/dpkg-divert
+usr/bin/dpkg-maintscript-helper
 usr/bin/dpkg-query
 usr/bin/dpkg-split
 usr/bin/dpkg-statoverride
 usr/bin/dpkg-trigger
 usr/bin/update-alternatives
-usr/lib/dpkg/maintscript-helper
 usr/lib/dpkg/mksplit
 usr/sbin
 usr/share/dpkg
 usr/share/locale/*/LC_MESSAGES/dpkg.mo
 usr/share/man/{*/*,*}/dpkg-deb.1
 usr/share/man/{*/*,*}/dpkg-divert.8
+usr/share/man/{*/*,*}/dpkg-maintscript-helper.1
 usr/share/man/{*/*,*}/dpkg-query.1
 usr/share/man/{*/*,*}/dpkg-split.1
 usr/share/man/{*/*,*}/dpkg-statoverride.8
 usr/share/man/{*/*,*}/dpkg-trigger.1
 usr/share/man/{*/*,*}/dpkg.cfg.5
 usr/share/man/{*/*,*}/dpkg.1
-usr/share/man/{*/*,*}/maintscript-helper.1
 usr/share/man/{*/*,*}/start-stop-daemon.8
 usr/share/man/{*/*,*}/update-alternatives.8
 usr/share/perl5/Dpkg.pm

+ 2 - 2
man/Makefile.am

@@ -106,6 +106,7 @@ dist_man_MANS = \
 	dpkg-genchanges.1 \
 	dpkg-gencontrol.1 \
 	dpkg-gensymbols.1 \
+	dpkg-maintscript-helper.1 \
 	dpkg-mergechangelogs.1 \
 	dpkg-name.1 \
 	dpkg-parsechangelog.1 \
@@ -119,8 +120,7 @@ dist_man_MANS = \
 	dpkg-trigger.1 \
 	dpkg-vendor.1 \
 	dpkg.1 \
-	dpkg.cfg.5 \
-	maintscript-helper.1
+	dpkg.cfg.5
 
 if WITH_DSELECT
 dist_man_MANS += \

+ 10 - 13
man/maintscript-helper.1

@@ -1,9 +1,9 @@
-.TH maintscript\-helper 1 "2010-04-16" "Debian Project" "dpkg suite"
+.TH dpkg\-maintscript\-helper 1 "2010-04-16" "Debian Project" "dpkg suite"
 .SH NAME
-maintscript\-helper \- works around known dpkg limitations in maintainer scripts
+dpkg\-maintscript\-helper \- works around known dpkg limitations in maintainer scripts
 .
 .SH SYNOPSIS
-.B $DPKG_LIBDIR/maintscript\-helper
+.B dpkg\-maintscript\-helper
 .IR command " [" parameters "...] \-\- " maint-script-parameters
 .
 .SH COMMANDS AND PARAMETERS
@@ -37,8 +37,9 @@ dpkg\-maintained conffile to a file maintained by the package's maintainer
 scripts, usually with a tool like debconf or ucf.
 .P
 This means that if a package is intended to rename or remove a conffile,
-it must explicitly do so and \fBmaintscript\-helper\fP can be used to implement
-graceful deletion and moving of conffiles within maintainer scripts.
+it must explicitly do so and \fBdpkg\-maintscript\-helper\fP can be used
+to implement graceful deletion and moving of conffiles within maintainer
+scripts.
 .
 .SS REMOVING A CONFFILE
 .P
@@ -50,10 +51,8 @@ conffile should not disappear.
 All of this is implemented by putting the following shell snippet in the
 \fBpreinst\fP, \fBpostinst\fP and \fBpostrm\fP maintainer scripts:
 .P
-    if [ \-x $DPKG_LIBDIR/maintscript\-helper ]; then
-        $DPKG_LIBDIR/maintscript\-helper rm_conffile \\
-            \fIconffile\fP \fIlastversion\fP \fIpackage\fP \-\- "$@"
-    fi
+    dpkg\-maintscript\-helper rm_conffile \\
+        \fIconffile\fP \fIlastversion\fP \fIpackage\fP \-\- "$@"
 .P
 \fIconffile\fP is the filename of the conffile to remove.
 \fIlastversion\fP is the last version of the package that contained the
@@ -82,10 +81,8 @@ Graceful renaming can be implemented by putting the following shell
 snippet in the \fBpreinst\fP, \fBpostinst\fP and \fBpostrm\fP maintainer
 scripts:
 .P
-    if [ \-x $DPKG_LIBDIR/maintscript\-helper ]; then
-        $DPKG_LIBDIR/maintscript\-helper mv_conffile \\
-            \fIoldconffile\fP \fInewconffile\fP \fIlastversion\fP \fIpackage\fP \-\- "$@"
-    fi
+    dpkg\-maintscript\-helper mv_conffile \\
+        \fIoldconffile\fP \fInewconffile\fP \fIlastversion\fP \fIpackage\fP \-\- "$@"
 .P
 \fIoldconffile\fP and \fInewconffile\fP are the old and new name of the
 conffile to rename. \fIlastversion\fP is the last version of the package

+ 5 - 5
man/po/po4a.cfg

@@ -128,6 +128,11 @@
            add_$lang:po/$lang.add
 
 
+[type:man] dpkg-maintscript-helper.1  \
+           $lang:$(builddir)/$lang/dpkg-maintscript-helper.1 \
+           add_$lang:po/$lang.add
+
+
 [type:man] dpkg-mergechangelogs.1     \
            $lang:$(builddir)/$lang/dpkg-mergechangelogs.1   \
            add_$lang:po/$lang.add
@@ -198,11 +203,6 @@
            add_$lang:po/$lang.add
 
 
-[type:man] maintscript-helper.1       \
-           $lang:$(builddir)/$lang/maintscript-helper.1     \
-           add_$lang:po/$lang.add
-
-
 [type:man] start-stop-daemon.8        \
            $lang:$(builddir)/$lang/start-stop-daemon.8      \
            add_$lang:po/$lang.add

+ 1 - 0
scripts/.gitignore

@@ -7,6 +7,7 @@ dpkg-divert
 dpkg-genchanges
 dpkg-gencontrol
 dpkg-gensymbols
+dpkg-maintscript-helper
 dpkg-mergechangelogs
 dpkg-name
 dpkg-parsechangelog

+ 9 - 2
scripts/Makefile.am

@@ -12,6 +12,7 @@ bin_SCRIPTS = \
 	dpkg-genchanges \
 	dpkg-gencontrol \
 	dpkg-gensymbols \
+	dpkg-maintscript-helper \
 	dpkg-mergechangelogs \
 	dpkg-name \
 	dpkg-parsechangelog \
@@ -25,8 +26,6 @@ if WITH_UPDATE_ALTERNATIVES
 bin_SCRIPTS += update-alternatives
 endif
 
-dist_pkglib_SCRIPTS = maintscript-helper
-
 changelogdir = $(pkglibdir)/parsechangelog
 changelog_SCRIPTS = \
 	changelog/debian
@@ -41,6 +40,7 @@ EXTRA_DIST = \
 	dpkg-genchanges.pl \
 	dpkg-gencontrol.pl \
 	dpkg-gensymbols.pl \
+	dpkg-maintscript-helper.sh \
 	dpkg-mergechangelogs.pl \
 	dpkg-name.pl \
 	dpkg-parsechangelog.pl \
@@ -123,12 +123,19 @@ do_perl_subst = $(AM_V_GEN) \
 		    -e "s:\$$admindir[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$admindir=\"$(admindir)\":" \
 		    -e "s:\$$version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:\$$version=\"$(PACKAGE_VERSION)\":"
 
+do_shell_subst = $(AM_V_GEN) \
+		 sed -e "s:\$$version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:\$$version=\"$(PACKAGE_VERSION)\":"
 
 %: %.pl Makefile
 	@test -d `dirname $@` || $(mkdir_p) `dirname $@`
 	$(do_perl_subst) <$< >$@
 	$(AM_V_at) chmod +x $@
 
+%: %.sh Makefile
+	@test -d `dirname $@` || $(mkdir_p) `dirname $@`
+	$(do_shell_subst) <$< >$@
+	$(AM_V_at) chmod +x $@
+
 install-data-local:
 if BUILD_POD_DOC
 # Install manual pages for perl modules manually as make can't deal

+ 1 - 1
scripts/maintscript-helper

@@ -21,7 +21,7 @@
 # The conffile related functions are inspired by
 # http://wiki.debian.org/DpkgConffileHandling
 
-# This script is documented in maintscript-helper(1)
+# This script is documented in dpkg-maintscript-helper(1)
 
 ##
 ## Functions to remove an obsolete conffile during upgrade