PDA

View Full Version : [ubuntu] 12.10's Software center , can't install .deb package, once refuse the license terms



lionjohn
March 12th, 2013, 10:37 AM
I had created a debian package with a license terms process for installation process.
This license terms process is added in debian package "preinst" file.
But during installation of this package in software-center, once I refused the license, it's impossible to redisply the license page in next time when I restart the installation process! Software-center dumped to the refuse step each time, the install process can't be continue anyway.
But my install process and .deb package work very well with another command: "gedebi", "dpkg -i", and I never had a problem
in another version of Ubuntu .
script code like:

---------debian "preinst" file code--------------------
. /usr/share/debconf/confmodule
db_version 2.0
db_capb backup
#Intel property licence
license=LICENSE_NAME
errmsg()
{
echo >&2 ''
echo >&2 "$@"
echo >&2 "try 'dpkg-reconfigure debconf' to select a frontend other than noninteractive"
echo >&2 ''
}
# facilitate backup capability per debconf-devel(7)
STATE=1
while true; do
case "$STATE" in
0) # ensure going back from license presentment is harmless
STATE=1
continue
;;
1) # present license
db_fset shared/present-$license seen false
if ! db_input critical shared/present-$license ; then
errmsg "$license license could not be presented"
exit 2
fi
db_fset shared/accepted-$license seen false
if ! db_input critical shared/accepted-$license ; then
errmsg "$license agree question could not be asked"
exit 2
fi
;;
2) # determine users' choice
db_get shared/accepted-$license
if [ "$RET" = "true" ]; then
# license accepted
exit 0
fi
# error on decline license (give user chance to back up)
db_input critical shared/error-$license
;;
3) # user has confirmed declining license
echo "user did not accept the $license license" >&2
exit 1
;;
*) # unknown state
echo "$license license state unknown: $STATE" >&2
exit 2
;;
esac
if db_go; then
STATE=$(($STATE + 1))
else
STATE=$(($STATE - 1))
fi
done
# proper exit (0 or 1) above
errmsg "$license license could not be presented / was not accepted"
exit 2
----------end of code--------------------




---------------debian "Template" file---------------
Template: shared/present-LICENSE_NAME
Type: note
Description: ***

Template: shared/accepted-LICENSE_NAME
Type: boolean
Default: false
Description: Do you accept the license terms?

Template: shared/error-LICENSE_NAME
Type: error
Description: Declined License for software *
----------end of code--------------------

dino99
March 12th, 2013, 03:23 PM
if you refuse to accept the software-center licence, then its understandable you cant add it with.

schragge
March 12th, 2013, 03:27 PM
IIUIC, if the OP refuses to accept the license then USC stucks at the license page offering to accept it over and over again.

lionjohn
March 13th, 2013, 10:10 AM
I mean is if once I refuse to accept my software license(not software-center license), it's impossible to redisply the license page in next time, it's dumped to the refuse step each time. it's not that I did in my preinst scrpit.
The right step is : if I restart the installation, the license process must begin with STAT 1(the first page), not with last refusing page.