Magellan Linux

Diff of /branches/mage-next/src/depwalker.in

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

trunk/mage/usr/lib/mage/depwalker.sh revision 2359 by niro, Mon Jan 6 12:35:42 2014 UTC branches/mage-next/src/depwalker.in revision 2573 by niro, Wed Jan 29 12:27:04 2014 UTC
# Line 29  decho() Line 29  decho()
29   source ${MLIBDIR}/mage4.functions.sh || \   source ${MLIBDIR}/mage4.functions.sh || \
30   die "mage functions missing"   die "mage functions missing"
31    
32    [ -f ${MLIBDIR}/smage2.functions.sh ] && \
33     source ${MLIBDIR}/smage2.functions.sh || \
34     die "smage functions missing"
35    
36  usage()  usage()
37  {  {
38   echo   echo
# Line 45  usage() Line 49  usage()
49   echo "                         install-build-prerequisites,"   echo "                         install-build-prerequisites,"
50   echo "                         pretend-build-prerequisites"   echo "                         pretend-build-prerequisites"
51   echo "  -d     --debug         enable debug mode"   echo "  -d     --debug         enable debug mode"
52     echo "  -s     --smage         use a smage to calculate dependencies"
53   echo   echo
54   echo "method, category, name, version and build must be given !"   echo "method, category, name, version and build must be given !"
55   echo   echo
# Line 64  do Line 69  do
69   --pbuild|-b) shift; PBUILD="$1" ;;   --pbuild|-b) shift; PBUILD="$1" ;;
70   --method|-m) shift; METHOD="$1" ;;   --method|-m) shift; METHOD="$1" ;;
71   --debug|-d) shift; DEBUG=1 ;;   --debug|-d) shift; DEBUG=1 ;;
72     --smage|-s) shift; SMAGEFILE="$1"; SILENT=1; FVERBOSE=off ;;
73   --help|-h) usage ;;   --help|-h) usage ;;
74   esac   esac
75   shift   shift
76  done  done
77    
78  # sanity checks; abort if not given  # sanity checks; abort if not given
79  [ -z "${PCAT}" ] && usage  if [[ -z ${SMAGEFILE} ]]
80  [ -z "${PNAME}" ] && usage  then
81  [ -z "${PVER}" ] && usage   [ -z "${PCAT}" ] && usage
82  [ -z "${PBUILD}" ] && usage   [ -z "${PNAME}" ] && usage
83     [ -z "${PVER}" ] && usage
84     [ -z "${PBUILD}" ] && usage
85    fi
86  [ -z "${METHOD}" ] && usage  [ -z "${METHOD}" ] && usage
87    
88  # check needed global vars  # check needed global vars
# Line 83  done Line 92  done
92    
93  # other needed vars  # other needed vars
94  ALLDEPS=""  ALLDEPS=""
95    if [[ -n ${SMAGEFILE} ]]
96    then
97     if [[ -e ${SMAGEFILE} ]]
98     then
99     smagesource "${SMAGEFILE}"
100     else
101     die "Smage file '${SMAGEFILE}' does not exist!"
102     fi
103    fi
104  MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage"  MAGEFILE="${MAGEDIR}/${PCAT}/${PNAME}/${PNAME}-${PVER}-${PBUILD}.mage"
105    
106  # much faster than fgrep  # much faster than fgrep
# Line 294  then Line 312  then
312   ALLDEPS="${ALLDEPS} ${MAGEFILE}"   ALLDEPS="${ALLDEPS} ${MAGEFILE}"
313   fi   fi
314   else   else
315   # debug info   # debug info
316   decho "ignored package"   decho "ignored package"
317   decho   decho
  fi  
318   fi   fi
319   done   done
320  else  else
  LOOP_COUNTER=0  
321   # get all dependencies of the package   # get all dependencies of the package
322   depwalking ${MAGEFILE}   if [[ -n ${SMAGEFILE} ]]
323     then
324     depwalking "${SMAGEFILE}"
325     else
326     depwalking "${MAGEFILE}"
327     fi
328  fi  fi
329    
330  if [[ ${METHOD} != install-build-prerequisites ]] &&  if [[ ${METHOD} != install-build-prerequisites ]] &&

Legend:
Removed from v.2359  
changed lines
  Added in v.2573