Magellan Linux

Contents of /trunk/mage/usr/lib/mage/fix_database-mage-0.3.6-r5.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 24 - (show annotations) (download) (as text)
Wed Jan 5 05:08:01 2005 UTC (19 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 567 byte(s)
mage-0.3.6-r8 import

1 #!/bin/bash
2 # version: 0.3.6-r5
3
4 source /etc/mage.rc
5 OLD_DB=$1
6 NEW_DB=$2
7
8 for i in ${OLD_DB}/*
9 do
10 OLDFILE=$(basename ${i})
11 #echo "i=${i}"
12 for x in ${MAGEDIR}/*/*/*.mage
13 do
14 NEWFILE=$(basename ${x} .mage)
15 if [ ${OLDFILE} == ${NEWFILE} ]
16 then
17 echo "Updating ${OLDFILE}"
18 CAT=${x%/*/*}
19 CAT=$(echo ${CAT/${MAGEDIR}/} | sed -e s:/::g)
20
21 install -d ${NEW_DB}/${CAT}
22 cp -a ${OLD_DB}/${OLDFILE} ${NEW_DB}/${CAT}
23 echo "${CAT}" > ${NEW_DB}/${CAT}/${NEWFILE}/.categorie
24 fi
25 done
26 done
27
28
29 #finally mark db as fixed
30 touch ${NEW_DB}/.fixed-mage-0.3.6-r5

Properties

Name Value
svn:executable *