Magellan Linux

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

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

revision 2221 by niro, Wed Oct 16 07:40:02 2013 UTC revision 2281 by niro, Wed Nov 20 12:21:28 2013 UTC
# Line 27  usage() Line 27  usage()
27   echo "Usage: $(basename $0) [command] [arg] ..."   echo "Usage: $(basename $0) [command] [arg] ..."
28   echo   echo
29   echo "  -h     --help          shows this help"   echo "  -h     --help          shows this help"
30   echo "  -c     --pcat          categorie of the package"   echo "  -c     --pcat          category of the package"
31   echo "  -n     --pname         name of the package"   echo "  -n     --pname         name of the package"
32   echo "  -v     --pver          version number of the package"   echo "  -v     --pver          version number of the package"
33   echo "  -b     --pbuild        build number of the package"   echo "  -b     --pbuild        build number of the package"
34   echo "  -m     --method        which calc method should be used:"   echo "  -m     --method        which calc method should be used:"
  echo "  -d     --debug         enable debug mode"  
35   echo "                         install, srcinstall, depend, srcdepend"   echo "                         install, srcinstall, depend, srcdepend"
36   echo "                         upgrade, srcupgrade,"   echo "                         upgrade, srcupgrade,"
37   echo "                         install-build-prerequisites, pretend-build-prerequisites"   echo "                         install-build-prerequisites,"
38     echo "                         pretend-build-prerequisites"
39     echo "  -d     --debug         enable debug mode"
40   echo   echo
41   echo "method, name, version and build must be given !"   echo "method, category, name, version and build must be given !"
42   echo   echo
43   exit 1   exit 1
44  }  }
# Line 126  depwalking() Line 127  depwalking()
127    
128   DFILE="$1"   DFILE="$1"
129    
130     if [[ ${DEBUG} = 1 ]]
131     then
132     echo "DEBUG: depwalking magefile '${DFILE}'" >&2
133     echo >&2
134     fi
135    
136   source ${DFILE}   source ${DFILE}
137    
138   # forced nodeps   # forced nodeps
# Line 184  depwalking() Line 191  depwalking()
191    
192   if [ -z "${MY_DEPEND}" ]   if [ -z "${MY_DEPEND}" ]
193   then   then
194     if [[ ${DEBUG} = 1 ]]
195     then
196     echo "DEBUG: MY_DEPEND is empty; deps of '${DFILE}' ignored" >&2
197     fi
198   return 1   return 1
199   fi   fi
200    
# Line 234  depwalking() Line 245  depwalking()
245   then   then
246   depwalking ${HIGHEST_DEPFILE}   depwalking ${HIGHEST_DEPFILE}
247   ALLDEPS="${ALLDEPS} ${HIGHEST_DEPFILE}"   ALLDEPS="${ALLDEPS} ${HIGHEST_DEPFILE}"
248     if [[ ${DEBUG} = 1 ]]
249     then
250     echo "DEBUG: added '${HIGHEST_DEPFILE}' to ALLDEPS" >&2
251     fi
252   fi   fi
253   fi   fi
254   done << EOF   done << EOF
# Line 264  then Line 279  then
279   # get the highest mage file from mage-db   # get the highest mage file from mage-db
280   MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})"   MAGEFILE="$(get_highest_magefile ${PCAT} ${PNAME})"
281    
282     if [[ ${DEBUG} = 1 ]]
283     then
284     echo "DEBUG: dep='${dep}'" >&2
285     echo "DEBUG: PCAT='${PCAT}'" >&2
286     echo "DEBUG: PNAME='${PNAME}'" >&2
287     echo "DEBUG: MAGEFILE='${MAGEFILE}'" >&2
288     fi
289    
290   # if no install candidate was found, record this   # if no install candidate was found, record this
291   # and process with the next one   # and process with the next one
292   if [[ -z ${MAGEFILE} ]]   if [[ -z ${MAGEFILE} ]]
293   then   then
294   NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}"   NO_UPGRADE_CANDIDATE="${NO_UPGRADE_CANDIDATE} ${PCAT}/${PNAME}"
295     if [[ ${DEBUG} = 1 ]]
296     then
297     echo "DEBUG: added to NO_UPGRADE_CANDIDATE" >&2
298     fi
299   continue   continue
300   fi   fi
301    
# Line 276  then Line 303  then
303   PVER="$(magename2pver ${MAGEFILE})"   PVER="$(magename2pver ${MAGEFILE})"
304   PBUILD="$(magename2pbuild ${MAGEFILE})"   PBUILD="$(magename2pbuild ${MAGEFILE})"
305    
306     if [[ ${DEBUG} = 1 ]]
307     then
308     echo "DEBUG: PVER='${PVER}'" >&2
309     echo "DEBUG: PBUILD='${PBUILD}'" >&2
310     fi
311    
312   # do not walk files which are installed   # do not walk files which are installed
313   if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ]   if [ ! -d ${INSTALLDB}/${PCAT}/${PNAME}-${PVER}-${PBUILD} ]
314   then   then
315   # get dependencies the package   # get dependencies the package
316   depwalking ${MAGEFILE}   depwalking ${MAGEFILE}
317    
318     # now add the package itself to the dependencies
319     # (if not exists already)
320     if checklist_alldeps "${MAGEFILE}"
321     then
322     if [[ ${DEBUG} = 1 ]]
323     then
324     echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2
325     fi
326     ALLDEPS="${ALLDEPS} ${MAGEFILE}"
327     fi
328     else
329     if [[ ${DEBUG} = 1 ]]
330     then
331     echo "DEBUG: ignored package" >&2
332     echo >&2
333     fi
334   fi   fi
335   done   done
336  else  else
# Line 290  else Line 340  else
340  fi  fi
341    
342  if [[ ${METHOD} != install-build-prerequisites ]] &&  if [[ ${METHOD} != install-build-prerequisites ]] &&
343   [[ ${METHOD} != pretend-build-prerequisites ]]   [[ ${METHOD} != pretend-build-prerequisites ]] &&
344     [[ ${METHOD} != upgrade ]] &&
345     [[ ${METHOD} != uppretend ]] &&
346     [[ ${METHOD} != srcupgrade ]] &&
347     [[ ${METHOD} != srcuppretend ]]
348  then  then
349   # now add the package itself to the dependencies   # now add the package itself to the dependencies
350   # (if not exists already)   # (if not exists already)
351   if checklist_alldeps "${MAGEFILE}"   if checklist_alldeps "${MAGEFILE}"
352   then   then
353     if [[ ${DEBUG} = 1 ]]
354     then
355     echo "DEBUG: added '${MAGEFILE}' to ALLDEPS" >&2
356     fi
357   ALLDEPS="${ALLDEPS} ${MAGEFILE}"   ALLDEPS="${ALLDEPS} ${MAGEFILE}"
358   fi   fi
359  fi  fi

Legend:
Removed from v.2221  
changed lines
  Added in v.2281