Magellan Linux

Diff of /trunk/mage/usr/lib/mage/smage2.functions.sh

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

revision 1648 by niro, Fri Jan 13 20:51:18 2012 UTC revision 1649 by niro, Fri Jan 13 21:04:02 2012 UTC
# Line 8  smagesource() Line 8  smagesource()
8  {  {
9   local file="$1"   local file="$1"
10   local mystate   local mystate
11   local mycodename   local mytag
12    
13   source ${file}   source ${file}
14    
# Line 29  smagesource() Line 29  smagesource()
29   fi   fi
30    
31   [[ -n ${STATE} ]] && mystate="${STATE}"   [[ -n ${STATE} ]] && mystate="${STATE}"
32     [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}"
33    
34   # do not overide if local state was broken or disabled!   # do not overide if local state was broken or disabled!
35   case ${STATE} in   case ${STATE} in
# Line 40  smagesource() Line 41  smagesource()
41   then   then
42   source ${SMAGESCRIPTSDIR}/distribution   source ${SMAGESCRIPTSDIR}/distribution
43   [[ -n ${STATE} ]] && mystate="${STATE}"   [[ -n ${STATE} ]] && mystate="${STATE}"
44     [[ -n ${DISTROTAG} ]] && mytag="${DISTROTAG}"
45   fi   fi
46   # now switch state and export it   # now switch state and export it
47   STATE="${mystate}"   STATE="${mystate}"
48    
49     if mqueryfeature "pkgdistrotag"
50     then
51     # if DISTROTAG was not defined globally
52     # or in distribution file then deactivate this feature!
53     # at this point $mytag must have the distrotag
54     if [[ -z ${mytag} ]]
55     then
56     FVERBOSE=off msetfeature "!pkgdistrotag"
57     unset DISTROTAG
58     echo -e "${COLRED}Requested 'pkgdistrotag' but no \$DISTROTAG found!${COLDEFAULT}"
59     echo -e "${COLRED}Disabled the feature for pkgbuild sanity!${COLDEFAULT}"
60     else
61     # now switch state and export it
62     export DISTROTAG="${mytag}"
63     fi
64     else
65     unset DISTROTAG
66     fi
67    }
68    
69    print_distrotag()
70    {
71     if FVERBOSE=off mqueryfeature "pkgdistrotag"
72     then
73     if [[ ! -z ${DISTROTAG} ]]
74     then
75     # add a point as prefix
76     echo ".${DISTROTAG}"
77     fi
78     fi
79  }  }
80    
81  showversion()  showversion()
# Line 678  build_mage_script() Line 711  build_mage_script()
711   > ${dest}   > ${dest}
712    
713   # pgkname and state   # pgkname and state
714   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}$(print_distrotag)-${PBUILD}\"" >> ${dest}
715   echo "STATE=\"${STATE}\"" >> ${dest}   echo "STATE=\"${STATE}\"" >> ${dest}
716    
717   # description and homepage   # description and homepage
# Line 1090  generate_package_md5sum() Line 1123  generate_package_md5sum()
1123   [ -n "${target}" ] && target="-${target}"   [ -n "${target}" ] && target="-${target}"
1124    
1125   # build pkgname   # build pkgname
1126   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"   pkgname="${pname}${target}-${pver}-${parch}$(print_distrotag)-${pbuild}"
1127    
1128   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
1129   if mqueryfeature regentree   if mqueryfeature regentree

Legend:
Removed from v.1648  
changed lines
  Added in v.1649