我正在尝试使用dpkg-deb --build
命令构建一个包。
当我尝试使用 db_input 时,它失败了:
dpkg-deb --build audionet-0.0.8b/
dpkg-deb: building package `audionet' in `audionet-0.0.8b.deb'.
lintian audionet-0.0.8b.deb
W: audionet: binary-without-manpage usr/bin/audionet
sudo dpkg -i audionet-0.0.8b.deb
(Reading database ... 294473 files and directories currently installed.)
Preparing to unpack audionet-0.0.8b.deb ...
you start preinst file
dpkg: error processing archive audionet-0.0.8b.deb (--install):
subprocess new pre-installation script returned error exit status 128
you are in postrm file
you start postinst file
you leave postinst file
Errors were encountered while processing:
audionet-0.0.8b.deb
我的预安装文件是:
#!/bin/sh
# Exit on error
set -e
# echo something
echo "you start preinst file"
# Source debconf library.
. /usr/share/debconf/confmodule
# Ask questions
db_input medium audionet/question1 || true
#~ db_input medium audionet/question2 || true
# Show interface
db_go || true
echo "you leave preinst file"
模板文件:
Template: audionet/question1
Type: select
Choices: YES, no, dont know
Description: presence proxy :
Do you use a proxy.
Template: audionet/question2
Type: string
Description: proxy def :
Proxy serverport.
我还注意到安装没有进入配置文件,因为没有显示 echo:
#!/bin/sh
# Exit on error
set -e
# echo something
echo "you are in config file"
# Source debconf library.
. /usr/share/debconf/confmodule
#~ # Ask questions
#~ db_input medium audionet/question1 || true
#~ db_input medium audionet/question2 || true
# Show interface
db_go || true
我无法找出问题所在。
谢谢。