Magellan Linux

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

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

revision 876 by niro, Thu May 21 19:07:14 2009 UTC revision 1209 by niro, Fri Jan 28 20:37:27 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 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"   mkfifo -m "${posix}" "${MROOT}${pathto}"
363     chown "${user}:${group}" "${MROOT}${pathto}"
364   done < ${BUILDDIR}/${pkgname}/.pipes   done < ${BUILDDIR}/${pkgname}/.pipes
365    
366   # very important: unsetting the '§' fieldseperator   # very important: unsetting the '§' fieldseperator
# Line 363  install_characterdevices() Line 379  install_characterdevices()
379   local posix   local posix
380   local major   local major
381   local minor   local minor
382     local user
383     local group
384   local IFS   local IFS
385    
386   # sanity checks; abort if not given   # sanity checks; abort if not given
# Line 376  install_characterdevices() Line 394  install_characterdevices()
394   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
395   IFS=§   IFS=§
396    
397   while read pathto posix major minor   while read pathto posix major minor user group
398   do   do
399   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
400   [[ ${VERBOSE} = on ]] && echo -e "\t>>> CHAR: ${MROOT}${pathto}"   [[ ${VERBOSE} = on ]] && echo -e "\t>>> CHAR: ${MROOT}${pathto}"
401    
402   mknod -m ${posix} "${MROOT}${pathto}" c ${major} ${minor}   mknod -m ${posix} "${MROOT}${pathto}" c ${major} ${minor}
403     chown "${user}:${group}" "${MROOT}${pathto}"
404   done < ${BUILDDIR}/${pkgname}/.char   done < ${BUILDDIR}/${pkgname}/.char
405    
406   # very important: unsetting the '§' fieldseperator   # very important: unsetting the '§' fieldseperator
407   IFS=$'\n'   IFS=$'\n'
408  }  }
409    
410    ###################################################
411    # function install_fifos                          #
412    # install_fifos $PKGNAME                    #
413    ###################################################
414    install_fifos()
415    {
416     local pkgname="$1"
417     local pathto
418     local posix
419     local user
420     local group
421     local IFS
422    
423     # sanity checks; abort if not given
424     [ -z "${pkgname}" ] && die "install_fifos() \$pkgname not given."
425    
426     # check needed global vars
427     [ -z "${BUILDDIR}" ] && die "install_fifos() \$BUILDDIR not set."
428    
429     [ ! -f ${BUILDDIR}/${pkgname}/.fifo ] && die "install_fifos() .fifo not found"
430    
431     # sets fieldseperator to "§" instead of " "
432     IFS=§
433    
434     while read pathto posix user group
435     do
436     [ -z "${pathto}" ] && continue
437     [[ ${VERBOSE} = on ]] && echo -e "\t>>> FIFO: ${MROOT}${pathto}"
438    
439     mkfifo -m "${posix}" "${MROOT}${pathto}"
440     chown "${user}:${group}" "${MROOT}${pathto}"
441     done < ${BUILDDIR}/${pkgname}/.fifo
442    
443     # very important: unsetting the '§' fieldseperator
444     IFS=$'\n'
445    }
446    
447    
448  ###################################################  ###################################################
449  # function build_doinstall                        #  # function build_doinstall                        #
450  # build_doinstall $PKGNAME                  #  # build_doinstall $PKGNAME                  #
451  # NOTE: this is an wrapper do install packages    #  # NOTE: this is an wrapper to install packages    #
452  ###################################################  ###################################################
453  build_doinstall()  build_doinstall()
454  {  {
# Line 415  build_doinstall() Line 471  build_doinstall()
471   install_symlinks ${pkgname} || die "install symlinks ${pkgname}"   install_symlinks ${pkgname} || die "install symlinks ${pkgname}"
472   install_blockdevices ${pkgname} || die "install blockdevices ${pkgname}"   install_blockdevices ${pkgname} || die "install blockdevices ${pkgname}"
473   install_characterdevices ${pkgname} || die "install chardevices ${pkgname}"   install_characterdevices ${pkgname} || die "install chardevices ${pkgname}"
474     install_fifos ${pkgname} || die "install fifos ${pkgname}"
475  }  }
476    
477    
# Line 476  install_database_entry() Line 533  install_database_entry()
533    
534   # create fake file descriptors   # create fake file descriptors
535   # used by virtual and source packages   # used by virtual and source packages
536   for i in .dirs .symlinks .files .pipes .char   for i in .dirs .symlinks .files .pipes .char .fifo
537   do   do
538   touch ${dbrecorddir}/${i}   touch ${dbrecorddir}/${i}
539   done   done
# Line 494  install_database_entry() Line 551  install_database_entry()
551    
552   # normal packages needs these files   # normal packages needs these files
553   local i   local i
554   for i in .char .dirs .files .pipes .symlinks   for i in .char .dirs .files .pipes .symlinks .fifo
555   do   do
556   install -m 0644 ${BUILDDIR}/${pkgname}/${i} \   install -m 0644 ${BUILDDIR}/${pkgname}/${i} \
557   ${dbrecorddir}/${i}   ${dbrecorddir}/${i}
# Line 772  remove_files() Line 829  remove_files()
829   done   done
830    
831   # sanity checks; abort if not given   # sanity checks; abort if not given
832   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_files() \$pcat not given."
833   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_files() \$pname not given."
834   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_files() \$pver not given."
835   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_files() \$pbuild not given."
836   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
837    
838   # check needed global vars   # check needed global vars
# Line 809  remove_files() Line 866  remove_files()
866   is_config_protected "${pathto}"   is_config_protected "${pathto}"
867   retval="$?"   retval="$?"
868    
869   # 0 - not protected        #   # 0 - not protected         #
870   # 1 - error                #   # 1 - error                 #
871   # 2 - protected            #   # 2 - protected             #
872   # 3 - protected but masked #   # 3 - protected but masked  #
873     # 4 - protected but ignored #
874    
875   case ${retval} in   case ${retval} in
876   # file is not protected - delete it   # file is not protected - delete it
# Line 831  remove_files() Line 889  remove_files()
889   echo " === FILE: ${MROOT}${pathto}"   echo " === FILE: ${MROOT}${pathto}"
890   fi   fi
891   ;;   ;;
892    
893     # file is protected but ignored, delete the update/do nothing
894     4)
895     if [[ ${VERBOSE} = on ]]
896     then
897     echo -en "${COLRED}"
898     echo -n "! ignr "
899     echo -en "${COLDEFAULT}"
900     echo " === FILE: ${MROOT}${pathto}"
901     fi
902     # simply do nothing here
903     ;;
904   esac   esac
905   ;;   ;;
906   1)   1)
# Line 853  remove_blockdevices() Line 923  remove_blockdevices()
923  {  {
924   local pathto   local pathto
925   local posix   local posix
926     local user
927     local group
928   local IFS   local IFS
929   local pcat   local pcat
930   local pname   local pname
# Line 876  remove_blockdevices() Line 948  remove_blockdevices()
948   done   done
949    
950   # sanity checks; abort if not given   # sanity checks; abort if not given
951   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_blockdevices() \$pcat not given."
952   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_blockdevices() \$pname not given."
953   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_blockdevices() \$pver not given."
954   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_blockdevices() \$pbuild not given."
955   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
956    
957   # check needed global vars   # check needed global vars
# Line 890  remove_blockdevices() Line 962  remove_blockdevices()
962   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
963   IFS=§   IFS=§
964    
965   while read pathto posix   while read pathto posix user group
966   do   do
967   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
968    
# Line 911  remove_characterdevices() Line 983  remove_characterdevices()
983  {  {
984   local pathto   local pathto
985   local posix   local posix
986     local user
987     local group
988   local IFS   local IFS
989   local pcat   local pcat
990   local pname   local pname
# Line 934  remove_characterdevices() Line 1008  remove_characterdevices()
1008   done   done
1009    
1010   # sanity checks; abort if not given   # sanity checks; abort if not given
1011   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_characterdevices() \$pcat not given."
1012   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_characterdevices() \$pname not given."
1013   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_characterdevices() \$pver not given."
1014   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_characterdevices() \$pbuild not given."
1015   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
1016    
1017   # check needed global vars   # check needed global vars
# Line 948  remove_characterdevices() Line 1022  remove_characterdevices()
1022   # sets fieldseperator to "§" instead of " "   # sets fieldseperator to "§" instead of " "
1023   IFS=§   IFS=§
1024    
1025   while read pathto posix   while read pathto posix user group
1026   do   do
1027   [ -z "${pathto}" ] && continue   [ -z "${pathto}" ] && continue
1028    
# Line 962  remove_characterdevices() Line 1036  remove_characterdevices()
1036    
1037    
1038  ###################################################  ###################################################
1039    # function remove_fifos                           #
1040    # remove_fifos $PKGNAME                     #
1041    ###################################################
1042    remove_fifos()
1043    {
1044     local pathto
1045     local posix
1046     local user
1047     local group
1048     local IFS
1049     local pcat
1050     local pname
1051     local pver
1052     local pbuild
1053     local i
1054     local pfull
1055    
1056     IFS=$'\n'
1057    
1058     # very basic getops
1059     for i in $*
1060     do
1061     case $1 in
1062     --pcat|-c) shift; pcat="$1" ;;
1063     --pname|-n) shift; pname="$1" ;;
1064     --pver|-v) shift; pver="$1" ;;
1065     --pbuild|-b) shift; pbuild="$1" ;;
1066     esac
1067     shift
1068     done
1069    
1070     # sanity checks; abort if not given
1071     [ -z "${pcat}" ] && die "remove_fifos() \$pcat not given."
1072     [ -z "${pname}" ] && die "remove_fifos() \$pname not given."
1073     [ -z "${pver}" ] && die "remove_fifos() \$pver not given."
1074     [ -z "${pbuild}" ] && die "remove_fifos() \$pbuild not given."
1075     pfull="${pcat}/${pname}-${pver}-${pbuild}"
1076    
1077     # check needed global vars
1078     [ -z "${BUILDDIR}" ] && die "remove_fifos() \$BUILDDIR not set."
1079    
1080     [ ! -f ${MROOT}${INSTALLDB}/${pfull}/.fifo ] && die "remove_fifos() .fifo not found"
1081    
1082     # sets fieldseperator to "§" instead of " "
1083     IFS=§
1084    
1085     while read pathto posix user group
1086     do
1087     [ -z "${pathto}" ] && continue
1088    
1089     [[ ${VERBOSE} = on ]] && echo -e "\t<<< FIFO: ${MROOT}${pathto}"
1090     rm "${MROOT}${pathto}"
1091     done < ${MROOT}${INSTALLDB}/${pfull}/.fifo
1092    
1093     # very important: unsetting the '§' fieldseperator
1094     IFS=$'\n'
1095    }
1096    
1097    
1098    ###################################################
1099  # function remove_direcories                      #  # function remove_direcories                      #
1100  # remove_direcories $PKGNAME                #  # remove_direcories $PKGNAME                #
1101  ###################################################  ###################################################
# Line 992  remove_directories() Line 1126  remove_directories()
1126   done   done
1127    
1128   # sanity checks; abort if not given   # sanity checks; abort if not given
1129   [ -z "${pcat}" ] && die "remove_symlinks() \$pcat not given."   [ -z "${pcat}" ] && die "remove_directories() \$pcat not given."
1130   [ -z "${pname}" ] && die "remove_symlinks() \$pname not given."   [ -z "${pname}" ] && die "remove_directories() \$pname not given."
1131   [ -z "${pver}" ] && die "remove_symlinks() \$pver not given."   [ -z "${pver}" ] && die "remove_directories() \$pver not given."
1132   [ -z "${pbuild}" ] && die "remove_symlinks() \$pbuild not given."   [ -z "${pbuild}" ] && die "remove_directories() \$pbuild not given."
1133   pfull="${pcat}/${pname}-${pver}-${pbuild}"   pfull="${pcat}/${pname}-${pver}-${pbuild}"
1134    
1135   # check needed global vars   # check needed global vars
# Line 1049  remove_directories() Line 1183  remove_directories()
1183  ###################################################  ###################################################
1184  # function build_douninstall                      #  # function build_douninstall                      #
1185  # build_douninstall $PKGNAME                #  # build_douninstall $PKGNAME                #
1186  # NOTE: this is an wrapper do remove packages     #  # NOTE: this is an wrapper to remove packages     #
1187  ###################################################  ###################################################
1188  build_douninstall()  build_douninstall()
1189  {  {
# Line 1083  build_douninstall() Line 1217  build_douninstall()
1217   # !! we use § as field seperator !!   # !! we use § as field seperator !!
1218   # doing so prevent us to get errors by filenames with spaces   # doing so prevent us to get errors by filenames with spaces
1219    
1220   for i in symlinks files blockdevices characterdevices directories   for i in symlinks files blockdevices characterdevices directories fifos
1221   do   do
1222   remove_${i} \   remove_${i} \
1223   --pcat "${pcat}" \   --pcat "${pcat}" \
# Line 1153  fetch_packages() Line 1287  fetch_packages()
1287   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "   echo -e " fetching (${count_current}/${count_total}): ${pkg} ... "
1288   [[ ${VERBOSE} = off ]] && opt="--quiet"   [[ ${VERBOSE} = off ]] && opt="--quiet"
1289   wget \   wget \
1290   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1291   --directory-prefix=${PKGDIR} \   --directory-prefix=${PKGDIR} \
1292   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}   ${opt} ${mirr}/${PACKAGES_SERVER_PATH}/${pkg}
1293   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 1199  syncmage() Line 1330  syncmage()
1330   # clean up backup files (foo~)   # clean up backup files (foo~)
1331   find ${MAGEDIR} -name *~ -exec rm '{}' ';'   find ${MAGEDIR} -name *~ -exec rm '{}' ';'
1332    
1333   # check if an newer mage version is available   # check if a newer mage version is available
1334   is_newer_mage_version_available   is_newer_mage_version_available
1335  }  }
1336    
1337  syncmage_tarball()  syncmage_tarball()
1338  {  {
1339   local latest_tarball   local latest_tarball
1340     local latest_md5
1341   local temp="$(mktemp -d)"   local temp="$(mktemp -d)"
1342   local mirr mymirr   local mirr mymirr
1343     local opt
1344    
1345     # try to get the md5 marked as latest on the server
1346     latest_md5="mage-latest.md5"
1347    
1348   # try to get the tarball marked as latest on the server   # try to get the tarball marked as latest on the server
1349   latest_tarball="mage-latest.tar.bz2"   latest_tarball="mage-latest.tar.bz2"
# Line 1218  syncmage_tarball() Line 1354  syncmage_tarball()
1354   mymirr="${mirr%/*}"   mymirr="${mirr%/*}"
1355    
1356   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1357   echo "fetching latest tarball from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
1358     [[ ${VERBOSE} = off ]] && opt="--quiet"
1359     wget \
1360     ${WGET_FETCH_OPTIONS} \
1361     --directory-prefix=${temp} \
1362     ${opt} ${mymirr}/rsync/tarballs/${latest_md5}
1363    
1364     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1365     echo "fetching latest tarball from ${mymirr} ..."
1366   wget \   wget \
1367   --passive-ftp \   ${WGET_FETCH_OPTIONS} \
  --tries 3 \  
  --continue \  
  --progress bar \  
1368   --directory-prefix=${temp} \   --directory-prefix=${temp} \
1369   ${mymirr}/rsync/tarballs/${latest_tarball}   ${opt} ${mymirr}/rsync/tarballs/${latest_tarball}
1370   if [[ $? = 0 ]]   if [[ $? = 0 ]]
1371   then   then
1372   break   break
# Line 1237  syncmage_tarball() Line 1377  syncmage_tarball()
1377    
1378   if [[ -f ${temp}/${latest_tarball} ]]   if [[ -f ${temp}/${latest_tarball} ]]
1379   then   then
1380     # check md5
1381     if [[ ! -f ${temp}/${latest_md5} ]]
1382     then
1383     die "md5 is missing ... aborting"
1384     else
1385     echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1386     echo -n "checking md5sum... "
1387     ( cd ${temp}; md5sum --check ${latest_md5} ) || die "md5 for ${latest_tarball} failed"
1388     fi
1389    
1390   if [[ -d ${MAGEDIR} ]]   if [[ -d ${MAGEDIR} ]]
1391   then   then
1392   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
# Line 1252  syncmage_tarball() Line 1402  syncmage_tarball()
1402   if [[ -d ${temp} ]]   if [[ -d ${temp} ]]
1403   then   then
1404   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1405   echo "clenaing temp-files ..."   echo "cleaning temp-files ..."
1406   rm -rf ${temp}   rm -rf ${temp}
1407   fi   fi
1408    
1409     # check if a newer mage version is available
1410     is_newer_mage_version_available
1411   else   else
1412   die "Could not fetch the latest tarball ... aborting"   die "Could not fetch the latest tarball ... aborting"
1413   fi   fi
# Line 1422  get_highest_magefile() Line 1575  get_highest_magefile()
1575  #        1 - error                                #  #        1 - error                                #
1576  #        2 - protected                            #  #        2 - protected                            #
1577  #        3 - protected but masked                 #  #        3 - protected but masked                 #
1578    #        4 - protected but ignored                #
1579  #                                                 #  #                                                 #
1580  ###################################################  ###################################################
1581  is_config_protected()  is_config_protected()
# Line 1430  is_config_protected() Line 1584  is_config_protected()
1584   local TEST   local TEST
1585   local PROTECTED   local PROTECTED
1586   local IFS   local IFS
1587     local i
1588     local x
1589    
1590   EXPFILE="${MROOT}$1"   EXPFILE="${MROOT}$1"
1591    
# Line 1439  is_config_protected() Line 1595  is_config_protected()
1595   # to be safe; it may be '§'   # to be safe; it may be '§'
1596   IFS=' '   IFS=' '
1597    
1598   # check ob in config protect   # check if config protected
1599   for i in ${CONFIG_PROTECT}   for i in ${CONFIG_PROTECT}
1600   do   do
1601   # ersetzen von $i nur wenn am anfang der variable   # only replace $i in the beginning of the variable
1602   TEST="${EXPFILE/#${MROOT}${i}/Protected}"   TEST="${EXPFILE/#${MROOT}${i}/Protected}"
1603   if [[ ${TEST} != ${EXPFILE} ]]   if [[ ${TEST} != ${EXPFILE} ]]
1604   then   then
1605   # setzen das es protected ist   # file is config proteced
1606   PROTECTED=TRUE   PROTECTED=TRUE
1607    
1608   # check ob nicht doch maskiert   # check if not masked
1609   for x in ${CONFIG_PROTECT_MASK}   for x in ${CONFIG_PROTECT_MASK}
1610   do   do
1611   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"   TEST="${EXPFILE/#${MROOT}${x}/Protect_Masked}"
# Line 1458  is_config_protected() Line 1614  is_config_protected()
1614   PROTECTED=MASKED   PROTECTED=MASKED
1615   fi   fi
1616   done   done
1617    
1618     # check if not ignored
1619     for x in ${CONFIG_PROTECT_IGNORE}
1620     do
1621     TEST="${EXPFILE/#${MROOT}${x}/Protect_Ignored}"
1622     if [[ ${TEST} != ${EXPFILE} ]]
1623     then
1624     PROTECTED=IGNORED
1625     fi
1626     done
1627   fi   fi
1628   done   done
1629    
# Line 1472  is_config_protected() Line 1638  is_config_protected()
1638   #echo "I'm protected, but masked - delete me"   #echo "I'm protected, but masked - delete me"
1639   return 3   return 3
1640   ;;   ;;
1641     IGNORED)
1642     #echo "I'm protected, but ignored - keep me, del update"
1643     return 4
1644     ;;
1645   *)   *)
1646   #echo "delete me"   #echo "delete me"
1647   return 0   return 0
# Line 1683  virtuals_add() Line 1853  virtuals_add()
1853    
1854  #deletes pakages from virtual database  #deletes pakages from virtual database
1855  #$1 virtualname; $2 pkgname  #$1 virtualname; $2 pkgname
1856  virtuals_del() {  virtuals_del()
1857    {
1858    
1859   local virtualname="$1"   local virtualname="$1"
1860   local pkgname="$2"   local pkgname="$2"
# Line 2117  get_value_from_magefile() Line 2288  get_value_from_magefile()
2288   local SDEPEND   local SDEPEND
2289   local PROVIDE   local PROVIDE
2290   local PKGTYPE   local PKGTYPE
2291     local MAGE_TARGETS
2292     local SPLIT_PACKAGE_BASE
2293   local preinstall   local preinstall
2294   local postinstall   local postinstall
2295   local preremove   local preremove
# Line 2237  mage_install() Line 2410  mage_install()
2410   echo B:${pbuild}   echo B:${pbuild}
2411   fi   fi
2412    
2413   if [[ -z ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
2414   then   then
2415   # basic svn compat   # basic svn compat
2416   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2417   then   then
2418   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2419   do   do
2420   smage2file="${i}"   smage2file="${i}"
2421   done   done
2422   else   else
2423   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2424   fi   fi
2425    
2426     elif [[ -n ${SPLIT_PACKAGE_BASE} ]]
2427     then
2428     # basic svn compat
2429     if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2430     then
2431     for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2432     do
2433     smage2file="${i}"
2434     done
2435     else
2436     smage2file=${SMAGESCRIPTSDIR}/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2437     fi
2438    
2439   else   else
2440   # basic svn compat   # basic svn compat
2441   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]
2442   then   then
2443   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2
2444   do   do
2445   smage2file="${i}"   smage2file="${i}"
2446   done   done
2447   else   else
2448   smage2file=${SMAGESCRIPTSDIR}/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   smage2file=${SMAGESCRIPTSDIR}/${pname}/${pname}-${pver}-${pbuild}.smage2
2449   fi   fi
2450   fi   fi
2451    
2452   if [ -f "${smage2file}" ]   if [ -f "${smage2file}" ]
2453   then   then
2454   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "   echo -e " ${COLBLUE}***${COLDEFAULT} building package from source ... "
# Line 2604  mage_uninstall() Line 2792  mage_uninstall()
2792   unset -f postremove   unset -f postremove
2793  }  }
2794    
2795  show_etc_update_mesg() {  show_etc_update_mesg()
2796    {
2797   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0   [ ${MAGE_PROTECT_COUNTER} -eq 0 ] && return 0
2798    
2799   echo   echo
# Line 2789  blacklisted() Line 2978  blacklisted()
2978   [[ ${USE_UNSTABLE} = true ]] && local MAGE_DISTRIBUTION=unstable   [[ ${USE_UNSTABLE} = true ]] && local MAGE_DISTRIBUTION=unstable
2979   [[ ${USE_TESTING} = true ]] && local MAGE_DISTRIBUTION=testing   [[ ${USE_TESTING} = true ]] && local MAGE_DISTRIBUTION=testing
2980    
2981   local EXCLUDED="/etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION}"   # support both types for the moment
2982     if [[ -f /etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION} ]]
2983     then
2984     local EXCLUDED="/etc/mage-profile/package.blacklist-${ARCH}-${MAGE_DISTRIBUTION}"
2985     else
2986     local EXCLUDED="/etc/mage-profile/package.blacklist-${ARCH}"
2987     fi
2988    
2989   # return 0 if the list not exist; nothin is masked   # return 0 if the list not exist; nothin is masked
2990   [[ ! -f ${EXCLUDED} ]] && return 0   [[ ! -f ${EXCLUDED} ]] && return 0

Legend:
Removed from v.876  
changed lines
  Added in v.1209