Magellan Linux

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

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

revision 24 by niro, Wed Jan 5 05:08:01 2005 UTC revision 36 by niro, Thu Jan 6 03:34:00 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  # version: 0.3.6-r9
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.6-r9
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 169  unregister_virtual_pkg(){ Line 169  unregister_virtual_pkg(){
169   if [ -n "${PROVIDE}" ]   if [ -n "${PROVIDE}" ]
170   then   then
171   local my_pgk   local my_pgk
172     local my_cat
173     local directory
174     local x
175    
176   #cut arch   #cut arch
177   my_pkg=${PKGNAME/-${ARCH}/}   my_pkg=${PKGNAME/-${ARCH}/}
178    
179   #cut version & build   #cut version & build
180   my_pkg=${my_pkg%-*-*}   my_pkg=${my_pkg%-*-*}
181     my_cat=$(dirname ${my_pkg})
182    
183     #check if this was the last one or if any other exists
184     for directory in ${INSTALLDB}/${my_cat}/*
185     do
186     # continue if not a directory,
187     # or the same PNAME-PVER-PBUILD
188     if [ ! -d "${directory}" ]
189     then
190     continue
191     fi
192    
193     #check if $directory is the same as $my_pkg
194     x=$(basename ${directory})
195     if [[ ${my_cat}/${x%-*-*} = ${my_pkg} ]]
196     then
197     # break here
198     echo "==== another version of ${my_pkg} exists, not deleting ${VIRTUAL_NAME} ..."
199     return 0
200     fi
201     done
202    
203   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}   #virtuals_del ${PROVIDE} ${CATEGORIE}/${my_pkg}
204    
205   #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree   #my_pkg has already the categorie -> ex my_pkg=x11-base/xfree
# Line 424  case "$1" in Line 450  case "$1" in
450   download)   download)
451   choppkgname   choppkgname
452   getcategorie   getcategorie
453   get_highest_magefile   get_highest_magefile || exit 1
454   source ${MAGEFILE}   source ${MAGEFILE}
455   getpackages   getpackages
456   ;;   ;;
# Line 432  case "$1" in Line 458  case "$1" in
458   pretend)   pretend)
459   choppkgname   choppkgname
460   getcategorie   getcategorie
461   get_highest_magefile   get_highest_magefile || exit 1
462   ${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE}   ${MLIBDIR}/depwanderer.sh pretend ${MAGEFILE}
463   #abort already installed   #abort already installed
464   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 446  case "$1" in Line 472  case "$1" in
472   srcpretend)   srcpretend)
473   choppkgname   choppkgname
474   getcategorie   getcategorie
475   get_highest_magefile   get_highest_magefile || exit 1
476   ${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE}   ${MLIBDIR}/depwanderer.sh srcpretend ${MAGEFILE}
477   #abort already installed   #abort already installed
478   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 462  case "$1" in Line 488  case "$1" in
488   declare -i PROTECT_COUNT=0   declare -i PROTECT_COUNT=0
489   choppkgname   choppkgname
490   getcategorie   getcategorie
491   get_highest_magefile   get_highest_magefile || exit 1
492   ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})"   ALLDEPS="$(/usr/lib/mage/depwanderer.sh install ${MAGEFILE})"
493   #abort already installed   #abort already installed
494   if [ "$?" == "3" ]   if [ "$?" == "3" ]
# Line 500  case "$1" in Line 526  case "$1" in
526   declare -i PROTECT_COUNT=0   declare -i PROTECT_COUNT=0
527   choppkgname   choppkgname
528   getcategorie   getcategorie
529   get_highest_magefile   get_highest_magefile || exit 1
530   ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})"   ALLDEPS="$(/usr/lib/mage/depwanderer.sh srcinstall ${MAGEFILE})"
531   #abort already installed   #abort already installed
532   if [ "$?" == "3" ]   if [ "$?" == "3" ]

Legend:
Removed from v.24  
changed lines
  Added in v.36