Magellan Linux

Diff of /branches/mage-next/usr/lib/mage/mage4.sh

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

revision 254 by niro, Mon Oct 3 13:48:06 2005 UTC revision 2371 by niro, Mon Jan 6 14:09:10 2014 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/bash
2  # Magellan Linux Installer (mage.sh)  # Magellan Linux Installer (mage.sh)
3  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage4.sh,v 1.8 2005-10-03 13:48:06 niro Exp $  # $Id$
4    
5  # default die function  # default die function
6  die()  die()
7  {  {
8     xtitleclean
9     mqueryfeature "debug" && echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT}
10   echo -e ${COLRED}"$@"${COLDEFAULT}   echo -e ${COLRED}"$@"${COLDEFAULT}
11   exit 1   exit 1
12  }  }
# Line 14  die() Line 16  die()
16   source /etc/mage.rc.global || \   source /etc/mage.rc.global || \
17   die "/etc/mage.rc.global missing"   die "/etc/mage.rc.global missing"
18    
19  [ -f /etc/mage.rc ] && source /etc/mage.rc || \  [ -f ${MAGERC} ] && source ${MAGERC} || \
20   die "Your /etc/mage.rc is missing. Aborting."   die "Your ${MAGERC} is missing. Aborting."
21    
22  [ -f ${MLIBDIR}/mage4.functions.sh ] && \  [ -f ${MLIBDIR}/mage4.functions.sh ] && \
23   source ${MLIBDIR}/mage4.functions.sh || \   source ${MLIBDIR}/mage4.functions.sh || \
24   die "mage functions missing"   die "mage functions missing"
25    
 # for tests only  
 #source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage.rc.global  
 #source /etc/mage.rc  
 #source /home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage/mage4.functions.sh  
 #MLIBDIR=/home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage  
   
 ## only for tests -> normally in /etc/rc.d/init.d/functions  
 COLRED="\033[1;6m\033[31m"  
 COLGREEN="\033[1;6m\033[32m"  
 COLYELLOW="\033[1;6m\033[33m"  
 COLBLUE="\033[1;6m\033[34m"  
 COLMAGENTA="\033[1;6m\033[35m"  
 COLWHITE="\033[1;6m\033[37m"  
 COLGRAY="\033[0;6m\033[37m"  
 COLBOLD="\033[1m"  
 COLDEFAULT="\033[0m"  
   
 if [[ ${NOCOLORS} = true ]]  
 then  
  COLRED=""  
  COLGREEN=""  
  COLYELLOW=""  
  COLBLUE=""  
  COLMAGENTA=""  
  COLWHITE=""  
  COLGRAY=""  
  COLBOLD=""  
  COLDEFAULT=""  
 fi  
   
26  # export default path  # export default path
27  export PATH="${PATH}:${MLIBDIR}"  export PATH="${PATH}:${MLIBDIR}"
28    
# Line 60  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 ]]  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 69  then Line 44  then
44  fi  fi
45    
46  # default messages  # default messages
47  showversion() {  showversion()
48    {
49   local MAGEVERSION="$(< ${MLIBDIR}/version)"   local MAGEVERSION="$(< ${MLIBDIR}/version)"
50    
51   echo -en "Magellan Package Manager v${MAGEVERSION} "   echo -en "Magellan Package Manager v${MAGEVERSION} "
52   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"
53  }  }
54    
55  print_usage(){  print_usage()
56   showversion  {
57   echo   #showversion
58     #echo
59   echo "Usage: $(basename $0) [option] pkgname ..."   echo "Usage: $(basename $0) [option] pkgname ..."
60   echo "Options:"   echo "Options:"
61   echo "     pretend        - pretends dependencies of a package"   echo "    pretend         - pretends dependencies of a package"
62   echo "     srcpretend     - pretends dependencies of a package (build from source)"   echo "    srcpretend      - pretends dependencies of a package (build from source)"
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 mage-tree"   echo "    update          - updates the mage-tree via default sync method"
67   echo "     uppretend      - pretend dependencies for a system upgrade"   echo "    update-rsync    - updates the mage-tree via rsync"
68   echo "     upgrade        - runs a complete system upgrade"   echo "    update-tarball  - updates the mage-tree via a tarball"
69   echo "     srcuppretend   - pretend dependencies for a system upgrade from source"   echo "    uppretend       - pretend dependencies for a system upgrade"
70   echo "     srcupgrade     - runs a complete system upgrade from source"   echo "    upgrade         - runs a complete system upgrade"
71   echo "     search         - searches mage-tree for a package"   echo "    srcuppretend    - pretend dependencies for a system upgrade from source"
72   echo "     clean          - removes *all* downloaded packages"   echo "    srcupgrade      - runs a complete system upgrade from source"
73   echo "     unpack         - unpacks *all* needed package for 'foo'"   echo "    pretend-build-prerequisites - prints build prerequisites"
74   echo "     download       - downloads *all* needed packages for 'foo'"   echo "    install-build-prerequisites - install build prerequisites"
75   echo "     version        - prints version info"   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"
78     echo "    clean           - removes *all* downloaded packages"
79     echo "    unpack          - unpacks *all* needed package for 'foo'"
80     echo "    download        - downloads *all* needed packages for 'foo'"
81     echo "    print-features  - prints all enabled mage-features"
82     echo "    version         - prints version info"
83     echo "    regen-mage-tree - regenerates the whole mage database (for devs only)"
84   echo   echo
85   echo "Other options:"   echo "Other options:"
86  # echo "NOINSTALL=yes $(basename $0) srcinstall PACKAGE"  # echo "NOINSTALL=yes $(basename $0) srcinstall PACKAGE"
87  # echo "Builds a Package with its dependencies, but won't install anything."  # echo "Builds a Package with its dependencies, but won't install anything."
88  # echo  # echo
89   echo "USE_UNSTABLE=true $(basename $0) [src]install PACKAGE"   echo "MAGE_DISTRIBUTION=unstable $(basename $0) [src]install PACKAGE"
90   echo "Overrides stable packages; you can install packages that are marked unstable."   echo "Overrides stable packages; you can install packages that are marked unstable."
91   echo   echo
92   echo "USE_TESTING=true $(basename $0) [src]install PACKAGE"   echo "MAGE_DISTRIBUTION=testing $(basename $0) [src]install PACKAGE"
93   echo "Overrides stable packages; you can install packages that are marked testing."   echo "Overrides stable packages; you can install packages that are marked testing."
94   echo   echo
95   echo "NOCOLORS=true $(basename $0) [src]install PACKAGE"   echo "NOCOLORS=true $(basename $0) [src]install PACKAGE"
# Line 116  print_usage(){ Line 101  print_usage(){
101  showversion  showversion
102  echo  echo
103    
 # before anything run mage_setup  
 mage_setup || die "error in mage_setup()"  
   
104  # install method  # install method
105  METHOD="$1"  METHOD="$1"
106    
107  # initial unversionized packagename, gets overridden later  # initial unversionized packagename, gets overridden later on
108  MAGENAME="$2"  MAGENAME="$2"
109    
110  if [[ ${METHOD} != upgrade ]] && \  if [[ ${METHOD} != upgrade ]] &&
111   [[ ${METHOD} != srcupgrade ]] && \   [[ ${METHOD} != srcupgrade ]] &&
112   [[ ${METHOD} != uppretend ]] && \   [[ ${METHOD} != uppretend ]] &&
113   [[ ${METHOD} != srcuppretend ]] && \   [[ ${METHOD} != srcuppretend ]] &&
114   [[ ${METHOD} != update ]] && \   [[ ${METHOD} != update ]] &&
115   [[ ${METHOD} != clean ]] && \   [[ ${METHOD} != update-rsync ]] &&
116   [[ ${METHOD} != version ]] && \   [[ ${METHOD} != update-tarball ]] &&
117   [[ ${METHOD} != search ]] && \   [[ ${METHOD} != clean ]] &&
118   [[ ${METHOD} != regen-mage-tree ]]   [[ ${METHOD} != version ]] &&
119     [[ ${METHOD} != search ]] &&
120     [[ ${METHOD} != regen-mage-tree ]] &&
121     [[ ${METHOD} != print-features ]]
122  then  then
123   [[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1   [[ -z ${METHOD} ]] || [[ -z ${MAGENAME} ]] && print_usage && exit 1
124  fi  fi
125    
126    # set PKGDIR and BUILDDIR to MROOT
127    if [[ -n ${MROOT} ]]
128    then
129     PKGDIR=${MROOT}/${PKGDIR}
130     BUILDDIR=${MROOT}/${BUILDDIR}
131    fi
132    
133    # before anything run mage_setup
134    mage_setup || die "error in mage_setup()"
135    
136    # load supported mage features
137    load_mage_features
138    
139    # query debug mode
140    if mqueryfeature "debug"
141    then
142     depwalker_debug="--debug"
143    else
144     depwalker_debug=""
145    fi
146    
147  case ${METHOD} in  case ${METHOD} in
148   download)   download)
149     have_root_privileges || die "You must be root to run this operation."
150    
151   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
152   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
153    
# Line 150  case ${METHOD} in Line 157  case ${METHOD} in
157   # source the highest magefile of this pkg   # source the highest magefile of this pkg
158   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
159    
160     # package is masked
161     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
162    
163   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
164   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
165   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 162  case ${METHOD} in Line 172  case ${METHOD} in
172   --pcat ${PCAT} \   --pcat ${PCAT} \
173   --pname ${PNAME} \   --pname ${PNAME} \
174   --pver ${PVER} \   --pver ${PVER} \
175   --pbuild ${PBUILD})"   --pbuild ${PBUILD} \
176     ${depwalker_debug})"
177   fetch_packages ${ALLDEPS} || die "fetching packages"   fetch_packages ${ALLDEPS} || die "fetching packages"
178   md5sum_packages ${ALLDEPS} || die "md5 sum packages"   md5sum_packages ${ALLDEPS} || die "md5 sum packages"
179   ;;   ;;
180    
181   srcdownload)   srcdownload)
182     have_root_privileges || die "You must be root to run this operation."
183    
184   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
185   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
186    
# Line 177  case ${METHOD} in Line 190  case ${METHOD} in
190   # source the highest magefile of this pkg   # source the highest magefile of this pkg
191   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
192    
193     # package is masked
194     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
195    
196   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
197   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
198   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 189  case ${METHOD} in Line 205  case ${METHOD} in
205   --pcat ${PCAT} \   --pcat ${PCAT} \
206   --pname ${PNAME} \   --pname ${PNAME} \
207   --pver ${PVER} \   --pver ${PVER} \
208   --pbuild ${PBUILD})"   --pbuild ${PBUILD} \
209     ${depwalker_debug})"
210   fetch_packages ${ALLDEPS} || die "fetching packages"   fetch_packages ${ALLDEPS} || die "fetching packages"
211   ;;   ;;
212    
213   pretend|srcpretend)   pretend|srcpretend|pretend-build-prerequisites)
214   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
215   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
216    
# Line 203  case ${METHOD} in Line 220  case ${METHOD} in
220   # source the highest magefile of this pkg   # source the highest magefile of this pkg
221   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
222    
223     # package is masked
224     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
225    
226   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
227   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
228   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 223  case ${METHOD} in Line 243  case ${METHOD} in
243   --pcat ${PCAT} \   --pcat ${PCAT} \
244   --pname ${PNAME} \   --pname ${PNAME} \
245   --pver ${PVER} \   --pver ${PVER} \
246   --pbuild ${PBUILD}   --pbuild ${PBUILD} \
247     ${depwalker_debug}
248   ;;   ;;
249    
250   install)   install|install-build-prerequisites)
251     have_root_privileges || die "You must be root to run this operation."
252    
253   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
254   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
255    
# Line 236  case ${METHOD} in Line 259  case ${METHOD} in
259   # source the highest magefile of this pkg   # source the highest magefile of this pkg
260   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
261    
262     # package is masked
263     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
264    
265   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
266   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
267   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 256  case ${METHOD} in Line 282  case ${METHOD} in
282   --pcat ${PCAT} \   --pcat ${PCAT} \
283   --pname ${PNAME} \   --pname ${PNAME} \
284   --pver ${PVER} \   --pver ${PVER} \
285   --pbuild ${PBUILD})"   --pbuild ${PBUILD} \
286     ${depwalker_debug})"
287    
288   # first fetch all packages   # first fetch all packages
289   fetch_packages ${ALLDEPS} || die "fetching packages"   fetch_packages ${ALLDEPS} || die "fetching packages"
290   md5sum_packages ${ALLDEPS} || die "md5 sum packages"   md5sum_packages ${ALLDEPS} || die "md5 sum packages"
  unpack_packages ${ALLDEPS} || die "unpacking packages"  
291   install_packages ${ALLDEPS} || die "installing packages"   install_packages ${ALLDEPS} || die "installing packages"
292   ;;   ;;
293    
294   srcinstall)   srcinstall)
295     have_root_privileges || die "You must be root to run this operation."
296    
297   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
298   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
299    
# Line 275  case ${METHOD} in Line 303  case ${METHOD} in
303   # source the highest magefile of this pkg   # source the highest magefile of this pkg
304   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
305    
306     # package is masked
307     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
308    
309   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
310   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
311   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 295  case ${METHOD} in Line 326  case ${METHOD} in
326   --pcat ${PCAT} \   --pcat ${PCAT} \
327   --pname ${PNAME} \   --pname ${PNAME} \
328   --pver ${PVER} \   --pver ${PVER} \
329   --pbuild ${PBUILD})"   --pbuild ${PBUILD} \
330     ${depwalker_debug})"
331    
332   install_packages --src-install ${ALLDEPS} || die "src-installing packages"   install_packages --src-install ${ALLDEPS} || die "src-installing packages"
333   ;;   ;;
334    
335   uninstall)   uninstall)
336   ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})"   have_root_privileges || die "You must be root to run this operation."
337   if [ -z "${ALLDEPS}" ]  
338   then   ALLDEPS="$(get_uninstall_candidates --pname ${MAGENAME})"
339   die "No package installed named '${MAGENAME}'."   if [ -z "${ALLDEPS}" ]
340   fi   then
341   uninstall_packages ${ALLDEPS}   die "No package installed named '${MAGENAME}'."
342     fi
343     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)
# Line 315  case ${METHOD} in Line 360  case ${METHOD} in
360   --pcat ${METHOD} \   --pcat ${METHOD} \
361   --pname ${METHOD} \   --pname ${METHOD} \
362   --pver ${METHOD} \   --pver ${METHOD} \
363   --pbuild ${METHOD}   --pbuild ${METHOD} \
364     ${depwalker_debug}
365   ;;   ;;
366    
367   upgrade)   upgrade)
368     have_root_privileges || die "You must be root to run this operation."
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.sh \
# Line 326  case ${METHOD} in Line 374  case ${METHOD} in
374   --pcat ${METHOD} \   --pcat ${METHOD} \
375   --pname ${METHOD} \   --pname ${METHOD} \
376   --pver ${METHOD} \   --pver ${METHOD} \
377   --pbuild ${METHOD})"   --pbuild ${METHOD} \
378     ${depwalker_debug})"
379    
380   # first fetch all packages   # first fetch all packages
381   fetch_packages ${ALLDEPS} || die "fetching packages"   fetch_packages ${ALLDEPS} || die "fetching packages"
382   md5sum_packages ${ALLDEPS} || die "md5 sum packages"   md5sum_packages ${ALLDEPS} || die "md5 sum packages"
  unpack_packages ${ALLDEPS} || die "unpacking packages"  
383   install_packages ${ALLDEPS} || die "installing packages"   install_packages ${ALLDEPS} || die "installing packages"
384   ;;   ;;
385    
386   srcupgrade)   srcupgrade)
387     have_root_privileges || die "You must be root to run this operation."
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.sh \
# Line 343  case ${METHOD} in Line 393  case ${METHOD} in
393   --pcat ${METHOD} \   --pcat ${METHOD} \
394   --pname ${METHOD} \   --pname ${METHOD} \
395   --pver ${METHOD} \   --pver ${METHOD} \
396   --pbuild ${METHOD})"   --pbuild ${METHOD} \
397     ${depwalker_debug})"
398    
399   install_packages --src-install ${ALLDEPS} || die "src-installing packages"   install_packages --src-install ${ALLDEPS} || die "src-installing packages"
400   ;;   ;;
# Line 353  case ${METHOD} in Line 404  case ${METHOD} in
404   ;;   ;;
405    
406   unpack)   unpack)
407     have_root_privileges || die "You must be root to run this operation."
408    
409   # first of all get the right pkg which going to be installed   # first of all get the right pkg which going to be installed
410   PCAT="$(pname2pcat ${MAGENAME})"   PCAT="$(pname2pcat ${MAGENAME})"
411    
# Line 362  case ${METHOD} in Line 415  case ${METHOD} in
415   # source the highest magefile of this pkg   # source the highest magefile of this pkg
416   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))   PKGNAME=$(get_value_from_magefile PKGNAME $(get_highest_magefile ${PCAT} ${MAGENAME}))
417    
418     # package is masked
419     [ -z "${PKGNAME}" ] && die "Package '${MAGENAME}' is masked and not available for installation."
420    
421   # convert PKGNAME to PNAME/PVER/PBUILD   # convert PKGNAME to PNAME/PVER/PBUILD
422   # we're working *only* with these three vars from here on   # we're working *only* with these three vars from here on
423   PNAME="$(pkgname2pname ${PKGNAME})"   PNAME="$(pkgname2pname ${PKGNAME})"
# Line 374  case ${METHOD} in Line 430  case ${METHOD} in
430   --pcat ${PCAT} \   --pcat ${PCAT} \
431   --pname ${PNAME} \   --pname ${PNAME} \
432   --pver ${PVER} \   --pver ${PVER} \
433   --pbuild ${PBUILD})"   --pbuild ${PBUILD} \
434     ${depwalker_debug})"
435    
436   fetch_packages ${ALLDEPS} || die "fetching packages"   fetch_packages ${ALLDEPS} || die "fetching packages"
437   md5sum_packages ${ALLDEPS} || die "md5 sum packages"   md5sum_packages ${ALLDEPS} || die "md5 sum packages"
438   unpack_packages ${ALLDEPS} || die "unpacking packages"   unpack_packages ${ALLDEPS} || die "unpacking packages"
439   ;;   ;;
440    
441   update)   update)
442     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    
457     update-tarball)
458     have_root_privileges || die "You must be root to run this operation."
459     syncmage_tarball
460     ;;
461    
462   clean)   clean)
463     have_root_privileges || die "You must be root to run this operation."
464   cleanpkg   cleanpkg
465   ;;   ;;
466    
467   version)   version)
468   showversion   # showversion
469     exit 0
470   ;;   ;;
471    
472   regen-mage-tree)   regen-mage-tree)
473     have_root_privileges || die "You must be root to run this operation."
474    
475   if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ]   if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ]
476   then   then
477   echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos."   echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos."
# Line 404  case ${METHOD} in Line 483  case ${METHOD} in
483   done   done
484   ;;   ;;
485    
486     print-features)
487     mprintfeatures
488     ;;
489    
490   *)   *)
491   print_usage   print_usage
492   ;;   ;;

Legend:
Removed from v.254  
changed lines
  Added in v.2371