Magellan Linux

Diff of /trunk/mage/usr/lib/mage/convert_databases_smage.sh

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

revision 489 by niro, Wed May 2 06:12:04 2007 UTC revision 1642 by niro, Fri Jan 13 18:37:52 2012 UTC
# Line 1  Line 1 
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()
# Line 69  convert_smage_db() Line 65  convert_smage_db()
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
# Line 114  convert_smage_db() Line 110  convert_smage_db()
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,
# Line 189  EOF Line 185  EOF
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
# Line 321  then Line 317  then
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

Legend:
Removed from v.489  
changed lines
  Added in v.1642