uses new module names sliceimage and nodeimage
[build.git] / build.common
index 075064c..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,8 +243,10 @@ 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)
-    pkgs_yumexcludes=$(pl_parsePkgs yumexclude $fcdistro $pldistro $pkgsfile | sed -e s,@NODEYUMEXCLUDE@,"$SUBST_NODEYUMEXCLUDE",)
+    # 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
        mirrorsfile=$(pl_locateDistroFile ../build/ $pldistro "$pldistro.mirrors")
@@ -245,7 +254,7 @@ function pl_root_mkfedora () {
     fi
 
     yumexclude_line=""
-    [ -n "$pkgs_yumexcludes" ] && yumexclude_line="exclude=$pkgs_yumexcludes"
+    [ -n "$pkgs_yumexclude" ] && yumexclude_line="exclude=$pkgs_yumexclude"
 
     echo "$0: candidate mirrors"
     for mirror in $mirrors ; do