Re: update .preinst file

2016-09-14 Thread Herbert Fortes
Hi,

> Due to the way dpkg-maintscript-helper is implemented, the symlink
> created with dh_installdocs is ignored, so dpkg-maintscript-helper will
> create it for you. The manpage for dpkg-maintscript-helper also contains
> an explanation of why 'just removing the directory in preinst' can cause
> problems.
> 
> I think putting this into 'bogofilter-bdb.maintscript' and something
> similar in other maintscript files should work:
> 
> dir_to_symlink /usr/share/doc/bogofilter-bdb
> /usr/share/doc/bogofilter-common 1.2.4+dfsg1-8~
> 

Thanks James Cowgill.

Upload done.



Regards,
Herbert




Re: update .preinst file

2016-09-14 Thread James Cowgill
Hi,

On 13/09/16 18:37, Herbert Fortes wrote:
> I have to update 4 debian/*.preinst files.
> 
> Right now the files are like here[0]:
> 
> 
> if dpkg --compare-versions "$2" lt "1.2.4+dfsg1-7" ; then
>rm -rf /usr/share/doc/bogofilter || true
> fi
> 
> 
> [0] -  
> https://anonscm.debian.org/git/collab-maint/bogofilter.git/tree/debian/bogofilter.preinst
> 
> 
> This approach has problems on an upgrade from Jessie to 
> Stretch[1].The recommendation today is to use 'dpkg-maintscript-helper', so
> I should change to ("a  real directory  is switched to a symlink"):
> 
> [1] - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832291
> 
> if dpkg-maintscript-helper supports dir_to_symlink 2>/dev/null; then
> dpkg-maintscript-helper dir_to_symlink \
>/usr/share/doc/bogofilter bogofilter 1.2.4+dfsg1-8 bogofilter 
> -- "$@"  
> fi

Don't bother doing this. Use dh_installdeb and 'package.maintscript'
files instead. You can then drop all the preinst files.

>>From the manpage:
> 
> "pathname(/usr/share/doc/bogofilter here)  is the absolute name of the old 
> directory (the path will be a symlink at the end of the installation) and 
> new-target (bogofilter here) is the target of the  new  symlink at pathname. 
> It can either be absolute or relative to the directory containing pathname."
> 
> But the symlink is created by dh_installdocs[1] already. I just want to 
> remove 
> the directory.

Due to the way dpkg-maintscript-helper is implemented, the symlink
created with dh_installdocs is ignored, so dpkg-maintscript-helper will
create it for you. The manpage for dpkg-maintscript-helper also contains
an explanation of why 'just removing the directory in preinst' can cause
problems.

I think putting this into 'bogofilter-bdb.maintscript' and something
similar in other maintscript files should work:

dir_to_symlink /usr/share/doc/bogofilter-bdb
/usr/share/doc/bogofilter-common 1.2.4+dfsg1-8~

James



signature.asc
Description: OpenPGP digital signature


update .preinst file

2016-09-13 Thread Herbert Fortes
Hi,


I have to update 4 debian/*.preinst files.


Right now the files are like here[0]:


|

if dpkg --compare-versions "$2" lt "1.2.4+dfsg1-7" ; then
   rm -rf /usr/share/doc/bogofilter || true
fi [0] -
https://anonscm.debian.org/git/collab-maint/bogofilter.git/tree/debian/bogofilter.preinst
This approach has problems on an upgrade from Jessie to Stretch[1].The
recommendation today is to use 'dpkg-maintscript-helper', so I should
change to ("a real directory is switched to a symlink"): [1] -
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832291 if
dpkg-maintscript-helper supports dir_to_symlink 2>/dev/null; then
dpkg-maintscript-helper dir_to_symlink \ /usr/share/doc/bogofilter
bogofilter 1.2.4+dfsg1-8 bogofilter -- "$@" fi From the manpage:
"pathname(/usr/share/doc/bogofilter here) is the absolute name of the
old directory (the path will be a symlink at the end of the
installation) and new-target (bogofilter here) is the target of the new
symlink at pathname. It can either be absolute or relative to the
directory containing pathname." But the symlink is created by
dh_installdocs[1] already. I just want to remove the directory. [1] -
'dh_installdocs --link-doc=bogofilter-common' The manpage again:
COMMANDS AND PARAMETERS supports command rm_conffile conffile
[prior-version [package]] mv_conffile old-conffile new-conffile
[prior-version [package]] symlink_to_dir pathname old-target
[prior-version [package]] dir_to_symlink pathname new-target
[prior-version [package]] What should I do ? Regards, Herbert

|