Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 207 - (show annotations) (download) (as text)
Mon Aug 22 13:03:53 2005 UTC (18 years, 8 months ago) by niro
File MIME type: application/x-sh
File size: 2130 byte(s)
small error, now sourceinstall still works without any mage_targets

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

Properties

Name Value
svn:executable *