new sfa tag
[build.git] / build.common
index b1530ac..36d363e 100644 (file)
@@ -72,15 +72,22 @@ function pl_yumexclude () {
     keyword=$1; shift
     fcdistro=$1; shift
     pldistro=$1; shift
+    builddir=$1; shift
     # search for file "yumexclude.pkgs"
-    yumexclude_file=$(pl_locateDistroFile ../build/ $pldistro "yumexclude.pkgs")
+    yumexclude_file=$(pl_locateDistroFile $builddir $pldistro "yumexclude.pkgs")
+    #
+    # check if pkgs.py is in PATH
+    type -p pkgs.py >& /dev/null || export PATH=$builddir:$PATH
+
     # parse it
-    pl_parsePkgs keyword $fcdistro $pldistro $yumexclude_file || \
+    pl_parsePkgs $keyword $fcdistro $pldistro $yumexclude_file || \
        { echo pl_yumexclude failed with fcdistro=$fcdistro and pldistro=$pldistro; return 1 ; }
 }
 
+# <> fcdistro pldistro builddir
 # node side : use the 'nodeyumexclude' keywork in yumexclude.pkgs
 function pl_nodeyumexclude () { pl_yumexclude 'nodeyumexclude' "$@" ; }
+# server side : use the 'plcyumexclude' keywork in yumexclude.pkgs
 function pl_plcyumexclude () { pl_yumexclude 'plcyumexclude' "$@" ; }
 
 
@@ -236,7 +243,9 @@ function pl_root_mkfedora () {
     pkgs_precious=$(pl_parsePkgs precious $fcdistro $pldistro $pkgsfile)
     # formerly related to mkfedora -k : packages to take from our own build 
     # and thus need be excluded frem the stock repos
-    SUBST_NODEYUMEXCLUDE=$(pl_nodeyumexclude $fcdistro $pldistro)
+    # locate builddir by looking for pkgs.py
+    builddir=$(dirname $(type -p pkgs.py))
+    SUBST_NODEYUMEXCLUDE=$(pl_nodeyumexclude $fcdistro $pldistro $builddir)
     pkgs_yumexclude=$(pl_parsePkgs yumexclude $fcdistro $pldistro $pkgsfile | sed -e s,@NODEYUMEXCLUDE@,"$SUBST_NODEYUMEXCLUDE",)
     # get mirrors if not specified with -l
     if [ -z "$mirrors" ] ; then