1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
source /etc/mage.rc.global |
: ${MAGERC="/etc/mage.rc"} |
|
source /etc/mage.rc |
|
|
|
|
|
|
|
|
#### fixups #### |
|
|
MLIBDIR=/home/tjoke/alx-cvs/magellan-src/mage/usr/lib/mage |
|
|
INSTALLDB=/var/db/mage |
|
|
################# |
|
4 |
|
|
5 |
|
source /etc/mage.rc.global |
6 |
|
source ${MAGERC} |
7 |
source ${MLIBDIR}/mage4.functions.sh |
source ${MLIBDIR}/mage4.functions.sh |
8 |
|
source ${MLIBDIR}/smage2.functions.sh |
9 |
source ${MLIBDIR}/sql_functions.sh |
source ${MLIBDIR}/sql_functions.sh |
10 |
|
|
11 |
die() |
die() |
65 |
{ |
{ |
66 |
local i |
local i |
67 |
local smagefile |
local smagefile |
68 |
local PCATEGORIE |
local PCAT |
69 |
local PNAME |
local PNAME |
70 |
local PVER |
local PVER |
71 |
local PBUILD |
local PBUILD |
110 |
1|true) echo "converting ${smagefile}" ;; |
1|true) echo "converting ${smagefile}" ;; |
111 |
esac |
esac |
112 |
|
|
113 |
source ${smagefile} |
smagesource ${smagefile} |
114 |
|
|
115 |
# substitute r from pbuild |
# substitute r from pbuild |
116 |
PBUILD="${PBUILD/r/}" |
PBUILD="${PBUILD/r/}" |
117 |
|
|
118 |
pcatid=$(sql "select id from categories where pcat='${PCATEGORIE}'") |
pcatid=$(sql "select id from categories where pcat='${PCAT}'") |
119 |
sql "insert into packages( |
sql "insert into packages( |
120 |
pname, |
pname, |
121 |
pver, |
pver, |
185 |
|
|
186 |
for arch in i686 x86_64 |
for arch in i686 x86_64 |
187 |
do |
do |
188 |
md5file="${MAGEDIR}/${PCATEGORIE}/${PNAME}/md5/${PNAME}-${PVER}-${arch}-r${PBUILD}.md5" |
md5file="${MAGEDIR}/${PCAT}/${PNAME}/md5/${PNAME}-${PVER}-${arch}-r${PBUILD}.md5" |
189 |
[[ -f ${md5file} ]] && md5sum="$(cat ${md5file} | cut -d' ' -f1)" |
[[ -f ${md5file} ]] && md5sum="$(cat ${md5file} | cut -d' ' -f1)" |
190 |
|
|
191 |
# fix descriptions |
# fix descriptions |
317 |
fi |
fi |
318 |
|
|
319 |
|
|
320 |
unset PCATEGORIE |
unset PCAT |
321 |
unset PNAME |
unset PNAME |
322 |
unset PVER |
unset PVER |
323 |
unset PBUILD |
unset PBUILD |