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 |
|
|
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 |
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() |
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 |
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 |