[jamming] unexplained $(LOCATE) behavior

Paul Forgey paulf at metainfo.com
Mon May 17 15:50:27 PDT 2004


For reasons that are completely beyond me, $(LOCATE) appears to be 
prepended to $(2) during a certain action.  Why?? Here's a simplified 
excerpt from my Jamfile with the output.

You can see $(2) is debug/debug/fpd-pkgtmp when the action is executed. 
  I can even comment out all the rules except MakeLocate, Depends and 
MkDir in Dpkg1 with the same result, so the intermediate rules don't 
seem to be causing something unexpected.

rule FPackageFile
{
     # XXX assumes i386
     local BUGFIX ;
     if $(DEBUG) {
         BUGFIX = $(VERSION[3])d ;
     }
     else {
         BUGFIX = $(VERSION[3]) ;
     }
     return $(1)_$(VERSION[1]).$(VERSION[2]).$(BUGFIX)_i386.deb ;
}

rule FPackageTmp
{
     return [ FDirName $(LOCATE_TARGET) $(1)-pkgtmp ] ;
}

rule DebControlFiles
{
     local _debdir = [ FDirName $(2) DEBIAN ] ;
     local _debfiles = [ on $(1) return $(DPKGCONTROL) ] ;
     local _f ;
     local _ff ;

     MkDir $(_debdir:G=dir) ;

     for _f in $(_debfiles) {
         _ff = $(_f:D=$(_debdir)) ;

         Depends $(1) : $(_ff) ;
         Depends $(_ff) : $(_debdir:G=dir) ;
         Clean clean : $(_ff) ;
         File $(_ff) : $(_f) ;
         MODE on $(_ff) = $(SHELLMODE) ;
     }
}

rule Dpkg1
{
Echo "1=" $(1) "2=" $(2) ;
     MakeLocate $(1) : $(LOCATE_TARGET) ;
     Depends exe : $(1) ;
     MkDir $(2:G=dir) ;
     Depends $(1) : $(2:G=dir) ;
     DPKGCONTROL on $(1) ?= $(DPKGCONTROL) ;
     BuildNum control : control.bh ;
     Clean clean : $(1) ;
     DebControlFiles $(1) : $(2) ;

Echo "SEARCH=" [ on $(1) return $(SEARCH) ] ;
}

actions Dpkg1
{
     fakeroot -- dpkg -b $(2) $(1)
}

rule Dpkg
{
     Dpkg1 [ FPackageFile $(1) ] : [ FPackageTmp $(1) ] ;
}

1= fpd_6.0.1d_i386.deb 2= debug/fpd-pkgtmp
SEARCH=
...found 19 target(s)...
...updating 8 target(s)...
MkDir1 debug

mkdir debug

MkDir1 debug/fpd-pkgtmp

mkdir debug/fpd-pkgtmp

MkDir1 debug/fpd-pkgtmp/DEBIAN

mkdir debug/fpd-pkgtmp/DEBIAN

BuildNum debug/control

     sh ../../../scripts/buildedit.sh ../../../buildnum 6 0 1 < 
control.bh > debug/control

File debug/fpd-pkgtmp/DEBIAN/control

cp -f debug/control debug/fpd-pkgtmp/DEBIAN/control

Chmod1 debug/fpd-pkgtmp/DEBIAN/control

chmod 755 debug/fpd-pkgtmp/DEBIAN/control

File debug/fpd-pkgtmp/DEBIAN/prerm

cp -f prerm debug/fpd-pkgtmp/DEBIAN/prerm

Chmod1 debug/fpd-pkgtmp/DEBIAN/prerm

chmod 755 debug/fpd-pkgtmp/DEBIAN/prerm

File debug/fpd-pkgtmp/DEBIAN/postinst

cp -f postinst debug/fpd-pkgtmp/DEBIAN/postinst

Chmod1 debug/fpd-pkgtmp/DEBIAN/postinst

chmod 755 debug/fpd-pkgtmp/DEBIAN/postinst

warning: using independent target debug/fpd-pkgtmp
Dpkg1 debug/fpd_6.0.1d_i386.deb

     fakeroot -- dpkg -b debug/debug/fpd-pkgtmp debug/fpd_6.0.1d_i386.deb
                         ^^^^^^^^^^^^^^^^^^^^^^

dpkg-deb: failed to open package info file 
`debug/debug/fpd-pkgtmp/DEBIAN/control' for reading: No such file or 
directory
...failed Dpkg1 debug/fpd_6.0.1d_i386.deb ...
...failed updating 1 target(s)...
...updated 7 target(s)...




More information about the jamming mailing list