Magellan Linux

Diff of /branches/R11-unstable/include/mtools.sminc

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

revision 6654 by niro, Tue Sep 14 16:46:32 2010 UTC revision 7874 by niro, Thu Jun 2 20:44:40 2011 UTC
# Line 755  mlink() Line 755  mlink()
755    
756   ln ${verbose} -snf ${symlink} ${BINDIR}/${pathto} || die   ln ${verbose} -snf ${symlink} ${BINDIR}/${pathto} || die
757  }  }
758    
759    # installs systemd units
760    # minstallunit /path/to/unit-file {destfilename}
761    minstallunit()
762    {
763     local unit
764     local file
765    
766     [[ -z "$1" ]] && die "No unit given"
767    
768     # if no fullpath given use file from sourcedir
769     if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]]
770     then
771     file="${SOURCEDIR}/$(mpname)/$1"
772     else
773     file="$1"
774     fi
775    
776     if [[ -n "$2" ]]
777     then
778     unit="$2"
779     else
780     unit="$(basename ${file})"
781     fi
782    
783     # needed directory
784     install -d ${BINDIR}/lib/systemd/system || die
785    
786     # install our initscript
787     install -v -m 0644 -o root -g root ${file} ${BINDIR}/lib/systemd/system/${unit} || die
788    }
789    
790    # installs systemd tmp configs to /etc/tmpfiles.d
791    # minstalltmp /path/to/tmpdfile {destfilename}
792    minstalltmp()
793    {
794     local tmpdfile
795     local file
796    
797     [[ -z "$1" ]] && die "No tmpd file given"
798    
799     # if no fullpath given use file from sourcedir
800     if [[ -z $(dirname $1) ]] || [[ $(dirname $1) = . ]]
801     then
802     file="${SOURCEDIR}/$(mpname)/$1"
803     else
804     file="$1"
805     fi
806    
807     if [[ -n "$2" ]]
808     then
809     tmpdfile="$2"
810     else
811     tmpdfile="$(basename ${file})"
812     fi
813    
814     # needed directory
815     install -d ${BINDIR}/etc/tmpfiles.d || die
816    
817     # install our tmpdfile
818     install -v -m 0644 -o root -g root ${file} ${BINDIR}/etc/tmpfiles./${tmpdfile} || die
819    }

Legend:
Removed from v.6654  
changed lines
  Added in v.7874