Magellan Linux

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

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

trunk/mage/usr/lib/mage/mage4.sh revision 2268 by niro, Fri Oct 25 06:48:57 2013 UTC branches/mage-next/src/mage.in revision 2605 by niro, Tue Mar 4 14:45:26 2014 UTC
# Line 32  export LC_ALL=C Line 32  export LC_ALL=C
32  # sanity checks  # sanity checks
33  [ ! -e ${VIRTUALDB_FILE} ] && touch ${VIRTUALDB_FILE}  [ ! -e ${VIRTUALDB_FILE} ] && touch ${VIRTUALDB_FILE}
34    
35  if [ ! -e ${VIRTUALDB_DEFAULTS} ] && [[ $1 != update ]] && [[ $1 != update-tarball ]]  if [ ! -e ${VIRTUALDB_DEFAULTS} ] &&
36     [[ $1 != update ]] &&
37     [[ $1 != update-rsync ]] &&
38     [[ $1 != update-tarball ]]
39  then  then
40   echo   echo
41   echo "Please choose an profile from the mage tree."   echo "Please choose an profile from the mage tree."
# Line 60  print_usage() Line 63  print_usage()
63   echo "    install         - installs a package"   echo "    install         - installs a package"
64   echo "    srcinstall      - installs a package from source"   echo "    srcinstall      - installs a package from source"
65   echo "    uninstall       - removes a package"   echo "    uninstall       - removes a package"
66   echo "    update          - updates the mage-tree via rsync"   echo "    update          - updates the mage-tree via default sync method"
67     echo "    update-rsync    - updates the mage-tree via rsync"
68   echo "    update-tarball  - updates the mage-tree via a tarball"   echo "    update-tarball  - updates the mage-tree via a tarball"
69   echo "    uppretend       - pretend dependencies for a system upgrade"   echo "    uppretend       - pretend dependencies for a system upgrade"
70   echo "    upgrade         - runs a complete system upgrade"   echo "    upgrade         - runs a complete system upgrade"
71   echo "    srcuppretend    - pretend dependencies for a system upgrade from source"   echo "    srcuppretend    - pretend dependencies for a system upgrade from source"
72   echo "    srcupgrade      - runs a complete system upgrade from source"   echo "    srcupgrade      - runs a complete system upgrade from source"
73   echo "    pretend-build-prerequisites"   echo "    pretend-build-prerequisites - prints build prerequisites"
74   echo "    install-build-prerequisites"   echo "    install-build-prerequisites - install build prerequisites"
75     echo "    run-preinstall  - runs preinstall part of an installed package"
76     echo "    run-postinstall - runs postinstall part of an installed package"
77   echo "    search          - searches mage-tree for a package"   echo "    search          - searches mage-tree for a package"
78   echo "    clean           - removes *all* downloaded packages"   echo "    clean           - removes *all* downloaded packages"
79   echo "    unpack          - unpacks *all* needed package for 'foo'"   echo "    unpack          - unpacks *all* needed package for 'foo'"
# Line 106  if [[ ${METHOD} != upgrade ]] && Line 112  if [[ ${METHOD} != upgrade ]] &&
112   [[ ${METHOD} != uppretend ]] &&   [[ ${METHOD} != uppretend ]] &&
113   [[ ${METHOD} != srcuppretend ]] &&   [[ ${METHOD} != srcuppretend ]] &&
114   [[ ${METHOD} != update ]] &&   [[ ${METHOD} != update ]] &&
115     [[ ${METHOD} != update-rsync ]] &&
116   [[ ${METHOD} != update-tarball ]] &&   [[ ${METHOD} != update-tarball ]] &&
117   [[ ${METHOD} != clean ]] &&   [[ ${METHOD} != clean ]] &&
118   [[ ${METHOD} != version ]] &&   [[ ${METHOD} != version ]] &&
# Line 160  case ${METHOD} in Line 167  case ${METHOD} in
167   PBUILD="$(pkgname2pbuild ${PKGNAME})"   PBUILD="$(pkgname2pbuild ${PKGNAME})"
168    
169   # get all dependencies of this package   # get all dependencies of this package
170   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
171   --method install \   --method install \
172   --pcat ${PCAT} \   --pcat ${PCAT} \
173   --pname ${PNAME} \   --pname ${PNAME} \
# Line 193  case ${METHOD} in Line 200  case ${METHOD} in
200   PBUILD="$(pkgname2pbuild ${PKGNAME})"   PBUILD="$(pkgname2pbuild ${PKGNAME})"
201    
202   # get all dependencies of this package   # get all dependencies of this package
203   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
204   --method srcinstall \   --method srcinstall \
205   --pcat ${PCAT} \   --pcat ${PCAT} \
206   --pname ${PNAME} \   --pname ${PNAME} \
# Line 231  case ${METHOD} in Line 238  case ${METHOD} in
238   exit 3   exit 3
239   fi   fi
240   # get all dependencies of this package   # get all dependencies of this package
241   ${MLIBDIR}/depwalker.sh \   ${MLIBDIR}/depwalker \
242   --method ${METHOD} \   --method ${METHOD} \
243   --pcat ${PCAT} \   --pcat ${PCAT} \
244   --pname ${PNAME} \   --pname ${PNAME} \
# Line 270  case ${METHOD} in Line 277  case ${METHOD} in
277   fi   fi
278    
279   # get all dependencies of this package   # get all dependencies of this package
280   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
281   --method ${METHOD} \   --method ${METHOD} \
282   --pcat ${PCAT} \   --pcat ${PCAT} \
283   --pname ${PNAME} \   --pname ${PNAME} \
# Line 314  case ${METHOD} in Line 321  case ${METHOD} in
321   fi   fi
322    
323   # get all dependencies of this package   # get all dependencies of this package
324   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
325   --method ${METHOD} \   --method ${METHOD} \
326   --pcat ${PCAT} \   --pcat ${PCAT} \
327   --pname ${PNAME} \   --pname ${PNAME} \
# Line 336  case ${METHOD} in Line 343  case ${METHOD} in
343   uninstall_packages ${ALLDEPS}   uninstall_packages ${ALLDEPS}
344   ;;   ;;
345    
346     run-preinstall|run-postinstall)
347     have_root_privileges || die "You must be root to run this operation."
348    
349     ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})"
350     if [ -z "${ALLDEPS}" ]
351     then
352     die "No package installed named '${MAGENAME}'."
353     fi
354     rerun_pkgfunctions --method "${METHOD//run-}" ${ALLDEPS}
355     ;;
356    
357   uppretend|srcuppretend)   uppretend|srcuppretend)
358   ${MLIBDIR}/depwalker.sh \   ${MLIBDIR}/depwalker \
359   --method ${METHOD} \   --method ${METHOD} \
360   --pcat ${METHOD} \   --pcat ${METHOD} \
361   --pname ${METHOD} \   --pname ${METHOD} \
# Line 351  case ${METHOD} in Line 369  case ${METHOD} in
369    
370   # get all dependencies of *all* installed packages   # get all dependencies of *all* installed packages
371   # fake pcat,pname,pver,pbuild ...   # fake pcat,pname,pver,pbuild ...
372   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
373   --method ${METHOD} \   --method ${METHOD} \
374   --pcat ${METHOD} \   --pcat ${METHOD} \
375   --pname ${METHOD} \   --pname ${METHOD} \
# Line 370  case ${METHOD} in Line 388  case ${METHOD} in
388    
389   # get all dependencies of *all* installed packages   # get all dependencies of *all* installed packages
390   # fake pcat,pname,pver,pbuild ...   # fake pcat,pname,pver,pbuild ...
391   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
392   --method ${METHOD} \   --method ${METHOD} \
393   --pcat ${METHOD} \   --pcat ${METHOD} \
394   --pname ${METHOD} \   --pname ${METHOD} \
# Line 407  case ${METHOD} in Line 425  case ${METHOD} in
425   PBUILD="$(pkgname2pbuild ${PKGNAME})"   PBUILD="$(pkgname2pbuild ${PKGNAME})"
426    
427   # get all dependencies of this package   # get all dependencies of this package
428   ALLDEPS="$(${MLIBDIR}/depwalker.sh \   ALLDEPS="$(${MLIBDIR}/depwalker \
429   --method install \   --method install \
430   --pcat ${PCAT} \   --pcat ${PCAT} \
431   --pname ${PNAME} \   --pname ${PNAME} \
# Line 422  case ${METHOD} in Line 440  case ${METHOD} in
440    
441   update)   update)
442   have_root_privileges || die "You must be root to run this operation."   have_root_privileges || die "You must be root to run this operation."
443     # default to tarball
444     [[ -z ${MAGE_UPDATE_METHOD} ]] && MAGE_UPDATE_METHOD="tarball"
445     case ${MAGE_UPDATE_METHOD} in
446     rsync) syncmage ;;
447     tarball) syncmage_tarball ;;
448     *) die "Unknown MAGE_UPDATE_METHOD defined." ;;
449     esac
450     ;;
451    
452     update-rsync)
453     have_root_privileges || die "You must be root to run this operation."
454   syncmage   syncmage
455   ;;   ;;
456    

Legend:
Removed from v.2268  
changed lines
  Added in v.2605