diff -Nur pkgutils-5.20/pkgadd.cc pkgutils-5.20-hacked/pkgadd.cc
--- pkgutils-5.20/pkgadd.cc	2005-03-29 03:51:53.000000000 +0900
+++ pkgutils-5.20-hacked/pkgadd.cc	2006-07-17 19:27:22.000000000 +0900
@@ -46,6 +46,12 @@
 			o_upgrade = true;
 		} else if (option == "-f" || option == "--force") {
 			o_force = true;
+		} else if (option == "-d" || option == "--pkg-db") {
+			assert_argument(argv, argc, i);
+			this->pkg_db=argv[++i];
+		} else if (option == "-R" || option == "--pkg-rejected"){
+			assert_argument(argv, argc, i);
+			this->pkg_rejected=argv[++i];
 		} else if (option[0] == '-' || !o_package.empty()) {
 			throw runtime_error("invalid option " + option);
 		} else {
@@ -114,6 +120,8 @@
 	     << "  -f, --force         force install, overwrite conflicting files" << endl
 	     << "  -r, --root <path>   specify alternative installation root" << endl
 	     << "  -v, --version       print version and exit" << endl
+	     << "  -d, --pkg-db </absolute/path> path to package database" << endl
+	     << "  -R, --pkg-rejected </absolute/path> path to rejected file destination" << endl
 	     << "  -h, --help          print help and exit" << endl;
 }
 
diff -Nur pkgutils-5.20/pkginfo.cc pkgutils-5.20-hacked/pkginfo.cc
--- pkgutils-5.20/pkginfo.cc	2005-03-29 03:51:53.000000000 +0900
+++ pkgutils-5.20-hacked/pkginfo.cc	2006-07-17 19:27:44.000000000 +0900
@@ -61,6 +61,12 @@
 			o_footprint_mode += 1;
 			o_arg = argv[i + 1];
 			i++;
+		} else if (option == "-d" || option == "--pkg-db") {
+			assert_argument(argv, argc, i);
+			this->pkg_db=argv[++i];
+		} else if (option == "-R" || option == "--pkg-rejected") {
+			assert_argument(argv, argc, i);
+			this->pkg_rejected=argv[++i];
 		} else {
 			throw runtime_error("invalid option " + option);
 		}
@@ -150,5 +156,7 @@
 	     << "  -f, --footprint <file>      print footprint for <file>" << endl
 	     << "  -r, --root <path>           specify alternative installation root" << endl
 	     << "  -v, --version               print version and exit" << endl
+	     << "  -d, --pkg-db </absolute/path> path to package database" << endl
+	     << "  -R, --pkg-rejected </absolute/path> path to rejected file destination" << endl
 	     << "  -h, --help                  print help and exit" << endl;
 }
diff -Nur pkgutils-5.20/pkgrm.cc pkgutils-5.20-hacked/pkgrm.cc
--- pkgutils-5.20/pkgrm.cc	2005-03-29 03:51:53.000000000 +0900
+++ pkgutils-5.20-hacked/pkgrm.cc	2006-07-17 19:28:20.000000000 +0900
@@ -36,6 +36,14 @@
 			assert_argument(argv, argc, i);
 			o_root = argv[i + 1];
 			i++;
+		} else if (option == "-d" || option == "--pkg-db") {
+			assert_argument(argv, argc, i);
+			this->pkg_db = argv[i + 1];
+			i++;
+		} else if (option == "-R" || option == "--pkg-rejected") {
+			assert_argument(argv, argc, i);
+			this->pkg_db = argv[i + 1];
+			i++;
 		} else if (option[0] == '-' || !o_package.empty()) {
 			throw runtime_error("invalid option " + option);
 		} else {
@@ -74,5 +82,7 @@
 	     << "options:" << endl
 	     << "  -r, --root <path>   specify alternative installation root" << endl
 	     << "  -v, --version       print version and exit" << endl
+	     << "  -d, --pkg-db </absolute/path> path to package database" << endl
+	     << "  -R, --pkg-rejected </absolute/path> path to rejected file destination" << endl
 	     << "  -h, --help          print help and exit" << endl;
 }
diff -Nur pkgutils-5.20/pkgutil.cc pkgutils-5.20-hacked/pkgutil.cc
--- pkgutils-5.20/pkgutil.cc	2005-05-04 09:19:31.000000000 +0900
+++ pkgutils-5.20-hacked/pkgutil.cc	2006-07-17 18:52:35.000000000 +0900
@@ -62,13 +62,15 @@
 	sigaction(SIGINT, &sa, 0);
 	sigaction(SIGQUIT, &sa, 0);
 	sigaction(SIGTERM, &sa, 0);
+	pkg_db=PKG_DB;
+	pkg_rejected=PKG_REJECTED;
 }
 
 void pkgutil::db_open(const string& path)
 {
 	// Read database
 	root = trim_filename(path + "/");
-	const string filename = root + PKG_DB;
+	const string filename = root + pkg_db;
 
 	int fd = open(filename.c_str(), O_RDONLY);
 	if (fd == -1)
@@ -105,7 +107,7 @@
 
 void pkgutil::db_commit()
 {
-	const string dbfilename = root + PKG_DB;
+	const string dbfilename = root + pkg_db;
 	const string dbfilename_new = dbfilename + ".incomplete_transaction";
 	const string dbfilename_bak = dbfilename + ".backup";
 
@@ -378,7 +380,7 @@
 
 	for (i = 0; !th_read(t); ++i) {
 		string archive_filename = th_get_pathname(t);
-		string reject_dir = trim_filename(root + string("/") + string(PKG_REJECTED));
+		string reject_dir = trim_filename(root + string("/") + string(pkg_rejected));
 		string original_filename = trim_filename(root + string("/") + archive_filename);
 		string real_filename = original_filename;
 
diff -Nur pkgutils-5.20/pkgutil.h pkgutils-5.20-hacked/pkgutil.h
--- pkgutils-5.20/pkgutil.h	2005-03-29 03:51:53.000000000 +0900
+++ pkgutils-5.20-hacked/pkgutil.h	2006-07-17 18:52:35.000000000 +0900
@@ -56,6 +56,8 @@
 	virtual void run(int argc, char** argv) = 0;
 	virtual void print_help() const = 0;
 	void print_version() const;
+	string pkg_db;
+	string pkg_rejected;
 
 protected:
 	// Database
