Magellan Linux

Diff of /trunk/mage/usr/lib/mage/smage2.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 193 by niro, Fri Aug 19 14:14:59 2005 UTC revision 196 by niro, Sat Aug 20 15:55:19 2005 UTC
# Line 4  Line 4 
4  # needs pkgbuild_dir (mage)  # needs pkgbuild_dir (mage)
5    
6  # SMAGE2  # SMAGE2
7  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.24 2005-08-19 14:14:59 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.27 2005-08-20 15:55:19 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
# Line 408  setup_ccache_environment(){ Line 408  setup_ccache_environment(){
408    
409    
410  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
411  # fix_mage_deps -target s/depend # <-- '-' is essential ! (build_mage_script needs this)  # fix_mage_deps target s/depend
412  fix_mage_deps() {  fix_mage_deps() {
413   local target="$1"   local target="$1"
414   local depend="$2"   local depend="$2"
# Line 438  fix_mage_deps() { Line 438  fix_mage_deps() {
438   # do not add empty lines   # do not add empty lines
439   if [ -z "${NDEPEND}" ]   if [ -z "${NDEPEND}" ]
440   then   then
441   NDEPEND="${sym} ${cat}/${pname}${target}-${pver}"   NDEPEND="${sym} ${cat}/${pname}-${target}-${pver}"
442   else   else
443   NDEPEND="${NDEPEND}   NDEPEND="${NDEPEND}
444   ${sym} ${cat}/${pname}${target}-${pver}"   ${sym} ${cat}/${pname}-${target}-${pver}"
445   fi   fi
446    
447   unset cat pname pver   unset cat pname pver
# Line 478  EOF Line 478  EOF
478  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
479  #   REGEN_MAGE_TREE       set to 'true' to enable this  #   REGEN_MAGE_TREE       set to 'true' to enable this
480  #  #
481  # gets called with build_mage_script target # <-- '-' is essential !  # gets called with build_mage_script target
482  build_mage_script()  build_mage_script()
483  {  {
484   local magefile   local magefile
# Line 491  build_mage_script() Line 491  build_mage_script()
491   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
492    
493   # determinate which suffix this mage file should get, if any   # determinate which suffix this mage file should get, if any
494   target="$1"   [ -n "$1" ] && target="-$1"
495    
496   # name of magefile   # name of magefile
497   magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"   magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
# Line 508  build_mage_script() Line 508  build_mage_script()
508   > ${dest}   > ${dest}
509    
510   # header   # header
511   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.24 2005-08-19 14:14:59 niro Exp $' >> ${dest}   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.27 2005-08-20 15:55:19 niro Exp $' >> ${dest}
512   echo  >> ${dest}   echo  >> ${dest}
513    
514   # pgkname and state   # pgkname and state
# Line 521  build_mage_script() Line 521  build_mage_script()
521   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
522   echo >> ${dest}   echo >> ${dest}
523    
524   # special tags   # special tags and vars
525   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
526   if [ -n "${INHERITS}" ]   if [ -n "${INHERITS}" ]
527   then   then
# Line 535  build_mage_script() Line 535  build_mage_script()
535   fi   fi
536   echo >> ${dest}   echo >> ${dest}
537    
538     # add special vars
539     if [ -n "${SPECIAL_VARS}" ]
540     then
541     local i
542     for i in ${SPECIAL_VARS}
543     do
544     # being tricky here :)
545     echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
546     done
547     echo  >> ${dest}
548     fi
549    
550   # deps and provides   # deps and provides
551   echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}   echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
552     echo >> ${dest}
553   echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}   echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
554     echo >> ${dest}
555   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
556   echo >> ${dest}   echo >> ${dest}
557    
# Line 552  build_mage_script() Line 566  build_mage_script()
566   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
567   #unset "${i}" <-- later to get every target built   #unset "${i}" <-- later to get every target built
568   done   done
569     echo  >> ${dest}
570   fi   fi
571    
572   # pre|post-install|removes   # pre|post-install|removes
# Line 572  regen_mage_tree() Line 587  regen_mage_tree()
587   # build them only if requested   # build them only if requested
588   if [[ ${REGEN_MAGE_TREE} = true ]]   if [[ ${REGEN_MAGE_TREE} = true ]]
589   then   then
590   # build for each target an mage file   # run it without targets
591   for i in ${MAGE_TARGETS}   if [ -z "${MAGE_TARGETS}" ]
592   do   then
593   echo   echo
594   build_mage_script "-${i}"   build_mage_script
595   echo   echo
596   done   else
597    
598     # build for each target an mage file
599     # run it with several targets
600     for i in ${MAGE_TARGETS}
601     do
602     echo
603     build_mage_script "${i}"
604     echo
605     done
606     fi
607   fi   fi
608    
609   # now unset all uneeded vars to be safe   # now unset all uneeded vars to be safe
# Line 589  regen_mage_tree() Line 614  regen_mage_tree()
614   unset "${i}"   unset "${i}"
615   done   done
616   unset SPECIAL_FUNCTIONS   unset SPECIAL_FUNCTIONS
617     for i in ${SPECIAL_VARS}
618     do
619     unset "${i}"
620     done
621     unset SPECIAL_VARS
622   unset STATE   unset STATE
623   unset DESCRIPTION   unset DESCRIPTION
624   unset HOMEPAGE   unset HOMEPAGE

Legend:
Removed from v.193  
changed lines
  Added in v.196