Quellcode durchsuchen

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 vor 16 Jahren
Ursprung
Commit
aa26f83c4b
8 geänderte Dateien mit 33 neuen und 25 gelöschten Zeilen
  1. 3 0
      debian/changelog
  2. 2 2
      debian/dpkg.install
  3. 2 2
      man/Makefile.am
  4. 10 13
      man/maintscript-helper.1
  5. 5 5
      man/po/po4a.cfg
  6. 1 0
      scripts/.gitignore
  7. 9 2
      scripts/Makefile.am
  8. 1 1
      scripts/maintscript-helper

+ 3 - 0
debian/changelog

@@ -23,6 +23,9 @@ dpkg (1.15.7.2) UNRELEASED; urgency=low
     to match the new location. Closes: #580774
     to match the new location. Closes: #580774
   * Drop mention of PKG_CONFIG_LIBDIR in dpkg-buildpackage(1), the feature has
   * Drop mention of PKG_CONFIG_LIBDIR in dpkg-buildpackage(1), the feature has
     been removed in 1.15.6.
     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 ]
   [ Guillem Jover ]
   * Add powerpcspe support to ostable and triplettable.
   * Add powerpcspe support to ostable and triplettable.

+ 2 - 2
debian/dpkg.install

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

+ 2 - 2
man/Makefile.am

@@ -106,6 +106,7 @@ dist_man_MANS = \
 	dpkg-genchanges.1 \
 	dpkg-genchanges.1 \
 	dpkg-gencontrol.1 \
 	dpkg-gencontrol.1 \
 	dpkg-gensymbols.1 \
 	dpkg-gensymbols.1 \
+	dpkg-maintscript-helper.1 \
 	dpkg-mergechangelogs.1 \
 	dpkg-mergechangelogs.1 \
 	dpkg-name.1 \
 	dpkg-name.1 \
 	dpkg-parsechangelog.1 \
 	dpkg-parsechangelog.1 \
@@ -119,8 +120,7 @@ dist_man_MANS = \
 	dpkg-trigger.1 \
 	dpkg-trigger.1 \
 	dpkg-vendor.1 \
 	dpkg-vendor.1 \
 	dpkg.1 \
 	dpkg.1 \
-	dpkg.cfg.5 \
-	maintscript-helper.1
+	dpkg.cfg.5
 
 
 if WITH_DSELECT
 if WITH_DSELECT
 dist_man_MANS += \
 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
 .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
 .SH SYNOPSIS
-.B $DPKG_LIBDIR/maintscript\-helper
+.B dpkg\-maintscript\-helper
 .IR command " [" parameters "...] \-\- " maint-script-parameters
 .IR command " [" parameters "...] \-\- " maint-script-parameters
 .
 .
 .SH COMMANDS AND 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.
 scripts, usually with a tool like debconf or ucf.
 .P
 .P
 This means that if a package is intended to rename or remove a conffile,
 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
 .SS REMOVING A CONFFILE
 .P
 .P
@@ -50,10 +51,8 @@ conffile should not disappear.
 All of this is implemented by putting the following shell snippet in the
 All of this is implemented by putting the following shell snippet in the
 \fBpreinst\fP, \fBpostinst\fP and \fBpostrm\fP maintainer scripts:
 \fBpreinst\fP, \fBpostinst\fP and \fBpostrm\fP maintainer scripts:
 .P
 .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
 .P
 \fIconffile\fP is the filename of the conffile to remove.
 \fIconffile\fP is the filename of the conffile to remove.
 \fIlastversion\fP is the last version of the package that contained the
 \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
 snippet in the \fBpreinst\fP, \fBpostinst\fP and \fBpostrm\fP maintainer
 scripts:
 scripts:
 .P
 .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
 .P
 \fIoldconffile\fP and \fInewconffile\fP are the old and new name of the
 \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
 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
            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     \
 [type:man] dpkg-mergechangelogs.1     \
            $lang:$(builddir)/$lang/dpkg-mergechangelogs.1   \
            $lang:$(builddir)/$lang/dpkg-mergechangelogs.1   \
            add_$lang:po/$lang.add
            add_$lang:po/$lang.add
@@ -198,11 +203,6 @@
            add_$lang:po/$lang.add
            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        \
 [type:man] start-stop-daemon.8        \
            $lang:$(builddir)/$lang/start-stop-daemon.8      \
            $lang:$(builddir)/$lang/start-stop-daemon.8      \
            add_$lang:po/$lang.add
            add_$lang:po/$lang.add

+ 1 - 0
scripts/.gitignore

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

+ 9 - 2
scripts/Makefile.am

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