Magellan Linux

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

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

revision 201 by niro, Wed Jun 1 15:56:31 2005 UTC revision 202 by niro, Sun Aug 21 23:52:50 2005 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3  #installs from source with given mage-file  # installs from source with given mage-file
4  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/sourceinstall.sh,v 1.7 2005-06-01 15:56:31 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/sourceinstall.sh,v 1.8 2005-08-21 23:52:50 niro Exp $
5    
6  [ -z "$1" ] && echo "no mage-file given ..." && exit 1  [ -z "$1" ] && echo "no mage-file given ..." && exit 1
7    
8  MAGENAME=$1  MAGENAME="$1"
9    MAGE_TARGETS="$2" # -target !!
10  SMSUFFIX=smage2  SMSUFFIX=smage2
11    
12  source /etc/mage.rc  source /etc/mage.rc
13    
14  #cuts full pathnames or versioniezed names down to basename  # cuts full pathnames or versionized names down to basename
15  choppkgname(){  choppkgname(){
16          #we want this only if full name was used   # we want this only if full name was used
17          if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]   if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]
18          then   then
19                  #cuts ARCH and PBUILD   # cuts ARCH and PBUILD
20                  #ARCH comes from /etc/mage.rc   #ARCH comes from /etc/mage.rc
21                  #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")   #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")
22                  #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g")   #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g")
23                  MAGENAME=$(basename ${MAGENAME%-*} .mage)   MAGENAME=$(basename ${MAGENAME%-*} .mage)
24    
25                  #cuts version number   # cuts version number
26                  MAGENAME=$(basename ${MAGENAME%-*} .mage)   MAGENAME=$(basename ${MAGENAME%-*} .mage)
27          fi  
28     # cuts MAGE_TARGETS
29     MAGENAME=$(echo ${MAGENAME} | sed -e "s:${MAGE_TARGETS}::g")
30     fi
31  }  }
32    
33  choppkgname  choppkgname
# Line 31  choppkgname Line 35  choppkgname
35  #VERSION=$(echo ${VERSION#-*}|sed -e "s:-${ARCH}.*::g")  #VERSION=$(echo ${VERSION#-*}|sed -e "s:-${ARCH}.*::g")
36  #BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g" -e "s:-${VERSION}::g" -e "s:-${ARCH}-::g")  #BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g" -e "s:-${VERSION}::g" -e "s:-${ARCH}-::g")
37    
38  VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f2)  VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f2)
39  BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}::g"|cut -d- -f3)  BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f3)
40    
41  echo M:${MAGENAME}  echo M:${MAGENAME}
42  echo V:${VERSION}  echo V:${VERSION}
# Line 52  else Line 56  else
56   exit 1   exit 1
57  fi  fi
58    
59  #starts package build  # starts package build
60  smage2 ${SMAGEFILE} || exit 1  smage2 ${SMAGEFILE} || exit 1
61    
62    
63   # sometimes we only want to build a package with its dependencies  # sometimes we only want to build a package with its dependencies
64   # but don't want to install it ... so it's decided here  # but don't want to install it ... so it's decided here
65   # with a global variable NOINSTALL=true¦TRUE¦yes¦y  # with a global variable NOINSTALL=true¦TRUE¦yes¦y
66   case ${NOINSTALL} in  case ${NOINSTALL} in
67   TRUE|true|yes|y)   TRUE|true|yes|y)
68   echo   echo
69   echo "NOINSTALL=true; Package will not be installed ..."   echo "NOINSTALL=true; Package will not be installed ..."
70   echo   echo
71   sleep 1   sleep 1
72   ;;   ;;
73   *)   *)
74   #installs package   # installs package
75   mage install ${MAGENAME} || exit 1   mage install ${MAGENAME} || exit 1
76   ;;   ;;
77   esac  esac
78    
79   #clean-up builddir  # clean-up builddir
80   if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
81   then  then
82   rm -rf ${BUILDDIR}/*   rm -rf ${BUILDDIR}/*
83   fi  fi

Legend:
Removed from v.201  
changed lines
  Added in v.202