mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

627 lines
16 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/scripts/functions
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. # This function returns a "uniqe id" as output
  23. #
  24. get_unique() {
  25. date "+%s.$$.`/sbin/ifconfig -a | cksum | cut -f1 -d' '`"
  26. }
  27. # Hook variables
  28. #
  29. unset hook_functions hook_fcounter
  30. declare -a hook_functions='()'
  31. hook_fcounter=0
  32. # This function adds a code fragment to a named hook with the named priority
  33. #
  34. # hook_add hook_name priority code
  35. #
  36. hook_add() {
  37. hook_functions[hook_fcounter]="$3" # declare -a hookidx_$1
  38. eval "hookidx_$1[\${#hookidx_$1[@]}]=\"$2 $hook_fcounter\""
  39. eval "(( hookdirty_$1++ ))"; (( hook_fcounter++ ))
  40. }
  41. # This function executes all code fragments from the named hook
  42. #
  43. # hook_eval hook_name
  44. #
  45. hook_eval() {
  46. while read pri fnr ; do
  47. eval "${hook_functions[fnr]}"
  48. done < <( IFS=$'\n' ; eval "echo \"\${hookidx_$1[*]}\"" | sort )
  49. eval "unset hookdirty_$1"
  50. }
  51. # This function prints all hooks and their current contents
  52. #
  53. # hook_dump
  54. #
  55. hook_dump() {
  56. for hook in ${!hookidx_*} ; do
  57. hook=${hook#hookidx_}
  58. echo ; echo "Contents of hook $hook:"
  59. while read pri fnr ; do
  60. echo ; echo " $pri ($fnr)"
  61. echo "${hook_functions[fnr]}" | sed 's,^, ,'
  62. done < <( IFS=$'\n'
  63. eval "echo \"\${hookidx_$hook[*]}\"" | sort )
  64. if eval "[ -n \"\$hookdirty_\$hook\" ]"; then
  65. echo ; echo -n " Hook is marked as dirty: "
  66. eval "echo \"\${hookdirty_$hook}\""
  67. fi
  68. done
  69. echo
  70. }
  71. # This functions append, insert or remove values in variables:
  72. #
  73. # var_append PATH ":" "$HOME/bin"
  74. # var_insert CC_WRAPPER_INSERT " " "-O3"
  75. # var_remove CC_WRAPPER_INSERT " " "-O3"
  76. #
  77. # var_remove_regex CC_WRAPPER_INSERT " " "-O.*"
  78. #
  79. # var_insert_before_regex patchfiles " " "mypatch.diff" ".*\/foo.diff"
  80. #
  81. # 1st Parameter: Variable Name
  82. # 2nd Parameter: Delimiter Text
  83. # 3rd Parameter: Value (or regex)
  84. # 4th Parameter: regex for insert_before
  85. #
  86. var_append() {
  87. eval "[ \"\$$1\" ] && $1=\"\${$1}$2\"" || true
  88. eval "$1=\"\${$1}\$3\""
  89. }
  90. var_insert() {
  91. eval "[ \"\$$1\" ] && $1=\"$2\$$1\"" || true
  92. eval "$1=\"\$3\$$1\""
  93. }
  94. var_remove() {
  95. local a=${2//\/\\/}
  96. local b=${3//\/\\/}
  97. eval '[ "$'$1'" = "$3" ] && '$1'="" || true'
  98. eval $1'="${'$1'//$a$b$a/$2}"'
  99. eval $1'="${'$1'%$a$b}"'
  100. eval $1'="${'$1'#$b$a}"'
  101. }
  102. var_remove_regex() {
  103. eval "$1=\"\`echo \"\$$1\" | awk -- ' { split(\$0, a, \"$2\"); for (c1=c2=1; c1 in a; c1++) if ( a[c1] !~ /^$3\\\$/ ) b[c2++]=a[c1]; for (c1=1; c1 in b; c1++) printf \"%s%s\", (c1 > 0 ? \"$2\" : \"\"), b[c1]; }'\`\""
  104. }
  105. var_insert_before_regex() {
  106. eval "$1=\"\`echo \"\$$1\" | awk -- '{ split(\$0, a, \"$2\"); for (d=c1=c2=1; c1 in a; c1++) { if ( d && a[c1] ~ /^$4\\\$/ ) { b[c2++]=\"$3\"; d=0; } b[c2++]=a[c1]; } if (d) b[c2++]=\"$3\"; for (c1=1; c1 in b; c1++) printf \"%s%s\", (c1 > 0 ? \"$2\" : \"\"), b[c1]; }'\`\""
  107. }
  108. # This function can be used to duplicate a shell-function. E.g. when
  109. # overwriting a shell-function but the old one should stay available under
  110. # a new name:
  111. #
  112. # copy_function set_confopt set_confopt_foobar_old
  113. #
  114. # set_confopt() {
  115. # ....
  116. # set_confopt_foobar_old "$@"
  117. # ....
  118. # }
  119. #
  120. copy_function() {
  121. eval "$( declare -f $1 | sed "1 s,$1,$2," )"
  122. }
  123. # This function sets the 'confopt' and some other variables.
  124. # Re-run it in the package .conf file if you modify $prefix
  125. #
  126. set_confopt() {
  127. confopt="--prefix=$root/$prefix"
  128. bindir="$root/$prefix/bin"
  129. confopt="$confopt --bindir=\$bindir"
  130. sbindir="$root/$prefix/sbin"
  131. confopt="$confopt --sbindir=\$sbindir"
  132. libdir="$root/$prefix/lib"
  133. confopt="$confopt --libdir=\$libdir"
  134. if [ -z "$prefix" ]; then
  135. datadir="$root/usr/share"
  136. includedir="$root/usr/include"
  137. docdir="$root/usr/doc/$pkg"
  138. infodir="$root/usr/info"
  139. mandir="$oot/usr/man"
  140. else
  141. datadir="$root/$prefix/share"
  142. includedir="$root/$prefix/include"
  143. docdir="$root/$prefix/doc/$pkg"
  144. infodir="$root/$prefix/info"
  145. mandir="$root/$prefix/man"
  146. fi
  147. confopt="$confopt --datadir=\$datadir"
  148. confopt="$confopt --includedir=\$includedir"
  149. confopt="$confopt --infodir=\$infodir"
  150. confopt="$confopt --mandir=\$mandir"
  151. if [ "${prefix#opt/}" != "$prefix" ] ; then
  152. sysconfdir="$root/etc/$prefix"
  153. localstatedir="$root/var/$prefix"
  154. elif [ "${prefix#usr}" != "$prefix" ] ; then
  155. sysconfdir="$root/etc"
  156. localstatedir="$root/var"
  157. else
  158. sysconfdir="$root/$prefix/etc"
  159. localstatedir="$root/$prefix/var"
  160. fi
  161. confopt="$confopt --sysconfdir=\$sysconfdir"
  162. confopt="$confopt --localstatedir=\$localstatedir"
  163. if [ "$ROCKCFG_CONFIGURE_OPTS" ] ; then
  164. confopt="$confopt $ROCKCFG_CONFIGURE_OPTS"
  165. fi
  166. if [ "$ROCKCFG_OPT" = 1 ] ; then
  167. confopt="$confopt --disable-debug"
  168. fi
  169. if [ "$stagelevel" -le 1 -o "$ROCKCFG_DISABLE_NLS" = 1 ] ; then
  170. confopt="${confopt//--enable-nls/} --disable-nls"
  171. fi
  172. confopt="$confopt \$extraconfopt"
  173. if [ "$stagelevel" -eq 0 ]; then
  174. confopt="$confopt --target=\$arch_target --host=\$arch_build"
  175. else
  176. confopt="$confopt --build=\$arch_build --host=\$arch_target"
  177. fi
  178. }
  179. #
  180. # eval_config_command $( eval echo $confopt )
  181. #
  182. function eval_config_command() {
  183. local config_command
  184. for x in /usr/share/automake/*
  185. do
  186. [ -x "$x" -a -f "$x" ] || continue
  187. x="$( basename "$x" )"
  188. if [ -L $x -a ! -e $x ] ; then
  189. echo "Fixing dead symlink $x."
  190. ln -sf /usr/share/automake/$x .
  191. fi
  192. done
  193. if [ $autogen -eq 1 -a -f configure.in ] ; then
  194. if [ -f configure.orig ] ; then
  195. echo "Found configure.orig. Not" \
  196. "running autogen script."
  197. elif [ -f autogen.sh ] ; then
  198. echo "Running package autogen script."
  199. sh autogen.sh
  200. else
  201. echo "Running builtin autogen script."
  202. libtoolize --force --automake ; aclocal
  203. if grep AM_INIT_AUTOMAKE configure.in
  204. then automake ; fi
  205. autoconf
  206. fi
  207. fi
  208. if [ $stagelevel -le 1 ] ; then
  209. create_config_cache >> config.cache
  210. grep -q '.--cache-file=' $configscript &&
  211. set -- "$@" "--cache-file=config.cache"
  212. export cache_file=config.cache
  213. fi
  214. config_command="$configprefix $configscript"
  215. sub_scripts="$( find $( dirname $configscript ) -name configure )"
  216. # remove unsupported config script options
  217. for x ; do
  218. if grep -q "[[ ]${x%%=*}[]= ):]" $configscript $sub_scripts ; then
  219. config_command="$config_command $x"
  220. elif [[ $x = --*able-* ]] && egrep -q "\-\-(en|dis)able-\*" $configscript ; then
  221. echo "Autodetection for option impossible: " \
  222. "$x passed thru."
  223. config_command="$config_command $x"
  224. else
  225. echo "Removing unsupported '$x' from" \
  226. "configure option string."
  227. fi
  228. done
  229. echo Running "$config_command"
  230. eval "$config_command"
  231. }
  232. # Parse the *.desc file. Use the description from PKG-DESC-FORMAT and
  233. # save the tag data in $desc_*.
  234. #
  235. parse_desc() {
  236. tag="`grep '^\[' $base/Documentation/Developers/PKG-DESC-FORMAT | \
  237. sed 's, (\*),,; s,\] \[,|,g; s,\[,,; s,\],,;'`"
  238. for tag in $tag ; do
  239. tagdata="`egrep "^\[($tag)\]" $confdir/$1.desc | \
  240. cut -f2- -d']' | sed 's,^ ,,'`"
  241. tag="`echo $tag | cut -f1 -d'|' | tr - _`"
  242. eval "desc_$tag=\"\$tagdata\""
  243. done
  244. }
  245. # This function is used for forcing a file to be in the flist
  246. #
  247. add_flist() {
  248. for addfile ; do
  249. echo "$addfile" | fl_wrparse -D -r "$xroot/" \
  250. >> $builddir/flist.txt
  251. done
  252. }
  253. # This function is used for forcing a package to be in the dependency list
  254. #
  255. add_dependency() {
  256. for addpackage ; do
  257. echo "$addpackage: add_dependency()" \
  258. >> $builddir/dependencies.debug
  259. done
  260. }
  261. # This function is used to subsitute some important variables
  262. # using a D_ prefix thru m4 ...
  263. rock_substitute() {
  264. sed -e s,D_prefix,$prefix,g -e s,D_sysconfdir,$sysconfdir,g \
  265. -e s,D_docdir,$docdir,g -e s,D_localstatedir,$localstatedir,g \
  266. -e s,D_datadir,$datadir,g -e s,D_infodir,$infodir,g \
  267. -e s,D_bindir,$bindir,g -e s,D_sbindir,$sbindir,g \
  268. -e s,D_libdir,$libdir,g -e s,D_mandir,$mandir,g $1
  269. }
  270. # This outputs a predefined config.cache file as it needed by some
  271. # packages to cross-build correctly in stages 0 and 1.
  272. #
  273. create_config_cache() {
  274. cat $base/scripts/config.cache
  275. echo -e "\n# Architecture specific stuff\n"
  276. echo "ac_cv_sizeof_short=$arch_sizeof_short"
  277. echo "ac_cv_sizeof_int=$arch_sizeof_int"
  278. echo "ac_cv_sizeof_long=$arch_sizeof_long"
  279. echo "ac_cv_sizeof_long_long=$arch_sizeof_long_long"
  280. echo "ac_cv_sizeof_char_p=$arch_sizeof_char_p"
  281. echo "ac_cv_c_bigendian=$arch_bigendian"
  282. echo "ac_cv_prog_CC=$CC"
  283. }
  284. # Abort build before actual build starts
  285. # (is overwritten in Build-Pkg)
  286. #
  287. abort() {
  288. echo -e "The package build aborted with the following config" \
  289. "error:\n$*" > $root/var/adm/logs/$stagelevel-$pkg.err
  290. echo_errorquote "`cat $root/var/adm/logs/$stagelevel-$pkg.err`"
  291. echo_pkg_abort $stagelevel $repository $pkg
  292. exit 1
  293. }
  294. # Dump Environment
  295. #
  296. dump_env() {
  297. # Dump $base - only set if there is not already an older value.
  298. #
  299. echo "base=\"\${base:-$base}\""
  300. # Dump all variables including their flags, but skip read-only
  301. # variables and $base.
  302. #
  303. # Substitute base directory with ${base}.
  304. #
  305. for name in ${!a*} ${!b*} ${!c*} ${!d*} ${!e*} ${!f*} ${!g*} ${!h*} \
  306. ${!i*} ${!j*} ${!k*} ${!l*} ${!m*} ${!n*} ${!o*} ${!p*} \
  307. ${!q*} ${!r*} ${!s*} ${!t*} ${!u*} ${!v*} ${!w*} ${!x*} \
  308. ${!y*} ${!z*} \
  309. ${!A*} ${!B*} ${!C*} ${!D*} ${!E*} ${!F*} ${!G*} ${!H*} \
  310. ${!I*} ${!J*} ${!K*} ${!L*} ${!M*} ${!N*} ${!O*} ${!P*} \
  311. ${!Q*} ${!R*} ${!S*} ${!T*} ${!U*} ${!V*} ${!W*} ${!X*} \
  312. ${!Y*} ${!Z*} ${!_*}
  313. do
  314. [ $name = base ] && continue
  315. if declare -p $name | head -1 | grep -qv '^declare -[a-z]*r'
  316. then
  317. declare -p $name | sed "s,\\(^\\|[\"=:]\\)$base\\([\"=:/]\\|\$\\),\\1\${base}\\2,g"
  318. fi
  319. done
  320. # Dump functions
  321. #
  322. declare -f | sed 's/^declare -f //; s/<<(/< <(/;'
  323. # Dump aliases
  324. #
  325. alias
  326. }
  327. # Check for a package in configuration
  328. #
  329. pkgcheck() {
  330. egrep -q "^$2.* ($1) " $base/config/$config/packages
  331. }
  332. # Register a window-manager
  333. #
  334. register_wm() {
  335. [ -e /usr/share/rock-registry/wm ] || mkdir -p $root/usr/share/rock-registry/wm
  336. echo -e "name=\"$2\"\nexec=\"$3\"\n" > $root/usr/share/rock-registry/wm/$1
  337. }
  338. # Register an application
  339. #
  340. register_application() {
  341. [ -e /usr/share/rock-registry/app ] \
  342. || mkdir -p /usr/share/rock-registry/app
  343. echo -e "name=\"$2\"\nexec=\"$3\"\n" > /usr/share/rock-registry/app/$1
  344. }
  345. # Create Package Database for gasgui install tool
  346. #
  347. create_package_db() {
  348. rm -f $3.tmp
  349. for file in $( ls -dr $1/descs/?* ) ; do
  350. pkg="${file##*/}"
  351. # only include the package if a binary file is available
  352. if [ "$ROCKCFG_PKGFILE_VER" = 1 ] ; then
  353. v=-$(grep '^Package Name and Version' \
  354. $1/packages/$pkg | cut -f6 -d' ')
  355. else
  356. v=""
  357. fi
  358. if [ "$ROCKCFG_CREATE_GEM" = 1 ] ; then
  359. bfile=${pkg}${v}.gem
  360. else
  361. bfile=${pkg}${v}.tar.bz2
  362. fi
  363. if [ -e $2/$bfile ] ; then
  364. [ "$pkg" = TRANS.TBL ] && continue
  365. ( echo -e "$pkg"
  366. echo -e "\027"
  367. cat $1/descs/$pkg
  368. echo -e "\027"
  369. cat $1/dependencies/$pkg
  370. echo -e "\027"
  371. cat $1/cksums/$pkg
  372. echo -e "\027" ) >> $3.tmp
  373. else
  374. echo_error "Binary file for $bfile not present." \
  375. "Skipped in package database."
  376. fi
  377. done
  378. gzip -c $3.tmp > $3 ; rm -f $3.tmp
  379. }
  380. # Add files to the 'badfiles' list
  381. #
  382. register_badfiles() {
  383. local x desc="$1"
  384. shift
  385. for x in "$@"; do
  386. var_append badfiles $'\n' " $x\$"
  387. badfiles_desc[$badfiles_nr]=" $x\$"$'\n'"$desc"
  388. (( badfiles_nr++ ))
  389. done
  390. }
  391. # Apply the given $patchfiles
  392. #
  393. apply_patchfiles() {
  394. for x in $patchfiles; do
  395. echo "Apply patch $x ..."
  396. if [[ $x = *.bz2 ]] ; then
  397. bzcat $x | patch $patchopt
  398. else
  399. eval patch $patchopt < $x
  400. fi
  401. done
  402. }
  403. # Main program for building a package
  404. #
  405. build_this_package() {
  406. if [ ".$desc_SRC" == "." ] ; then
  407. # Autodetect source tar and extract it
  408. #
  409. if [ $srctar = auto ] ; then
  410. xsourceballs=$( echo "$desc_D" | head -1 | tr ' ' '\t' | tr -s '\t' | \
  411. cut -f2 | sed 's,.\(t\?\)\(gz\|Z\)$,.\1bz2,' )
  412. if [ -z "$xsourceballs" ] ; then
  413. echo "Can't auto-detect srctar for package '$pkg'!"
  414. false
  415. fi
  416. else
  417. xsourceballs="$srctar"
  418. fi
  419. else
  420. sourceballs=$( echo "$desc_D" | tr ' ' '\t' | tr -s '\t' | \
  421. cut -f2 | sed 's,.\(t\?\)\(gz\|Z\)$,.\1bz2,' )
  422. xsrcpattern=$( echo "$desc_SRC" | tr ' ' '\t' | tr -s '\t' | tr '\t' '\n' )
  423. xsourceballs=$( echo "$sourceballs" | grep -F "$xsrcpattern" )
  424. fi
  425. for xsrctar in $xsourceballs; do
  426. if [ $autoextract = 1 ]; then
  427. echo "Extracting $xsrctar ($taropt) ... "
  428. cd $builddir
  429. tar -v $taropt $archdir/$xsrctar |
  430. cut -f1 -d/ | sort -u > xsrcdir.txt
  431. #
  432. if [ $srcdir = auto ]; then
  433. xsrcdir=${xsrctar%.tar.bz2}
  434. xsrcdir=${xsrcdir%.tbz2}
  435. if [ ! -d $xsrcdir ] ; then
  436. for x in $pkg-$ver $pkg_$ver $pkg \
  437. "`cat xsrcdir.txt`" ; do
  438. [ -d "$x" ] && xsrcdir="$x"
  439. done
  440. fi
  441. else
  442. xsrcdir="$srcdir"
  443. fi
  444. #
  445. echo "Changeing into $builddir/$xsrcdir ..."
  446. [ "$chownsrcdir" = 1 ] && chown -R 0.0 $builddir/$xsrcdir
  447. cd $builddir/$xsrcdir
  448. # Apply patches
  449. #
  450. if [ $autopatch = 1 ]; then
  451. hook_eval prepatch
  452. apply_patchfiles
  453. hook_eval postpatch
  454. fi
  455. else
  456. cd $builddir
  457. fi
  458. if [ "$createprefix" = 1 ]; then
  459. echo "Creating $root/$prefix/<..> if required ..."
  460. for x in $docdir $root/$prefix/bin $root/$prefix/lib \
  461. $root/$prefix/share $sysconfdir $localstatedir
  462. do
  463. if [ ! -e $x ]; then
  464. mkdir -p $x
  465. rmemptydir="$rmemptydir $x"
  466. fi
  467. done
  468. fi
  469. if [ ".$custmain" = "." ]
  470. then
  471. # Run configure scripts etc.
  472. #
  473. hook_eval preconf
  474. #
  475. if [ $runconf = 1 ]; then
  476. if [ -f $configscript -o $autogen = 1 ]
  477. then
  478. eval_config_command $( eval echo $confopt )
  479. fi
  480. fi
  481. # automated package build
  482. # styles without make run first:
  483. if [ -f setup.py -a $runpysetup = 1 ] ; then
  484. pyconfopt="${pyconfopt:=--prefix $root/$prefix}"
  485. eval python setup.py build install $pyconfopt
  486. else # styles that include a make run
  487. if [ ! -f Makefile -a ! -f makefile -a \
  488. -f Makefile.PL -a $runmkpl = 1 ]; then
  489. perl Makefile.PL
  490. fi
  491. #
  492. if [ ! -f Makefile -a ! -f makefile -a \
  493. -f Imakefile -a $runxmkmf = 1 ]; then
  494. xmkmf -a
  495. fi
  496. #
  497. # Build it
  498. #
  499. hook_eval premake
  500. if [ "$makeopt" ]
  501. then eval "$MAKE $makeopt"; fi
  502. hook_eval inmake
  503. if [ "$makeinstopt" ]
  504. then eval "$MAKE $makeinstopt"; fi
  505. hook_eval postmake
  506. fi
  507. else
  508. eval "$custmain"
  509. for x in preconf premake inmake postmake; do
  510. if eval "[ -n \"\$hookdirty_$x\" ]"; then
  511. echo "Hook $x is still marked as dirty ..."
  512. hook_eval $x
  513. fi
  514. done
  515. fi
  516. if [ "$createdocs" != 0 ]; then
  517. if [ ! -e $docdir ]; then
  518. mkdir -p $docdir
  519. rmemptydir="$rmemptydir $docdir"
  520. fi
  521. [ -z "$createdocs" ] && createdocs="$ROCKCFG_CREATE_DOCS"
  522. fi
  523. for file in $confdir/*.desktop ; do
  524. [ -f $file ] || continue
  525. echo -n "Install desktop file '$file': "
  526. mkdir -p $root/usr/share/rock-registry/app
  527. rock_substitute $file > \
  528. $root/usr/share/rock-registry/app/`basename $file`
  529. done
  530. if [ "$createdocs" = 1 ]; then
  531. echo "Trying to copy the default documentation ..."
  532. [ -d $builddir/$xsrcdir ] && cd $builddir/$xsrcdir
  533. for x in `find -type d \( -name 'doc' -o -name 'docs' -o \
  534. -name '[Dd]ocumentation' \) ! -empty`
  535. do
  536. if [ -d "$x" -a "`echo $x/*`" != "$x/*" ]
  537. then cp -rLv $x/* $docdir || true ; fi
  538. done
  539. for x in [A-Z][A-Z]* *.lsm ChangeLog*; do
  540. [ "${x#*.[cho0-9]}" ] || continue
  541. [ "${x#*.info*}" ] || continue
  542. if [ -f $x ] ; then cp -v $x $docdir/$x ; fi
  543. done
  544. for x in $confdir/*.doc; do
  545. if [ -f $x ]; then cp -v $x $docdir/${x%.doc}; fi
  546. done
  547. find $docdir/ -name '*.[0-9]' -o -name '*.info*' \
  548. -o -name '[Mm]akefile*' | \
  549. xargs -r rm -f 2> /dev/null || true
  550. find $docdir/* -type d -empty 2> /dev/null | \
  551. xargs -r rmdir 2> /dev/null || true
  552. fi
  553. hook_eval postdoc
  554. done
  555. if [ "$rmemptydir" ]; then
  556. rmdir $rmemptydir 2> /dev/null || true
  557. fi
  558. return 0
  559. }