Magellan Linux

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

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

revision 1273 by niro, Wed Apr 27 09:45:07 2011 UTC revision 1541 by niro, Tue Dec 20 12:58:32 2011 UTC
# Line 228  install_files() Line 228  install_files()
228   "${user}" \   "${user}" \
229   "${group}" \   "${group}" \
230   "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \   "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \
231   "${MROOT}${pathto}")" \   "${MROOT}${pathto}")" \
232   "${md5sum}"   "${md5sum}"
233   ;;   ;;
234    
# Line 255  install_files() Line 255  install_files()
255   "${user}" \   "${user}" \
256   "${group}" \   "${group}" \
257   "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \   "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \
258   "${dest_protected}")" \   "${dest_protected}")" \
259   "${md5sum}"   "${md5sum}"
260    
261   # update global MAGE_PROTECT_COUNTER   # update global MAGE_PROTECT_COUNTER
# Line 272  install_files() Line 272  install_files()
272   echo -en "${COLDEFAULT}"   echo -en "${COLDEFAULT}"
273   echo " === FILE: ${MROOT}${pathto}"   echo " === FILE: ${MROOT}${pathto}"
274   fi   fi
275   # simply do nothing here   # simply do nothing here - only fix mtime
276     fix_descriptor ${pkgname}/.files \
277     "${pathto}" \
278     "${posix}" \
279     "${user}" \
280     "${group}" \
281     "$(fix_mtime "${BUILDDIR}/${pkgname}"/.mtime \
282     "${MROOT}${pathto}")" \
283     "${md5sum}"
284   ;;   ;;
285   esac   esac
286   done < ${BUILDDIR}/${pkgname}/.files   done < ${BUILDDIR}/${pkgname}/.files
# Line 476  build_doinstall() Line 484  build_doinstall()
484    
485   # sanity checks; abort if not given   # sanity checks; abort if not given
486   [ -z "${pkgname}" ] && die "build_doinstall() \$pkgname not given."   [ -z "${pkgname}" ] && die "build_doinstall() \$pkgname not given."
487    
488   # this is only a wrapper   # this is only a wrapper
489    
490   # NOTE:   # NOTE:
# Line 1357  syncmage() Line 1365  syncmage()
1365   done   done
1366    
1367   # clean up backup files (foo~)   # clean up backup files (foo~)
1368   find ${MAGEDIR} -name *~ -exec rm '{}' ';'   find ${MAGEDIR} -name \*~ -exec rm '{}' ';'
1369    
1370   # check if a newer mage version is available   # check if a newer mage version is available
1371   is_newer_mage_version_available   is_newer_mage_version_available
# Line 1371  syncmage_tarball() Line 1379  syncmage_tarball()
1379   local mirr mymirr   local mirr mymirr
1380   local opt   local opt
1381   local tar_opts   local tar_opts
1382     local wget_opts
1383    
1384   # try to get the md5 marked as latest on the server   # try to get the md5 marked as latest on the server
1385   latest_md5="mage-latest.md5"   latest_md5="mage-latest.md5"
# Line 1378  syncmage_tarball() Line 1387  syncmage_tarball()
1387   # try to get the tarball marked as latest on the server   # try to get the tarball marked as latest on the server
1388   latest_tarball="mage-latest.tar.bz2"   latest_tarball="mage-latest.tar.bz2"
1389    
1390     # filter wget command if busybox was found
1391     wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})"
1392    
1393   for mirr in ${MIRRORS}   for mirr in ${MIRRORS}
1394   do   do
1395   # path without distribution   # path without distribution
# Line 1387  syncmage_tarball() Line 1399  syncmage_tarball()
1399   echo "fetching latest md5 from ${mymirr} ..."   echo "fetching latest md5 from ${mymirr} ..."
1400   [[ ${VERBOSE} = off ]] && opt="--quiet"   [[ ${VERBOSE} = off ]] && opt="--quiet"
1401   wget \   wget \
1402   ${WGET_FETCH_OPTIONS} \   ${wget_opts} \
1403   --directory-prefix=${temp} \   --directory-prefix=${temp} \
1404   ${opt} ${mymirr}/rsync/tarballs/${latest_md5}   ${opt} ${mymirr}/rsync/tarballs/${latest_md5}
1405    
1406   echo -ne "${COLBLUE} --- ${COLDEFAULT}"   echo -ne "${COLBLUE} --- ${COLDEFAULT}"
1407   echo "fetching latest tarball from ${mymirr} ..."   echo "fetching latest tarball from ${mymirr} ..."
1408   wget \   wget \
1409   ${WGET_FETCH_OPTIONS} \   ${wget_opts} \
1410   --directory-prefix=${temp} \   --directory-prefix=${temp} \
1411   ${opt} ${mymirr}/rsync/tarballs/${latest_tarball}   ${opt} ${mymirr}/rsync/tarballs/${latest_tarball}
1412   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 1563  get_highest_magefile() Line 1575  get_highest_magefile()
1575   local magefile   local magefile
1576    
1577   # do not list the content of a directory, only the name (-d)   # do not list the content of a directory, only the name (-d)
1578   for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/*)   for magefile in $(ls --format=single-column -v -d ${MAGEDIR}/${PCAT}/${PNAME}/* 2> /dev/null)
1579   do   do
1580   [[ -z ${magefile} ]] && continue   [[ -z ${magefile} ]] && continue
1581   # we exclude subdirs (for stuff like a md5sum dir)   # we exclude subdirs (for stuff like a md5sum dir)
# Line 2450  mage_install() Line 2462  mage_install()
2462   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
2463   then   then
2464   # basic svn compat   # basic svn compat
2465   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]
2466   then   then
2467   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/*/${pname/${MAGE_TARGETS}/}/${pname/${MAGE_TARGETS}/}-${pver}-${pbuild}.smage2
2468   do   do
2469   smage2file="${i}"   smage2file="${i}"
2470   done   done
# Line 2463  mage_install() Line 2475  mage_install()
2475   elif [[ -n ${SPLIT_PACKAGE_BASE} ]]   elif [[ -n ${SPLIT_PACKAGE_BASE} ]]
2476   then   then
2477   # basic svn compat   # basic svn compat
2478   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]
2479   then   then
2480   for i in ${SMAGESCRIPTSDIR}/trunk/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/*/${SPLIT_PACKAGE_BASE}/${SPLIT_PACKAGE_BASE}-${pver}-${pbuild}.smage2
2481   do   do
2482   smage2file="${i}"   smage2file="${i}"
2483   done   done
# Line 2475  mage_install() Line 2487  mage_install()
2487    
2488   else   else
2489   # basic svn compat   # basic svn compat
2490   if [[ -d ${SMAGESCRIPTSDIR}/trunk ]]   if [[ -d ${SMAGESCRIPTSDIR}/.svn ]]
2491   then   then
2492   for i in ${SMAGESCRIPTSDIR}/trunk/*/${pname}/${pname}-${pver}-${pbuild}.smage2   for i in ${SMAGESCRIPTSDIR}/*/${pname}/${pname}-${pver}-${pbuild}.smage2
2493   do   do
2494   smage2file="${i}"   smage2file="${i}"
2495   done   done
# Line 3077  need_busybox_support() Line 3089  need_busybox_support()
3089   then   then
3090   # needs busybox support   # needs busybox support
3091   return 0   return 0
  else  
  # no busybox  
  return 1  
3092   fi   fi
3093   fi   fi
3094    
3095     # no busybox
3096     return 1
3097  }  }
3098    
3099  # busybox_filter_wget_options ${wget_opts}  # busybox_filter_wget_options ${wget_opts}
# Line 3116  busybox_filter_wget_options() Line 3128  busybox_filter_wget_options()
3128   echo "${opts}"   echo "${opts}"
3129   fi   fi
3130  }  }
3131    
3132    have_root_privileges()
3133    {
3134     local retval
3135    
3136     if [[ $(id -u) = 0 ]]
3137     then
3138     retval=0
3139     else
3140     retval=1
3141     fi
3142    
3143     return ${retval}
3144    }

Legend:
Removed from v.1273  
changed lines
  Added in v.1541