freebsd-ports/chinese/libtabe/files/patch-util-tsipackdb.in
Rong-En Fan cdda09c059 - Update to 0.2.6
- It seems works well on amd64, tested by yinjieh@csie.nctu.edu.tw
  with chinese/xcin25. Remove amd64 from exclude list.

PR:		ports/97960
Submitted by:	rafan (me)
Approved by:	maintainer timeout (7 weeks)
2006-07-19 15:31:46 +00:00

45 lines
1 KiB
Text

--- util/tsipackdb.in.orig Sun Sep 19 22:25:51 2004
+++ util/tsipackdb.in Fri Apr 21 23:31:23 2006
@@ -26,14 +26,26 @@
}
pack_db_file () {
- db_dump=`mywhich ${1}_dump`
- db_load=`mywhich ${1}_load`
+ case "${1}" in
+ db|db3|db4|db41)
+ db_dump=`mywhich ${1}_dump`
+ db_load=`mywhich ${1}_load`
+ ;;
+ db-4.[234])
+ db_name=${1#db-}
+ db_dump=`mywhich db_dump-${db_name}`
+ db_load=`mywhich db_load-${db_name}`
+ ;;
+ *)
+ echo "unsupportted Berkyley version: ${1}"
+ return 1
+ esac
if [ -x "$db_dump" ] && [ -x "$db_load" ]; then
echo "Try using $db_dump and $db_load to pack $2 ...."
- ${1}_dump $2 > $2.tmp && \
- ${1}_load $2.new < $2.tmp && \
+ $db_dump $2 > $2.tmp && \
+ $db_load $2.new < $2.tmp && \
mv $2.new $2 && \
return 0
@@ -42,9 +54,9 @@
return 1
}
-for dbprefix in db db2 db3 db4
+for dbname in @with_db_name@ db db2 db3 db4
do
- pack_db_file $dbprefix $1 && exit 0
+ pack_db_file $dbname $1 && exit 0
done
exit 0