Magellan Linux

Diff of /branches/mage-next/src/mage4.functions.sh

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

revision 892 by niro, Tue Aug 4 19:52:16 2009 UTC revision 1271 by niro, Wed Apr 27 08:42:24 2011 UTC
# Line 198  install_files() Line 198  install_files()
198   is_config_protected "${pathto}"   is_config_protected "${pathto}"
199   retval="$?"   retval="$?"
200    
201   # 0 - not protected        #   # 0 - not protected         #
202   # 1 - error                #   # 1 - error                 #
203   # 2 - protected            #   # 2 - protected             #
204   # 3 - protected but masked #   # 3 - protected but masked  #
205     # 4 - protected but ignored #
206    
207   case ${retval} in   case ${retval} in
208   # file is not protected - (over)write it   # file is not protected - (over)write it
# Line 252  install_files() Line 253  install_files()
253   (( MAGE_PROTECT_COUNTER++ ))   (( MAGE_PROTECT_COUNTER++ ))
254   export MAGE_PROTECT_COUNTER   export MAGE_PROTECT_COUNTER
255   ;;   ;;
256    
257     # file is protected but ignored, delete the update/do nothing
258     4)
259     if [[ ${VERBOSE} = on ]]
260     then
261     echo -en "${COLRED}"
262     echo -n "! ignr "
263     echo -en "${COLDEFAULT}"
264     echo " === FILE: ${MROOT}${pathto}"
265     fi
266     # simply do nothing here
267     ;;
268   esac   esac
269   done < ${BUILDDIR}/${pkgname}/.files   done < ${BUILDDIR}/${pkgname}/.files
270    
# Line 326  install_blockdevices() Line 339  install_blockdevices()
339   local pkgname="$1"   local pkgname="$1"
340   local pathto   local pathto
341   local posix   local posix
342     local user
343     local group
344   local IFS   local IFS
345    
346   # sanity checks; abort if not given   # sanity checks; abort if not given
# Line 339  install_blockdevices() Line 354  install_blockdevices()
354   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
355   IFS=§   IFS=§
356    
357   while read pathto posix   while read pathto posix major minor user group
358   do   do
359   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
360   [[ ${VERBOSE} = on ]] && echo -e "\t>>> PIPE: ${MROOT}${pathto}"   [[ ${VERBOSE} = on ]] && echo -e "\t>>> PIPE: ${MROOT}${pathto}"
361    
362   mkfifo -m "${posix}" "${MROOT}$pathto"   mknod -m "${posix}" "${MROOT}${pathto}"
363     # make it optional atm !!
364     if [[ ! -z ${user} ]] && [[ ! -z ${group} ]]
365     then
366     chown "${user}:${group}" "${MROOT}${pathto}" b "${major}" "${minor}"
367     fi
368   done < ${BUILDDIR}/${pkgname}/.pipes   done < ${BUILDDIR}/${pkgname}/.pipes
369    
370   # very important: unsetting the '§' fieldseperator   # very important: unsetting the '§' fieldseperator
# Line 363  install_characterdevices() Line 383  install_characterdevices()
383   local posix   local posix
384   local major   local major
385   local minor   local minor
386     local user
387     local group
388   local IFS   local IFS
389    
390   # sanity checks; abort if not given   # sanity checks; abort if not given
# Line 376  install_characterdevices() Line 398  install_characterdevices()
398   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
399   IFS=§   IFS=§
400    
401   while read pathto posix major minor   while read pathto posix major minor user group
402   do   do
403   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
404   [[ ${VERBOSE} = on ]] && echo -e "\t>>> CHAR: ${MROOT}${pathto}"   [[ ${VERBOSE} = on ]] && echo -e "\t>>> CHAR: ${MROOT}${pathto}"
405    
406   mknod -m ${posix} "${MROOT}${pathto}" c ${major} ${minor}   mknod -m ${posix} "${MROOT}${pathto}" b "${major}" "${minor}"
407    
408     # make it optional atm !!
409     if [[ ! -z ${user} ]] && [[ ! -z ${group} ]]
410     then
411     chown "${user}:${group}" "${MROOT}${pathto}"
412     fi
413   done < ${BUILDDIR}/${pkgname}/.char   done < ${BUILDDIR}/${pkgname}/.char
414    
415   # very important: unsetting the '§' fieldseperator   # very important: unsetting the '§' fieldseperator
416   IFS=$'\n'   IFS=$'\n'
417  }  }
418    
419    ###################################################
420    # function install_fifos                          #
421    # install_fifos $PKGNAME                    #
422    ###################################################
423    install_fifos()
424    {
425     local pkgname="$1"
426     local pathto
427     local posix
428     local user
429     local group
430     local IFS
431    
432     # sanity checks; abort if not given
433     [ -z "${pkgname}" ] && die "install_fifos() \$pkgname not given."
434    
435     # check needed global vars
436     [ -z "${BUILDDIR}" ] && die "install_fifos() \$BUILDDIR not set."
437    
438     # make it optional atm !!
439     #[ ! -f ${BUILDDIR}/${pkgname}/.fifo ] && die "install_fifos() .fifo not found"
440     [ ! -f ${BUILDDIR}/${pkgname}/.fifo ] && return
441    
442     # sets fieldseperator to "§" instead of " "
443     IFS=§
444    
445     while read pathto posix user group
446     do
447     [ -z "${pathto}" ] && continue
448     [[ ${VERBOSE} = on ]] && echo -e "\t>>> FIFO: ${MROOT}${pathto}"
449    
450     mkfifo -m "${posix}" "${MROOT}${pathto}"
451     chown "${user}:${group}" "${MROOT}${pathto}"
452     done < ${BUILDDIR}/${pkgname}/.fifo
453    
454     # very important: unsetting the '§' fieldseperator
455     IFS=$'\n'
456    }
457    
458    
459  ###################################################  ###################################################
460  # function build_doinstall                        #  # function build_doinstall                        #
461  # build_doinstall $PKGNAME                  #  # build_doinstall $PKGNAME                  #
462  # NOTE: this is an wrapper do install packages    #  # NOTE: this is an wrapper to install packages    #
463  ###################################################  ###################################################
464  build_doinstall()  build_doinstall()
465  {  {
# Line 415  build_doinstall() Line 482  build_doinstall()
482   install_symlinks ${pkgname} || die "install symlinks ${pkgname}"   install_symlinks ${pkgname} || die "install symlinks ${pkgname}"
483   install_blockdevices ${pkgname} || die "install blockdevices ${pkgname}"   install_blockdevices ${pkgname} || die "install blockdevices ${pkgname}"
484   install_characterdevices ${pkgname} || die "install chardevices ${pkgname}"   install_characterdevices ${pkgname} || die "install chardevices ${pkgname}"
485     install_fifos ${pkgname} || die "install fifos ${pkgname}"
486  }  }
487    
488    
# Line 476  install_database_entry() Line 544  install_database_entry()
544    
545   # create fake file descriptors   # create fake file descriptors
546   # used by virtual and source packages   # used by virtual and source packages
547   for i in .dirs .symlinks .files .pipes .char   for i in .dirs .symlinks .files .pipes .char .fifo
548   do   do
549   touch ${dbrecorddir}/${i}   touch ${dbrecorddir}/${i}
550   done   done
# Line 494  install_database_entry() Line 562  install_database_entry()
562    
563   # normal packages needs these files   # normal packages needs these files
564   local i   local i
565   for i in .char .dirs .files .pipes .symlinks   for i in .char .dirs .files .pipes .symlinks .fifo
566   do   do
567   install -m 0644 ${BUILDDIR}/${pkgname}/${i} \   # make .fifo optional atm
568   ${dbrecorddir}/${i}   if [[ -f ${BUILDDIR}/${pkgname}/${i} ]]
569     then
570     install -m 0644 ${BUILDDIR}/${pkgname}/${i} ${dbrecorddir}/${i}
571     fi
572   done   done
573   ;;   ;;
574   esac   esac
# Line 772  remove_files() Line 843  remove_files()
843   done   done
844    
845   # sanity checks; abort if not given   # sanity checks; abort if not given
846   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_files() \$pcat not given."
847   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_files() \$pname not given."
848   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_files() \$pver not given."
849   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_files() \$pbuild not given."
850   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
851    
852   # check needed global vars   # check needed global vars
# Line 809  remove_files() Line 880  remove_files()
880   is_config_protected "${pathto}"   is_config_protected "${pathto}"
881   retval="$?"   retval="$?"
882    
883   # 0 - not protected        #   # 0 - not protected         #
884   # 1 - error                #   # 1 - error                 #
885   # 2 - protected            #   # 2 - protected             #
886   # 3 - protected but masked #   # 3 - protected but masked  #
887     # 4 - protected but ignored #
888    
889   case ${retval} in   case ${retval} in
890   # file is not protected - delete it   # file is not protected - delete it
# Line 831  remove_files() Line 903  remove_files()
903   echo " === FILE: ${MROOT}${pathto}"   echo " === FILE: ${MROOT}${pathto}"
904   fi   fi
905   ;;   ;;
906    
907     # file is protected but ignored, delete the update/do nothing
908     4)
909     if [[ ${VERBOSE} = on ]]
910     then
911     echo -en "${COLRED}"
912     echo -n "! ignr "
913     echo -en "${COLDEFAULT}"
914     echo " === FILE: ${MROOT}${pathto}"
915     fi
916     # simply do nothing here
917     ;;
918   esac   esac
919   ;;   ;;
920   1)   1)
# Line 853  remove_blockdevices() Line 937  remove_blockdevices()
937  {  {
938   local pathto   local pathto
939   local posix   local posix
940     local user
941     local group
942   local IFS   local IFS
943   local pcat   local pcat
944   local pname   local pname
# Line 876  remove_blockdevices() Line 962  remove_blockdevices()
962   done   done
963    
964   # sanity checks; abort if not given   # sanity checks; abort if not given
965   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_blockdevices() \$pcat not given."
966   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_blockdevices() \$pname not given."
967   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_blockdevices() \$pver not given."
968   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_blockdevices() \$pbuild not given."
969   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
970    
971   # check needed global vars   # check needed global vars
# Line 890  remove_blockdevices() Line 976  remove_blockdevices()
976   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
977   IFS=§   IFS=§
978    
979   while read pathto posix   while read pathto posix user group
980   do   do
981   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
982    
# Line 911  remove_characterdevices() Line 997  remove_characterdevices()
997  {  {
998   local pathto   local pathto
999   local posix   local posix
1000     local user
1001     local group
1002   local IFS   local IFS
1003   local pcat   local pcat
1004   local pname   local pname
# Line 934  remove_characterdevices() Line 1022  remove_characterdevices()
1022   done   done
1023    
1024   # sanity checks; abort if not given   # sanity checks; abort if not given
1025   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_characterdevices() \$pcat not given."
1026   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_characterdevices() \$pname not given."
1027   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_characterdevices() \$pver not given."
1028   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_characterdevices() \$pbuild not given."
1029   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
1030    
1031   # check needed global vars   # check needed global vars
# Line 948  remove_characterdevices() Line 1036  remove_characterdevices()
1036   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
1037   IFS=§   IFS=§
1038    
1039   while read pathto posix   while read pathto posix user group
1040   do   do
1041   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
1042    
# Line 962  remove_characterdevices() Line 1050  remove_characterdevices()
1050    
1051    
1052  ###################################################  ###################################################
1053    # function remove_fifos                           #
1054    # remove_fifos $PKGNAME                     #
1055    ###################################################
1056    remove_fifos()
1057    {
1058     local pathto
1059     local posix
1060     local user
1061     local group
1062     local IFS
1063     local pcat
1064     local pname
1065     local pver
1066     local pbuild
1067     local i
1068     local pfull
1069    
1070     IFS=$'\n'
1071    
1072     # very basic getops
1073     for i in $*
1074     do
1075     case $1 in
1076     --pcat|-c) shift; pcat="$1" ;;
1077     --pname|-n) shift; pname="$1" ;;
1078     --pver|-v) shift; pver="$1" ;;
1079     --pbuild|-b) shift; pbuild="$1" ;;
1080     esac
1081     shift
1082     done
1083    
1084     # sanity checks; abort if not given
1085     [ -z "${pcat}" ] && die "remove_fifos() \$pcat not given."
1086     [ -z "${pname}" ] && die "remove_fifos() \$pname not given."
1087     [ -z "${pver}" ] && die "remove_fifos() \$pver not given."
1088     [ -z "${pbuild}" ] && die "remove_fifos() \$pbuild not given."
1089     pfull="${pcat}/${pname}-${pver}-${pbuild}"
1090    
1091     # check needed global vars
1092     [ -z "${BUILDDIR}" ] && die "remove_fifos() \$BUILDDIR not set."
1093    
1094     # make it optional atm !!
1095     #[ ! -f ${MROOT}${INSTALLDB}/${pfull}/.fifo ] && die "remove_fifos() .fifo not found"
1096     [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.fifo ] && return
1097    
1098     # sets fieldseperator to "§" instead of " "
1099     IFS=§
1100    
1101     while read pathto posix user group
1102     do
1103     [ -z "${pathto}" ] && continue
1104    
1105     [[ ${VERBOSE} = on ]] && echo -e "\t<<< FIFO: ${MROOT}${pathto}"
1106     rm "${MROOT}${pathto}"
1107     done < ${MROOT}${INSTALLDB}/${pfull}/.fifo
1108    
1109     # very important: unsetting the '§' fieldseperator
1110     IFS=$'\n'
1111    }
1112    
1113    
1114    ###################################################
1115  # function remove_direcories                      #  # function remove_direcories                      #
1116  # remove_direcories $PKGNAME                #  # remove_direcories $PKGNAME                #
1117  ###################################################  ###################################################
# Line 992  remove_directories() Line 1142  remove_directories()
1142   done   done
1143    
1144   # sanity checks; abort if not given   # sanity checks; abort if not given
1145   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_directories() \$pcat not given."
1146   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_directories() \$pname not given."
1147   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_directories() \$pver not given."
1148   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_directories() \$pbuild not given."
1149   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
1150    
1151   # check needed global vars   # check needed global vars
# Line 1049  remove_directories() Line 1199  remove_directories()
1199  ###################################################  ###################################################
1200  # function build_douninstall                      #  # function build_douninstall                      #
1201  # build_douninstall $PKGNAME                #  # build_douninstall $PKGNAME                #
1202  # NOTE: this is an wrapper do remove packages     #  # NOTE: this is an wrapper to remove packages     #
1203  ###################################################  ###################################################
1204  build_douninstall()  build_douninstall()
1205  {  {
# Line 1083  build_douninstall() Line 1233  build_douninstall()
1233   # !! we use § as field seperator !!   # !! we use § as field seperator !!
1234   # doing so prevent us to get errors by filenames with spaces   # doing so prevent us to get errors by filenames with spaces
1235    
1236   for i in symlinks files blockdevices characterdevices directories   for i in symlinks files blockdevices characterdevices directories fifos
1237   do   do
1238   remove_${i} \   remove_${i} \
1239   --pcat "${pcat}" \   --pcat "${pcat}" \
# Line 1153  fetch_packages() Line 1303  fetch_packages()
1303   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "
1304   [[ ${VERBOSE} = off ]] && opt="--quiet"   [[ ${VERBOSE} = off ]] && opt="--quiet"
1305   wget \   wget \
1306   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1307   --directory-prefix=${PKGDIR} \   --directory-prefix=${PKGDIR} \
1308   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}
1309   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 1199  syncmage() Line 1346  syncmage()
1346   # clean up backup files (foo~)   # clean up backup files (foo~)
1347   find ${MAGEDIR} -name *~ -exec rm '{}' ';'   find ${MAGEDIR} -name *~ -exec rm '{}' ';'
1348    
1349   # check if an newer mage version is available   # check if a newer mage version is available
1350   is_newer_mage_version_available   is_newer_mage_version_available
1351  }  }
1352    
1353  syncmage_tarball()  syncmage_tarball()
1354  {  {
1355   local latest_tarball   local latest_tarball
1356     local latest_md5
1357   local temp="$(mktemp -d)"   local temp="$(mktemp -d)"
1358   local mirr mymirr   local mirr mymirr
1359     local opt
1360    
1361     # try to get the md5 marked as latest on the server
1362     latest_md5="mage-latest.md5"
1363    
1364   # try to get the tarball marked as latest on the server   # try to get the tarball marked as latest on the server
1365   latest_tarball="mage-latest.tar.bz2"   latest_tarball="mage-latest.tar.bz2"
# Line 1218  syncmage_tarball() Line 1370  syncmage_tarball()
1370   mymirr="${mirr%/*}"   mymirr="${mirr%/*}"
1371    
1372   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1373   echo "fetching latest tarball from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
1374     [[ ${VERBOSE} = off ]] && opt="--quiet"
1375     wget \
1376     ${WGET_FETCH_OPTIONS} \
1377     --directory-prefix=${temp} \
1378     ${opt} ${mymirr}/rsync/tarballs/${latest_md5}
1379    
1380     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1381     echo "fetching latest tarball from ${mymirr} ..."
1382   wget \   wget \
1383   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1384   --directory-prefix=${temp} \   --directory-prefix=${temp} \
1385   ${mymirr}/rsync/tarballs/${latest_tarball}   ${opt} ${mymirr}/rsync/tarballs/${latest_tarball}
1386   if [[ $? = 0 ]]   if [[ $? = 0 ]]
1387   then   then
1388   break   break
# Line 1237  syncmage_tarball() Line 1393  syncmage_tarball()
1393    
1394   if [[ -f ${temp}/${latest_tarball} ]]   if [[ -f ${temp}/${latest_tarball} ]]
1395   then   then
1396     # check md5
1397     if [[ ! -f ${temp}/${latest_md5} ]]
1398     then
1399     die "md5 is missing ... aborting"
1400     else
1401     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1402     echo -n "checking md5sum... "
1403     ( cd ${temp}; md5sum --check ${latest_md5} ) || die "md5 for ${latest_tarball} failed"
1404     fi
1405    
1406   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1407   then   then
1408   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 1252  syncmage_tarball() Line 1418  syncmage_tarball()
1418   if [[ -d ${temp} ]]   if [[ -d ${temp} ]]
1419   then   then
1420   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1421   echo "clenaing temp-files ..."   echo "cleaning temp-files ..."
1422   rm -rf ${temp}   rm -rf ${temp}
1423   fi   fi
1424    
1425     # check if a newer mage version is available
1426     is_newer_mage_version_available
1427   else   else
1428   die "Could not fetch the latest tarball ... aborting"   die "Could not fetch the latest tarball ... aborting"
1429   fi   fi
# Line 1422  get_highest_magefile() Line 1591  get_highest_magefile()
1591  #        1 - error                                #  #        1 - error                                #
1592  #        2 - protected                            #  #        2 - protected                            #
1593  #        3 - protected but masked                 #  #        3 - protected but masked                 #
1594    #        4 - protected but ignored                #
1595  #                                                 #  #                                                 #
1596  ###################################################  ###################################################
1597  is_config_protected()  is_config_protected()
# Line 1430  is_config_protected() Line 1600  is_config_protected()
1600   local TEST   local TEST
1601   local PROTECTED   local PROTECTED
1602   local IFS   local IFS
1603     local i
1604     local x
1605    
1606   EXPFILE="${MROOT}$1"   EXPFILE="${MROOT}$1"
1607    
# Line 1439  is_config_protected() Line 1611  is_config_protected()
1611   # to be safe; it may be '§'   # to be safe; it may be '§'
1612   IFS=' '   IFS=' '
1613    
1614   # check ob in config protect   # check if config protected
1615   for i in ${CONFIG_PROTECT}   for i in ${CONFIG_PROTECT}
1616   do   do
1617   # ersetzen von $i nur wenn am anfang der variable   # only replace $i in the beginning of the variable
1618   TEST="${EXPFILE/#${MROOT}${i}/Protected}"   TEST="${EXPFILE/#${MROOT}${i}/Protected}"
1619   if [[ ${TEST} != ${EXPFILE} ]]   if [[ ${TEST} != ${EXPFILE} ]]
1620   then   then
1621   # setzen das es protected ist   # file is config proteced
1622   PROTECTED=TRUE   PROTECTED=TRUE
1623    
1624   # check ob nicht doch maskiert   # check if not masked
1625   for x in ${CONFIG_PROTECT_MASK}   for x in ${CONFIG_PROTECT_MASK}
1626   do   do
1627   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"
# Line 1458  is_config_protected() Line 1630  is_config_protected()
1630   PROTECTED=MASKED   PROTECTED=MASKED
1631   fi   fi
1632   done   done
1633    
1634     # check if not ignored
1635     for x in ${CONFIG_PROTECT_IGNORE}
1636     do
1637     TEST="${EXPFILE/#${MROOT}${x}/Protect_Ignored}"
1638     if [[ ${TEST} != ${EXPFILE} ]]
1639     then
1640     PROTECTED=IGNORED
1641     fi
1642     done
1643   fi   fi
1644   done   done
1645    
# Line 1472  is_config_protected() Line 1654  is_config_protected()
1654   #echo "I'm protected, but masked - delete me"   #echo "I'm protected, but masked - delete me"
1655   return 3   return 3
1656   ;;   ;;
1657     IGNORED)
1658     #echo "I'm protected, but ignored - keep me, del update"
1659     return 4
1660     ;;
1661   *)   *)
1662   #echo "delete me"   #echo "delete me"
1663   return 0   return 0
# Line 1683  virtuals_add() Line 1869  virtuals_add()
1869    
1870  #deletes pakages from virtual database  #deletes pakages from virtual database
1871  #$1 virtualname; $2 pkgname  #$1 virtualname; $2 pkgname
1872  virtuals_del() {  virtuals_del()
1873    {
1874    
1875   local virtualname="$1"   local virtualname="$1"
1876   local pkgname="$2"   local pkgname="$2"
# Line 2117  get_value_from_magefile() Line 2304  get_value_from_magefile()
2304   local SDEPEND   local SDEPEND
2305   local PROVIDE   local PROVIDE
2306   local PKGTYPE   local PKGTYPE
2307     local MAGE_TARGETS
2308     local SPLIT_PACKAGE_BASE
2309   local preinstall   local preinstall
2310   local postinstall   local postinstall
2311   local preremove   local preremove
# Line 2237  mage_install() Line 2426  mage_install()
2426   echo B:${pbuild}   echo B:${pbuild}
2427   fi   fi
2428    
2429   if [[ -z ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
2430   then   then
2431   # basic svn compat   # basic svn compat
2432   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2433   then   then
2434   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2435   do   do
2436   smage2file="${i}"   smage2file="${i}"
2437   done   done
2438   else   else
2439   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2440     fi
2441    
2442     elif [[ -n ${SPLIT_PACKAGE_BASE} ]]
2443     then
2444     # basic svn compat
2445     if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2446     then
2447     for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2448     do
2449     smage2file="${i}"
2450     done
2451     else
2452     smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2453   fi   fi
2454    
2455   else   else
2456   # basic svn compat   # basic svn compat
2457   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2458   then   then
2459   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2
2460   do   do
2461   smage2file="${i}"   smage2file="${i}"
2462   done   done
2463   else   else
2464   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2
2465   fi   fi
2466   fi   fi
2467    
2468   if [ -f "${smage2file}" ]   if [ -f "${smage2file}" ]
2469   then   then
2470   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "
# Line 2604  mage_uninstall() Line 2808  mage_uninstall()
2808   unset -f postremove   unset -f postremove
2809  }  }
2810    
2811  show_etc_update_mesg() {  show_etc_update_mesg()
2812    {
2813   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0
2814    
2815   echo   echo

Legend:
Removed from v.892  
changed lines
  Added in v.1271