Magellan Linux

Diff of /trunk/mage/usr/lib/mage/mage3.sh

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

revision 30 by niro, Thu Jan 6 02:29:48 2005 UTC revision 174 by niro, Sun Jul 31 14:46:33 2005 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2  # Magellan Linux Installer (mage.sh)  # Magellan Linux Installer (mage.sh)
3  # version: 0.3.6-r8  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage3.sh,v 1.17 2005-07-31 14:46:33 niro Exp $
4    
5  ##configuration -> mage.rc  ##configuration -> mage.rc
6  #PKGDIR="/usr/src/packages"  #PKGDIR="/usr/src/packages"
# Line 11  PKGSUFFIX="mpk" Line 11  PKGSUFFIX="mpk"
11  MAGENAME="$2"  MAGENAME="$2"
12  #PKGNAME="`basename $2 .mage`"  #PKGNAME="`basename $2 .mage`"
13  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
14  MAGEVERSION=0.3.6-r8  MAGEVERSION=0.3.7-r1
15    
16  ## nur für tests -> normalerweise in /etc/rc.d/init.d/functions  ## nur für tests -> normalerweise in /etc/rc.d/init.d/functions
17  COLRED="\033[1;6m\033[31m"  COLRED="\033[1;6m\033[31m"
# Line 19  COLGREEN="\033[1;6m\033[32m" Line 19  COLGREEN="\033[1;6m\033[32m"
19  COLBLUE="\033[1;6m\033[34m"  COLBLUE="\033[1;6m\033[34m"
20  COLDEFAULT="\033[0m"  COLDEFAULT="\033[0m"
21    
22    # default path
23    PATH="${PATH}:${MLIBDIR}"
24    
25    # export the default C locale
26    export LC_ALL=C
27    
28  ##functions  ##functions
29  if [ -f /etc/mage.rc ]  if [ -f /etc/mage.rc ]
# Line 150  register_virtual_pkg(){ Line 155  register_virtual_pkg(){
155   unset DB_VIRTUAL_NAME DB_PKG_NAME   unset DB_VIRTUAL_NAME DB_PKG_NAME
156   rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/}   rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/}
157   fi   fi
158    
159   if [ -n "${PROVIDE}" ]   if [ -n "${PROVIDE}" ]
160   then   then
161   local my_pgk   # wander through all provides
162   #cut arch   local my_provides
163   my_pkg=${PKGNAME/-${ARCH}/}   for my_provides in ${PROVIDE}
164   #cut version & build   do
165   my_pkg=${my_pkg%-*-*}   local my_pgk
166     #cut arch
167   virtuals_add ${PROVIDE} ${CATEGORIE}/${my_pkg}   my_pkg=${PKGNAME/-${ARCH}/}
168     #cut version & build
169     my_pkg=${my_pkg%-*-*}
170    
171     virtuals_add ${my_provides} ${CATEGORIE}/${my_pkg}
172     done
173   unset PROVIDE   unset PROVIDE
174     unset my_provides
175   fi   fi
176  }  }
177    
# Line 185  unregister_virtual_pkg(){ Line 195  unregister_virtual_pkg(){
195   do   do
196   # continue if not a directory,   # continue if not a directory,
197   # or the same PNAME-PVER-PBUILD   # or the same PNAME-PVER-PBUILD
198   if [ ! -d "${directory}" ]   if [ ! -d "${directory}" ]
199   then   then
200   continue   continue
201   fi   fi
# Line 201  unregister_virtual_pkg(){ Line 211  unregister_virtual_pkg(){
211   done   done
212    
213   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}
214    
215   #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree   # wander through all provides
216   virtuals_del ${PROVIDE} ${my_pkg}   local my_provides
217     for my_provides in ${PROVIDE}
218     do
219     #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree
220     virtuals_del ${my_provides} ${my_pkg}
221     done
222    
223   unset PROVIDE   unset PROVIDE
224     unset my_provides
225   fi   fi
226  }  }
227    
# Line 450  case "$1" in Line 466  case "$1" in
466   download)   download)
467   choppkgname   choppkgname
468   getcategorie   getcategorie
469   get_highest_magefile   get_highest_magefile || exit 1
470   source ${MAGEFILE}   source ${MAGEFILE}
471   getpackages   getpackages
472   ;;   ;;
# Line 458  case "$1" in Line 474  case "$1" in
474   pretend)   pretend)
475   choppkgname   choppkgname
476   getcategorie   getcategorie
477   get_highest_magefile   get_highest_magefile || exit 1
478   ${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE}   ${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE}
479   #abort already installed   #abort already installed
480   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 472  case "$1" in Line 488  case "$1" in
488   srcpretend)   srcpretend)
489   choppkgname   choppkgname
490   getcategorie   getcategorie
491   get_highest_magefile   get_highest_magefile || exit 1
492   ${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE}   ${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE}
493   #abort already installed   #abort already installed
494   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 488  case "$1" in Line 504  case "$1" in
504   declare -i PROTECT_COUNT=0   declare -i PROTECT_COUNT=0
505   choppkgname   choppkgname
506   getcategorie   getcategorie
507   get_highest_magefile   get_highest_magefile || exit 1
508   ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})"   ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})"
509   #abort already installed   #abort already installed
510   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 513  case "$1" in Line 529  case "$1" in
529   unset preinstall   unset preinstall
530   unset postinstall   unset postinstall
531    
532     #then source an evtl new generated profile
533     [ -e /etc/profile ] && source /etc/profile
534    
535   #than install   #than install
536   MY_CAT_FIX="$(dirname ${i})"   MY_CAT_FIX="$(dirname ${i})"
537   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"
# Line 526  case "$1" in Line 545  case "$1" in
545   declare -i PROTECT_COUNT=0   declare -i PROTECT_COUNT=0
546   choppkgname   choppkgname
547   getcategorie   getcategorie
548   get_highest_magefile   get_highest_magefile || exit 1
549   ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})"   ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})"
550   #abort already installed   #abort already installed
551   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 551  case "$1" in Line 570  case "$1" in
570   unset preinstall   unset preinstall
571   unset postinstall   unset postinstall
572    
573     #then source an evtl new generated profile
574     [ -e /etc/profile ] && source /etc/profile
575    
576   #than srcinstall   #than srcinstall
577   MY_CAT_FIX="$(dirname ${i})"   MY_CAT_FIX="$(dirname ${i})"
578   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"

Legend:
Removed from v.30  
changed lines
  Added in v.174