Magellan Linux

Diff of /trunk/mage/usr/lib/mage/convert_databases.sh

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

revision 487 by niro, Tue May 1 11:46:52 2007 UTC revision 488 by niro, Tue May 1 13:09:39 2007 UTC
# Line 202  EOF Line 202  EOF
202    
203   mincludes="$(grep -r 'minclude ' ${magefile} | cut -d: -f2 | sed s:minclude\ ::)"   mincludes="$(grep -r 'minclude ' ${magefile} | cut -d: -f2 | sed s:minclude\ ::)"
204    
205     #
206   # install routines & includes   # install routines & includes
207     #
208     # needs special magic: the last line of typeset has no ';'
209     # but to eval the function we must append it
210     # so this sed deletes the last line of the typeset output
211     # and replaces it with an ;} and a newline between
212     #
213     # but we will not add this fun when no postinstall etc are given
214     # -> [[ -n $(typeset -f postinstall ]] &&
215     #
216     # also the character ' is a problem while importing to sql
217     # because we use ' as escape char. so we replace it with ''
218     #
219     # $([[ -n $(typeset -f postinstall) ]] && echo -e "$(typeset -f postinstall | sed s:\':\'\':g | sed '$d');\n}")
220     #
221   sql "insert into packages_routines(pkg_id,   sql "insert into packages_routines(pkg_id,
222   mincludes,   mincludes,
223   postinstall,   postinstall,
# Line 211  EOF Line 226  EOF
226   postremove)   postremove)
227   values('${pkgid}',   values('${pkgid}',
228   '${mincludes}',   '${mincludes}',
229   '$(typeset -f postinstall | sed s:\':\'\':g)',   '$([[ -n $(typeset -f postinstall) ]] && echo -e "$(typeset -f postinstall | sed s:\':\'\':g | sed '$d');\n}")',
230   '$(typeset -f preinstall | sed s:\':\'\':g)',   '$([[ -n $(typeset -f preinstall) ]] && echo -e "$(typeset -f preinstall | sed s:\':\'\':g | sed '$d');\n}")',
231   '$(typeset -f preremove | sed s:\':\'\':g)',   '$([[ -n $(typeset -f preremove) ]] && echo -e "$(typeset -f preremove | sed s:\':\'\':g | sed '$d');\n}")',
232   '$(typeset -f postremove | sed s:\':\'\':g)')"   '$([[ -n $(typeset -f postremove) ]] && echo -e "$(typeset -f postremove | sed s:\':\'\':g | sed '$d');\n}")')"
233    
234   unset PKGNAME   unset PKGNAME
235   unset DEPEND   unset DEPEND

Legend:
Removed from v.487  
changed lines
  Added in v.488