Magellan Linux

Diff of /branches/mage-next/src/smage2.functions.sh.in

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

revision 2745 by niro, Wed Aug 13 07:10:41 2014 UTC revision 3082 by niro, Tue May 22 14:12:41 2018 UTC
# Line 453  mstriplibs() Line 453  mstriplibs()
453    
454   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
455   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"
456   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "[shared object|pie executable]" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null
457  }  }
458    
459  mstripbins()  mstripbins()
# Line 462  mstripbins() Line 462  mstripbins()
462    
463   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
464   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"
465   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null   find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep -v "pie executable" | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null
466  }  }
467    
468  mstripstatic()  mstripstatic()
# Line 550  march() Line 550  march()
550   return "${retval}"   return "${retval}"
551  }  }
552    
553  marchsrcfile()  marchvariable()
554  {  {
555   local retval   local retval
556   local var="$1"   local var="$1"
557    
558   [[ -z ${var} ]] && var="SRCFILE"   [[ -n ${var} ]] || die "marchvariable(): missing variable"
559    
560   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
561   then   then
# Line 568  marchsrcfile() Line 568  marchsrcfile()
568   return "${retval}"   return "${retval}"
569  }  }
570    
571    marchsrcfile()
572    {
573     local retval
574     local var="$1"
575    
576     [[ -z ${var} ]] && var="SRCFILE"
577    
578     marchvariable "${var}" || die
579    }
580    
581  marchsrcdir()  marchsrcdir()
582  {  {
583   local retval   local retval
# Line 575  marchsrcdir() Line 585  marchsrcdir()
585    
586   [[ -z ${var} ]] && var="SRCDIR"   [[ -z ${var} ]] && var="SRCDIR"
587    
588   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   marchvariable "${var}" || die
  then  
  eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n'  
  retval=0  
  else  
  retval=1  
  fi  
   
  return "${retval}"  
589  }  }
590    
591  marchdepend()  marchdepend()
# Line 595  marchdepend() Line 597  marchdepend()
597    
598   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
599   then   then
600   echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"   # evaluate with escape strings for the magefile if called by smage
601     # but do not escape if the smagefile was called by depwalker directly
602     if [[ ${SMAGE_DEPEND} = 1 ]]
603     then
604     eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n'
605     else
606     echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"
607     fi
608   retval=0   retval=0
609   else   else
610   retval=1   retval=1
# Line 613  marchsdepend() Line 622  marchsdepend()
622    
623   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
624   then   then
625   echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"   # evaluate with escape strings for the magefile if called by smage
626     # but do not escape if the smagefile was called by depwalker directly
627     if [[ ${SMAGE_DEPEND} = 1 ]]
628     then
629     eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n'
630     else
631     echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"
632     fi
633   retval=0   retval=0
634   else   else
635   retval=1   retval=1
# Line 1133  generate_package_md5sum() Line 1149  generate_package_md5sum()
1149    
1150  source_pkg_build()  source_pkg_build()
1151  {  {
  if [[ ${PKGTYPE} = virtual ]]  
  then  
  echo "Virtual package detected; src-pkg-tarball not necessary ..."  
  return 0  
  fi  
   
1152   if [[ ! -d ${SOURCEDIR}/${PNAME} ]]   if [[ ! -d ${SOURCEDIR}/${PNAME} ]]
1153   then   then
1154   echo "No SRC_URI defined; src-pkg-tarball not necessary ..."   install -d ${SOURCEDIR}/${PNAME}
  return 0  
1155   fi   fi
1156    
1157   [ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly."   [ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly."

Legend:
Removed from v.2745  
changed lines
  Added in v.3082