Magellan Linux

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

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

revision 44 by niro, Mon Jan 10 01:59:30 2005 UTC revision 212 by niro, Sun Aug 28 19:20:08 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-r11  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/mage3.sh,v 1.20 2005-08-28 19:20:08 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-r11  MAGEVERSION="$( < ${MLIBDIR}/version)"
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    if [[ ${NOCOLORS} = true ]]
23    then
24     COLRED=""
25     COLGREEN=""
26     COLYELLOW=""
27     COLBLUE=""
28     COLMAGENTA=""
29     COLWHITE=""
30     COLDEFAULT=""
31    fi
32    
33  # default path  # default path
34  PATH="${PATH}:${MLIBDIR}"  PATH="${PATH}:${MLIBDIR}"
35    
36    # export the default C locale
37    export LC_ALL=C
38    
39  ##functions  ##functions
40  if [ -f /etc/mage.rc ]  if [ -f /etc/mage.rc ]
41  then  then
# Line 152  register_virtual_pkg(){ Line 166  register_virtual_pkg(){
166   unset DB_VIRTUAL_NAME DB_PKG_NAME   unset DB_VIRTUAL_NAME DB_PKG_NAME
167   rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/}   rm ${BUILDDIR}/virtuals/virtuals.${PKGNAME/-${ARCH}/}
168   fi   fi
169    
170   if [ -n "${PROVIDE}" ]   if [ -n "${PROVIDE}" ]
171   then   then
172   local my_pgk   # wander through all provides
173   #cut arch   local my_provides
174   my_pkg=${PKGNAME/-${ARCH}/}   for my_provides in ${PROVIDE}
175   #cut version & build   do
176   my_pkg=${my_pkg%-*-*}   local my_pgk
177     #cut arch
178   virtuals_add ${PROVIDE} ${CATEGORIE}/${my_pkg}   my_pkg=${PKGNAME/-${ARCH}/}
179     #cut version & build
180     my_pkg=${my_pkg%-*-*}
181    
182     virtuals_add ${my_provides} ${CATEGORIE}/${my_pkg}
183     done
184   unset PROVIDE   unset PROVIDE
185     unset my_provides
186   fi   fi
187  }  }
188    
# Line 187  unregister_virtual_pkg(){ Line 206  unregister_virtual_pkg(){
206   do   do
207   # continue if not a directory,   # continue if not a directory,
208   # or the same PNAME-PVER-PBUILD   # or the same PNAME-PVER-PBUILD
209   if [ ! -d "${directory}" ]   if [ ! -d "${directory}" ]
210   then   then
211   continue   continue
212   fi   fi
# Line 203  unregister_virtual_pkg(){ Line 222  unregister_virtual_pkg(){
222   done   done
223    
224   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}
225    
226   #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree   # wander through all provides
227   virtuals_del ${PROVIDE} ${my_pkg}   local my_provides
228     for my_provides in ${PROVIDE}
229     do
230     #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree
231     virtuals_del ${my_provides} ${my_pkg}
232     done
233    
234   unset PROVIDE   unset PROVIDE
235     unset my_provides
236   fi   fi
237  }  }
238    
# Line 515  case "$1" in Line 540  case "$1" in
540   unset preinstall   unset preinstall
541   unset postinstall   unset postinstall
542    
543     #then source an evtl new generated profile
544     [ -e /etc/profile ] && source /etc/profile
545    
546   #than install   #than install
547   MY_CAT_FIX="$(dirname ${i})"   MY_CAT_FIX="$(dirname ${i})"
548   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"
# Line 553  case "$1" in Line 581  case "$1" in
581   unset preinstall   unset preinstall
582   unset postinstall   unset postinstall
583    
584     #then source an evtl new generated profile
585     [ -e /etc/profile ] && source /etc/profile
586    
587   #than srcinstall   #than srcinstall
588   MY_CAT_FIX="$(dirname ${i})"   MY_CAT_FIX="$(dirname ${i})"
589   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"   CATEGORIE="$(basename ${MY_CAT_FIX%/*})"
590   #builds the package from source   #builds the package from source
591   ${MLIBDIR}/sourceinstall.sh ${i} || exit 1   ${MLIBDIR}/sourceinstall.sh ${i} "${MAGE_TARGETS}" || exit 1
592   done   done
593   run_etc_update   run_etc_update
594   ;;   ;;
# Line 637  case "$1" in Line 668  case "$1" in
668   version)   version)
669   showversion   showversion
670   ;;   ;;
671     regen-mage-tree)
672     if [ -z "${SMAGESCRIPTSDIR}" ] || [ ! -d "${SMAGESCRIPTSDIR}" ]
673     then
674     echo "SMAGESCRIPTSDIR not found. Check your mage.rc or check out smage repos."
675     exit 1
676     fi
677     for i in $(find ${SMAGESCRIPTSDIR} -type f -name "*.smage2")
678     do
679     smage2 only-regen-tree "${i}"
680     done
681     ;;
682   *)   *)
683   print_usage   print_usage
684   ;;   ;;

Legend:
Removed from v.44  
changed lines
  Added in v.212