소스 검색

Set DPKG_MAINTSCRIPT_ARCH env var with the .deb architecture

This allows maintainer scripts to know which architecture the package
got built for.
Guillem Jover 17 년 전
부모
커밋
06b7239212
4개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      debian/changelog
  2. 1 0
      lib/dpkg/dpkg.h
  3. 4 0
      man/dpkg.1
  4. 1 0
      src/help.c

+ 2 - 0
debian/changelog

@@ -33,6 +33,8 @@ dpkg (1.15.4) UNRELEASED; urgency=low
   * Stop macthing sparc64-*-* GNU triplets with sparc Debian architecture.
   * Stop macthing sparc64-*-* GNU triplets with sparc Debian architecture.
   * Add support for config.d style directories in dpkg and dselect,
   * Add support for config.d style directories in dpkg and dselect,
     (/etc/dpkg/dpkg.cfg.d and /etc/dpkg/dselect.cfg.d respectively).
     (/etc/dpkg/dpkg.cfg.d and /etc/dpkg/dselect.cfg.d respectively).
+  * Define DPKG_MAINTSCRIPT_ARCH on the maintainer script environment to the
+    architecture the package got built for.
 
 
   [ Raphael Hertzog ]
   [ Raphael Hertzog ]
   * Replace install-info by a wrapper around GNU's install-info. The wrapper
   * Replace install-info by a wrapper around GNU's install-info. The wrapper

+ 1 - 0
lib/dpkg/dpkg.h

@@ -88,6 +88,7 @@ DPKG_BEGIN_DECLS
 #define MAXUPDATES         250
 #define MAXUPDATES         250
 
 
 #define MAINTSCRIPTPKGENVVAR "DPKG_MAINTSCRIPT_PACKAGE"
 #define MAINTSCRIPTPKGENVVAR "DPKG_MAINTSCRIPT_PACKAGE"
+#define MAINTSCRIPTARCHENVVAR "DPKG_MAINTSCRIPT_ARCH"
 #define MAINTSCRIPTDPKGENVVAR "DPKG_RUNNING_VERSION"
 #define MAINTSCRIPTDPKGENVVAR "DPKG_RUNNING_VERSION"
 
 
 #define NOJOBCTRLSTOPENV    "DPKG_NO_TSTP"
 #define NOJOBCTRLSTOPENV    "DPKG_NO_TSTP"

+ 4 - 0
man/dpkg.1

@@ -609,6 +609,10 @@ The program \fBdpkg\fP will execute when starting a new shell.
 .B COLUMNS
 .B COLUMNS
 Sets the number of columns \fBdpkg\fP should use when displaying formatted
 Sets the number of columns \fBdpkg\fP should use when displaying formatted
 text. Currently only used by \-l.
 text. Currently only used by \-l.
+.TP
+.B DPKG_MAINTSCRIPT_ARCH
+Defined by \fBdpkg\fP on the maintainer script environment to the
+architecture the package got built for.
 .
 .
 .SH EXAMPLES
 .SH EXAMPLES
 To list packages related to the editor \fBvi\fP(1):
 To list packages related to the editor \fBvi\fP(1):

+ 1 - 0
src/help.c

@@ -267,6 +267,7 @@ do_script(struct pkginfo *pkg, struct pkginfoperfile *pif,
     scriptexec= preexecscript(scriptpath,(char * const *)narglist);
     scriptexec= preexecscript(scriptpath,(char * const *)narglist);
     narglist[0]= scriptexec;
     narglist[0]= scriptexec;
     if (setenv(MAINTSCRIPTPKGENVVAR, pkg->name, 1) ||
     if (setenv(MAINTSCRIPTPKGENVVAR, pkg->name, 1) ||
+        setenv(MAINTSCRIPTARCHENVVAR, pif->architecture, 1) ||
         setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
         setenv(MAINTSCRIPTDPKGENVVAR, PACKAGE_VERSION, 1))
       ohshite(_("unable to setenv for maintainer script"));
       ohshite(_("unable to setenv for maintainer script"));
     execv(scriptexec,(char * const *)narglist);
     execv(scriptexec,(char * const *)narglist);