应用程序包开发者指南

Procedure如何收集文件系统数据

  1. 将包含信息文件的目录设置为当前工作目录。

  2. 使用您喜爱的文本编辑器创建名为 checkinstall 的文件。

  3. 完成时保存所做更改并退出编辑器。

  4. 完成以下任务之一。

  5. 生成您的软件包。

    如果需要,请参见如何生成软件包


示例 3–6 编写 checkinstall 脚本

checkinstall 示例脚本将检查是否安装了 SUNWcadap 软件包所需的数据库软件。


# checkinstall script for SUNWcadap
#
# This confirms the existence of the required specU database
 
# First find which database package has been installed.
pkginfo -q SUNWspcdA	# try the older one
 
if [ $? -ne 0 ]; then
   pkginfo -q SUNWspcdB	# now the latest
 
	  if [ $? -ne 0 ]; then	# oops
		    echo "No database package can be found. Please install the"
		    echo "SpecU database package and try this installation again."
		    exit 3		# Suspend
	  else
		    DBBASE="`pkgparam SUNWsbcdB BASEDIR`/db"	# new DB software
	  fi
else
	  DBBASE="`pkgparam SUNWspcdA BASEDIR`/db"	# old DB software
fi
 
# Now look for the database file we will need for this installation
if [ $DBBASE/specUlatte ]; then
	  exit 0		# all OK
else
	  echo "No database file can be found. Please create the database"
	  echo "using your installed specU software and try this"
	  echo "installation again."
	  exit 3		# Suspend
fi
 

另请参见

在生成软件包之后,请安装该软件包以确认它已正确安装并验证其完整性。第 4 章介绍了这些任务,并提供了有关如何将经过验证的软件包转换为分发介质的逐步说明。