Magellan Linux

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

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

revision 2365 by niro, Mon Jan 6 12:56:50 2014 UTC revision 3081 by niro, Tue May 22 14:09:28 2018 UTC
# Line 225  download_sources() Line 225  download_sources()
225  }  }
226    
227  # dummy function, used if that does not exist in smage file  # dummy function, used if that does not exist in smage file
228    pkg_setup()
229    {
230     echo "no pkg_setup defined; doing nothing ..."
231     return 0
232    }
233    
234    # dummy function, used if that does not exist in smage file
235  src_prepare()  src_prepare()
236  {  {
237   echo "no src_prepare defined; doing nothing ..."   echo "no src_prepare defined; doing nothing ..."
# Line 491  mstriplibs() Line 498  mstriplibs()
498    
499   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
500   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"
501   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
502  }  }
503    
504  mstripbins()  mstripbins()
# Line 500  mstripbins() Line 507  mstripbins()
507    
508   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
509   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"
510   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
511  }  }
512    
513  mstripstatic()  mstripstatic()
# Line 588  march() Line 595  march()
595   return "${retval}"   return "${retval}"
596  }  }
597    
598  marchsrcfile()  marchvariable()
599  {  {
600   local retval   local retval
601   local var="$1"   local var="$1"
602    
603   [[ -z ${var} ]] && var="SRCFILE"   [[ -n ${var} ]] || die "marchvariable(): missing variable"
604    
605   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
606   then   then
# Line 606  marchsrcfile() Line 613  marchsrcfile()
613   return "${retval}"   return "${retval}"
614  }  }
615    
616    marchsrcfile()
617    {
618     local retval
619     local var="$1"
620    
621     [[ -z ${var} ]] && var="SRCFILE"
622    
623     marchvariable "${var}" || die
624    }
625    
626  marchsrcdir()  marchsrcdir()
627  {  {
628   local retval   local retval
# Line 613  marchsrcdir() Line 630  marchsrcdir()
630    
631   [[ -z ${var} ]] && var="SRCDIR"   [[ -z ${var} ]] && var="SRCDIR"
632    
633   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}"  
634  }  }
635    
636  marchdepend()  marchdepend()
# Line 633  marchdepend() Line 642  marchdepend()
642    
643   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
644   then   then
645   echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"   # evaluate with escape strings for the magefile if called by smage
646     # but do not escape if the smagefile was called by depwalker directly
647     if [[ ${SMAGE_DEPEND} = 1 ]]
648     then
649     eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n'
650     else
651     echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"
652     fi
653   retval=0   retval=0
654   else   else
655   retval=1   retval=1
# Line 651  marchsdepend() Line 667  marchsdepend()
667    
668   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]   if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]]
669   then   then
670   echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"   # evaluate with escape strings for the magefile if called by smage
671     # but do not escape if the smagefile was called by depwalker directly
672     if [[ ${SMAGE_DEPEND} = 1 ]]
673     then
674     eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n'
675     else
676     echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')"
677     fi
678   retval=0   retval=0
679   else   else
680   retval=1   retval=1
# Line 1171  generate_package_md5sum() Line 1194  generate_package_md5sum()
1194    
1195  source_pkg_build()  source_pkg_build()
1196  {  {
  if [[ ${PKGTYPE} = virtual ]]  
  then  
  echo "Virtual package detected; src-pkg-tarball not necessary ..."  
  return 0  
  fi  
   
1197   if [[ ! -d ${SOURCEDIR}/${PNAME} ]]   if [[ ! -d ${SOURCEDIR}/${PNAME} ]]
1198   then   then
1199   echo "No SRC_URI defined; src-pkg-tarball not necessary ..."   install -d ${SOURCEDIR}/${PNAME}
  return 0  
1200   fi   fi
1201    
1202   [ -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.2365  
changed lines
  Added in v.3081