Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 202 - (hide annotations) (download) (as text)
Sun Aug 21 23:52:50 2005 UTC (18 years, 9 months ago) by niro
File MIME type: application/x-sh
File size: 2060 byte(s)
added auto regen suport of the whole mage-tree and added MAGE_TARGETS support  to mage srcinstall

1 niro 24 #!/bin/bash
2    
3 niro 202 # installs from source with given mage-file
4     # $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 niro 24
6     [ -z "$1" ] && echo "no mage-file given ..." && exit 1
7    
8 niro 202 MAGENAME="$1"
9     MAGE_TARGETS="$2" # -target !!
10 niro 24 SMSUFFIX=smage2
11    
12     source /etc/mage.rc
13    
14 niro 202 # cuts full pathnames or versionized names down to basename
15 niro 24 choppkgname(){
16 niro 202 # we want this only if full name was used
17     if [ -n "$(echo ${MAGENAME}|fgrep .mage)" ]
18     then
19     # cuts ARCH and PBUILD
20     #ARCH comes from /etc/mage.rc
21     #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-${ARCH}-r*.::g")
22     #MAGENAME=$(echo ${MAGENAME} |sed -e "s:-r*.::g")
23     MAGENAME=$(basename ${MAGENAME%-*} .mage)
24 niro 24
25 niro 202 # cuts version number
26     MAGENAME=$(basename ${MAGENAME%-*} .mage)
27    
28     # cuts MAGE_TARGETS
29     MAGENAME=$(echo ${MAGENAME} | sed -e "s:${MAGE_TARGETS}::g")
30     fi
31 niro 24 }
32    
33     choppkgname
34     #VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}::g")
35     #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")
37    
38 niro 202 VERSION=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f2)
39     BUILD=$(basename $1 .mage|sed -e "s:${MAGENAME}${MAGE_TARGETS}::g"|cut -d- -f3)
40 niro 24
41     echo M:${MAGENAME}
42     echo V:${VERSION}
43     echo B:${BUILD}
44    
45     #read
46    
47     SMAGEFILE=${SMAGESCRIPTSDIR}/${MAGENAME}/${MAGENAME}-${VERSION}-${BUILD}.${SMSUFFIX}
48     if [ -e ${SMAGEFILE} ]
49     then
50     echo ${SMAGEFILE}
51     else
52     echo
53     echo "$(basename ${SMAGEFILE}) not found."
54     echo "update your smage-tree and try it again."
55     echo
56     exit 1
57     fi
58    
59 niro 202 # starts package build
60 niro 24 smage2 ${SMAGEFILE} || exit 1
61    
62    
63 niro 202 # sometimes we only want to build a package with its dependencies
64     # but don't want to install it ... so it's decided here
65     # with a global variable NOINSTALL=true¦TRUE¦yes¦y
66     case ${NOINSTALL} in
67     TRUE|true|yes|y)
68     echo
69     echo "NOINSTALL=true; Package will not be installed ..."
70     echo
71     sleep 1
72     ;;
73     *)
74     # installs package
75     mage install ${MAGENAME} || exit 1
76     ;;
77     esac
78    
79     # clean-up builddir
80     if [ -d ${BUILDDIR} ]
81     then
82     rm -rf ${BUILDDIR}/*
83     fi

Properties

Name Value
svn:executable *