Hello all,<br><br>Below you will find a patch created by myself and Ryan Bradetich for proposal/evaluation/submission.&nbsp; The patch adds 2 new features and one small proposed fix to pbuilder-0.155<br><br>1) Cross-compiling support:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; An arch parameter has been added to pbuilder (pbuilder-checkparams and pbuilder-satisfydepends) to allow a user to specify the architecture a package is being built for.&nbsp; The arch parameter is used in pbuilder-satisfydepends to allow the installation of the correct build-dependencies for cross-compiling.&nbsp; Specifically, the packages that have been dpkg-cross&#39;ed.&nbsp; The dependencies are now checked in the following order:&nbsp; cross-&gt;normal-&gt;provides&nbsp; This change does not determine if a package &#39;should&#39; be dpkg-cross&#39;ed to work, just for the existance of it.&nbsp; We allow the package to fail during build if the appropriate packages were not dpkg-cross&#39;ed.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; We have been very successful using this as a method to get pbuilder to cross-compile for our powerpc target.&nbsp; Now if only the packages themselves would work as nicely during cross-compile ^_^<br><br>2) Pre-build command execution:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is a small feature addition.&nbsp; The feature allows any command to be run immediately before dpkg-buildpackage.&nbsp; This allows slightly different functionality from a hook.&nbsp; In our particular case, it allows the use of tools such as Rational Clearaudit which is a shell that records file-access during the session, for metric purposes.&nbsp; However, we feel the command may be used more generically.&nbsp; Just yesterday we found that this provides us a way to use pbuilder to generate gcc cross-compilers directly from the source packages.&nbsp; Normally one would have to unpack the sources and set the debian/target file to the appropriate architecture and then build.&nbsp; With this patch we can execute &quot;export GCC_TARGET; debian/rules control;&quot; from pbuilder parameters and not have to mess with the debian/target file.&nbsp; 
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The appropriate lines are in pbuilder-buildpackage and pbuilder-checkparams.&nbsp; One note would be that we left the &#39;;&#39; out after the $PRE_BUILDPKG variables in pbuilder-buildpackage intentionally.&nbsp; Users can still add the &#39;;&#39; in the parameter, however this implementation allows the dpkg-buildpackage lines to be passed as arguments to the user specified command. (namely, our audit shell)
<br><br>3) LOGNAME warnings:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Our proposed solution is the addition of &quot;export LOGNAME=$BUILDUSERNAME;&quot; to the 3 lines in pbuilder-buildpackage, seen below.&nbsp; BUILDUSERNAME appears to always be set to either root or the build user, so it appears to be a safe command.&nbsp; This eliminates all the warnings that LOGNAME is not set. 
<br><br>The whole patch set has been in use by us for several weeks for use in building packages for i386 and powerpc.&nbsp; If you have any points of discussion or questions, I would be happy to field them.&nbsp; <br><br>Have a day,
<br><br>Eugene T. Bordenkircher<br><br>pbuilder_arch_prebuild.patch<br>--------------------<br><br><span style="font-family: courier new,monospace;">diff -Naur pbuilder-0.155ubuntu3.orig/pbuilder-buildpackage pbuilder-0.155ubuntu3
/pbuilder-buildpackage</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">--- pbuilder-0.155ubuntu3.orig/pbuilder-buildpackage&nbsp;&nbsp;&nbsp; 2006-06-17 03:28:03.000000000 -0700</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+++ pbuilder-0.155ubuntu3/pbuilder-buildpackage&nbsp;&nbsp;&nbsp; 2007-04-23 11:27:34.000000000 -0700</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">@@ -106,7 +106,7 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;pbuilder: Failed chowning to $BUILDUSERNAME:$BUILDUSERNAME&quot; &gt;&amp;2 
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; exit 1;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-if echo &quot;( cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )&quot; | $CHROOTEXEC $SUTOUSER ; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+if echo &quot;( export LOGNAME=$BUILDUSERNAME; cd tmp/buildd; /usr/bin/dpkg-source -x $(basename $PACKAGENAME) )&quot; | $CHROOTEXEC $SUTOUSER ; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; : # success</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;pbuilder: Failed extracting the source&quot; &gt;&amp;2 </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">@@ -118,9 +118,9 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;executehooks &quot;A&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;if [ -z &quot;$DEBEMAIL&quot; ]; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; DPKG_COMMANDLINE=&quot;cd tmp/buildd/*/; dpkg-buildpackage -us -uc $DEBBUILDOPTS&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp; DPKG_COMMANDLINE=&quot;export LOGNAME=$BUILDUSERNAME; cd tmp/buildd/*/; $PRE_BUILDPKG dpkg-buildpackage -us -uc $DEBBUILDOPTS&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; DPKG_COMMANDLINE=&quot;cd tmp/buildd/*/; dpkg-buildpackage -us -uc&nbsp; \&quot;-m$DEBEMAIL\&quot; $DEBBUILDOPTS&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; DPKG_COMMANDLINE=&quot;export LOGNAME=$BUILDUSERNAME; cd tmp/buildd/*/; $PRE_BUILDPKG dpkg-buildpackage -us -uc&nbsp; \&quot;-m$DEBEMAIL\&quot; $DEBBUILDOPTS&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;(</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">diff -Naur pbuilder-0.155ubuntu3.orig
/pbuilder-buildpackage-funcs pbuilder-0.155ubuntu3/pbuilder-buildpackage-funcs</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">--- pbuilder-0.155ubuntu3.orig/pbuilder-buildpackage-funcs&nbsp;&nbsp;&nbsp; 2006-06-17 03:28:
04.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+++ pbuilder-0.155ubuntu3/pbuilder-buildpackage-funcs&nbsp;&nbsp;&nbsp; 2007-04-23 12:53:29.000000000 -0700</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -37,7 +37,8 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; yes) BUILDOPT=&quot;--binary-arch&quot;;;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; *) ;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; esac
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; if /usr/lib/pbuilder/pbuilder-satisfydepends --control &quot;$1&quot; --internal-chrootexec &quot;${CHROOTEXEC}&quot; &quot;${BUILDOPT}&quot; ; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; if /usr/lib/pbuilder/pbuilder-satisfydepends --control &quot;$1&quot; --internal-chrootexec &quot;${CHROOTEXEC}&quot; &quot;${BUILDOPT}&quot; ${ARCH:+--arch &quot;${ARCH}&quot;}; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; else
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; # If asked to preserve the build place, and pbuilder-satisfydepends</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">diff -Naur pbuilder-0.155ubuntu3.orig/pbuilder-checkparams pbuilder-0.155ubuntu3/pbuilder-checkparams</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
--- pbuilder-0.155ubuntu3.orig/pbuilder-checkparams&nbsp;&nbsp;&nbsp; 2006-06-17 03:28:03.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+++ pbuilder-0.155ubuntu3/pbuilder-checkparams&nbsp;&nbsp;&nbsp; 2007-04-23 13:10:
45.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -32,6 +32,8 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;PBUILDER_BUILD_LOGFILE=</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;USE_PKGNAME_LOGFILE=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;PRESERVE_BUILDPLACE=&quot;no&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+ARCH=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+PRE_BUILDPKG=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;unset EXTRA_CONFIGFILE || true</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;PBUILDER_DEBUGMODE=</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;SAVE_AFTER_LOGIN=</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
@@ -189,6 +191,17 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SAVE_AFTER_LOGIN=yes;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shift;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --arch)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Specify the arch for Cross-Compiling.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ARCH=&quot;$2&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; shift; shift;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; --pre-build)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # Specify the command to get run immediately </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # before dpkg-buildpackage
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PRE_BUILDPKG=&quot;$2&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shift; shift;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; ## internal options.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; --internal-chrootexec)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # specify custom chrootexec function -- this is internal debugging function</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">diff -Naur pbuilder-0.155ubuntu3.orig
/pbuilder-modules pbuilder-0.155ubuntu3/pbuilder-modules</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">--- pbuilder-0.155ubuntu3.orig/pbuilder-modules&nbsp;&nbsp;&nbsp; 2006-06-17 03:28:
03.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+++ pbuilder-0.155ubuntu3/pbuilder-modules&nbsp;&nbsp;&nbsp; 2007-04-23 12:49:44.000000000 -0700</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">@@ -75,6 +75,8 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; --debootstrapopts [debootstrap options]</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp; --save-after-login/--save-after-exec</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; --debootstrap [debootstrap|cdebootstrap]
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+ --arch [cross-compile architecture]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+ --pre-build [command(s) to run immediately before dpkg-buildpackage]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;pdebuild-specific pbuilder-options:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp; --pbuilderroot [command to obtain root privilege for pbuilder] 
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">diff -Naur pbuilder-0.155ubuntu3.orig/pbuilder-satisfydepends pbuilder-0.155ubuntu3/pbuilder-satisfydepends</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">--- pbuilder-0.155ubuntu3.orig/pbuilder-satisfydepends&nbsp;&nbsp;&nbsp; 2006-06-17 03:28:02.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+++ pbuilder-0.155ubuntu3/pbuilder-satisfydepends&nbsp;&nbsp;&nbsp; 2007-04-23 13:51:58.000000000 -0700</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -86,7 +86,6 @@</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;function checkbuilddep_internal () {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;# Use this function to fulfill the dependency (almost)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; local ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; local INSTALLPKG</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; local INSTALLPKGLIST</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; local INSTALLPKGMULTI</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
@@ -125,37 +124,46 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp; -&gt; Trying ${CURRENTREALPKGNAME}&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${CURRENTREALPKGNAME} &gt;&amp; /dev/null; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SATISFIED=&quot;yes&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; INSTALLPKGLIST=&quot;${INSTALLPKGLIST} ${CURRENTREALPKGNAME}&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Cannot install ${CURRENTREALPKGNAME}; apt errors follow:&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} &quot;${CURRENTREALPKGNAME}&quot;; then</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fi
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # package could not be found. -- looking for alternative.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; PROVIDED=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; checkbuilddep_provides &quot;${CURRENTREALPKGNAME}&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if [ -n &quot;$PROVIDED&quot; ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # something provides this package</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Considering $PROVIDED to satisfy the dependency &quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${PROVIDED} &gt;&amp; /dev/null; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SATISFIED=&quot;yes&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; INSTALLPKGLIST=&quot;${INSTALLPKGLIST} ${PROVIDED}&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # show the error for diagnostic purposes</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Cannot install $PROVIDED; apt errors follow:&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${PROVIDED}; then</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ &quot;${ARCH}&quot; != &quot;${HOST_ARCH}&quot; ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp; -&gt; Trying ${CURRENTREALPKGNAME}-${ARCH}-cross&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${CURRENTREALPKGNAME}-${ARCH}-cross &gt;&amp; /dev/null; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SATISFIED=&quot;yes&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSTALLPKGLIST=&quot;${INSTALLPKGLIST} ${CURRENTREALPKGNAME}-${ARCH}-cross&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp; -&gt; Trying ${CURRENTREALPKGNAME}&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${CURRENTREALPKGNAME} &gt;&amp; /dev/null; then
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SATISFIED=&quot;yes&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSTALLPKGLIST=&quot;${INSTALLPKGLIST} ${CURRENTREALPKGNAME}&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Cannot install ${CURRENTREALPKGNAME}; apt errors follow:&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} &quot;${CURRENTREALPKGNAME}&quot;; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # package could not be found. -- looking for alternative.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROVIDED=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; checkbuilddep_provides &quot;${CURRENTREALPKGNAME}&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ -n &quot;$PROVIDED&quot; ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # something provides this package</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Considering $PROVIDED to satisfy the dependency &quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${PROVIDED} &gt;&amp; /dev/null; then</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SATISFIED=&quot;yes&quot;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSTALLPKGLIST=&quot;${INSTALLPKGLIST} ${PROVIDED}&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # show the error for diagnostic purposes
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt; Cannot install $PROVIDED; apt errors follow:&quot;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if $CHROOTEXEC /usr/bin/apt-get -s install ${INSTALLPKGLIST} ${PROVIDED}; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-&nbsp;&nbsp;&nbsp; if [ &quot;$SATISFIED&quot; = &quot;yes&quot; ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ &quot;$SATISFIED&quot; = &quot;no&quot; ]; then</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; echo &quot;E: Could not satisfy build-dependency.&quot; &gt;&amp;2
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -230,6 +238,7 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;Copyright 2002-2006&nbsp; Junichi Uekawa &lt;<a href="mailto:dancer@debian.org">dancer@debian.org</a>&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;--help:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; give help</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+--arch:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; specify the architecture to build for (cross-compile)
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;--control:&nbsp;&nbsp;&nbsp;&nbsp; specify control file (debian/control, *.dsc)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;--chroot:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; operate inside chroot</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;--binary-all:&nbsp; include binary-all</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">@@ -241,7 +250,8 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;EOF</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;}</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
-</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;DEBIAN_CONTROL=debian/control</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;CHROOTEXEC=&quot;&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;BD_REGEXP=&quot;build-(depends|depends-indep)&quot;
</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">@@ -252,6 +262,10 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;while [ -n &quot;$1&quot; ]; do</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; case &quot;$1&quot; in</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; --arch|-a)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ARCH=&quot;$2&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shift; shift</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
+&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ;;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; --control|-c)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; DEBIAN_CONTROL=&quot;$2&quot;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; shift; shift</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
@@ -293,5 +307,4 @@</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp; esac</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;done</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-</span>
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;checkbuilddep_internal</span><br>