* How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
@ 2011-10-19 10:12 Oleksandr Gavenko
2011-10-19 13:28 ` Andrew Schulman
0 siblings, 1 reply; 8+ messages in thread
From: Oleksandr Gavenko @ 2011-10-19 10:12 UTC (permalink / raw)
To: cygwin
How does setup.exe cope with upgrading of already installed packages if
there exist modification in installed files?
I customize HG templates under:
/lib/python2.6/site-packages/mercurial/templates/gitweb/*
and would like preserve it when update happen.
And it will be good to be notified if conflict happen.
Also I try:
$ cygcheck -c mercurial
Cygwin Package Information
Package Version Status
mercurial 1.9.2-1 OK
when I try:
$ mv
/lib/python2.6/site-packages/mercurial/templates/gitweb/branches.tmpl
/lib/python2.6/site-packages/mercurial/templates/gitweb/branches~.tmpl
$ cygcheck -c mercurial
Cygwin Package Information
Package Version Status
mercurial 1.9.2-1 Incomplete
So "cygcheck -c" does not provide ability to find modification to
package files.
Also I worry about modification in other config files in /etc
(like /etc/apache2/httpd.conf). Are they overwritten on package update?
How can I be notified about upgrade conflicts?
What for '/etc/defaults' hierarchy was used?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
2011-10-19 10:12 How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files? Oleksandr Gavenko
@ 2011-10-19 13:28 ` Andrew Schulman
2011-10-19 14:02 ` Oleksandr Gavenko
2011-10-19 17:01 ` Yaakov (Cygwin/X)
0 siblings, 2 replies; 8+ messages in thread
From: Andrew Schulman @ 2011-10-19 13:28 UTC (permalink / raw)
To: cygwin
> Also I worry about modification in other config files in /etc
> (like /etc/apache2/httpd.conf). Are they overwritten on package update?
This is up to each package maintainer. Current best practice - at least,
as of a year or two ago when I asked about it on cygwin-apps I think - is
to include:
(1) a default config file in /etc/defaults/etc;
(2) a preremove script that removes the existing config file iff it hasn't
change from the default; and
(3) a postinstall script that installs the default config into /etc if no
other config file is already there.
If all three of those are present, then a package upgrade will replace the
existing config files if and only if they haven't changed since they were
installed. If they have changed, then it's up to the user to merge the old
and new configs.
cygport provides automatic support for (1) and (3) above if you call e.g.
make_etc_defaults /etc/lftp.conf
To complete the set, package maintainers have to separately include a
simple preremove script, e.g.
if cmp -s /etc/defaults/etc/lftp.conf /etc/lftp.conf
then
/bin/rm /etc/lftp.conf
fi
The lftp package, for example, includes all three of the above pieces. For
other packages, you'll just have to check each one. If a piece seems to be
missing, you can ask the maintainer if they're willing to add it.
> How can I be notified about upgrade conflicts?
Unfortunately, setup doesn't include any way of prompting the user for
action due to conflicts. The postinstall script will either overwrite the
existing config, or it won't. I think it's considered bad practice to
overwrite a config without checking first whether it's been modified; if
you find that a package does that, you should ask the maintainer to fix it.
Your safest bet is probably to back up all of the configuration before you
upgrade.
> What for '/etc/defaults' hierarchy was used?
See above.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
2011-10-19 13:28 ` Andrew Schulman
@ 2011-10-19 14:02 ` Oleksandr Gavenko
2011-10-19 14:13 ` Andrew Schulman
2011-10-19 17:01 ` Yaakov (Cygwin/X)
1 sibling, 1 reply; 8+ messages in thread
From: Oleksandr Gavenko @ 2011-10-19 14:02 UTC (permalink / raw)
To: cygwin
19.10.2011 16:27, Andrew Schulman пиÑеÑ:
>> Also I worry about modification in other config files in /etc
>> (like /etc/apache2/httpd.conf). Are they overwritten on package update?
>
> This is up to each package maintainer. Current best practice - at least,
> as of a year or two ago when I asked about it on cygwin-apps I think - is
> to include:
>
> (1) a default config file in /etc/defaults/etc;
> (2) a preremove script that removes the existing config file iff it hasn't
> change from the default; and
> (3) a postinstall script that installs the default config into /etc if no
> other config file is already there.
>
> If all three of those are present, then a package upgrade will replace the
> existing config files if and only if they haven't changed since they were
> installed. If they have changed, then it's up to the user to merge the old
> and new configs.
>
> cygport provides automatic support for (1) and (3) above if you call e.g.
>
> make_etc_defaults /etc/lftp.conf
>
> To complete the set, package maintainers have to separately include a
> simple preremove script, e.g.
>
> if cmp -s /etc/defaults/etc/lftp.conf /etc/lftp.conf
> then
> /bin/rm /etc/lftp.conf
> fi
>
> The lftp package, for example, includes all three of the above pieces. For
> other packages, you'll just have to check each one. If a piece seems to be
> missing, you can ask the maintainer if they're willing to add it.
>
>> How can I be notified about upgrade conflicts?
>
> Unfortunately, setup doesn't include any way of prompting the user for
> action due to conflicts. The postinstall script will either overwrite the
> existing config, or it won't. I think it's considered bad practice to
> overwrite a config without checking first whether it's been modified; if
> you find that a package does that, you should ask the maintainer to fix it.
>
> Your safest bet is probably to back up all of the configuration before you
> upgrade.
>
>> What for '/etc/defaults' hierarchy was used?
>
> See above.
>
Thanks for replay!
Seems that /etc/default practice is good.
How about templates?
For example if package like Mercurial provide
WEB templates which I like to customize (fix time format to ISO-8601).
Templates lies in /lib/python2.6/site-packages/mercurial/templates/*.
If I prepare some fixes to package which list appropriate to write
report to?
Contact to mail from
/usr/share/doc/Cygwin/*.README
or separate list used for this purpose?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
2011-10-19 14:02 ` Oleksandr Gavenko
@ 2011-10-19 14:13 ` Andrew Schulman
2011-10-19 15:02 ` Jeremy Bopp
0 siblings, 1 reply; 8+ messages in thread
From: Andrew Schulman @ 2011-10-19 14:13 UTC (permalink / raw)
To: cygwin
> How about templates?
>
> For example if package like Mercurial provide
> WEB templates which I like to customize (fix time format to ISO-8601).
> Templates lies in /lib/python2.6/site-packages/mercurial/templates/*.
It seems that that's something you'll have to work out with the Mercurial
package maintainer. A postinstall script can certainly check to see if
templates have changed, and if they have either leave them in place, or
even merge in new changes, if you can work out a good way to do that
without prompting the user.
> If I prepare some fixes to package which list appropriate to write
> report to?
This is the right list. If you put mercurial in the subject, the
maintainer will probably see it.
Good luck,
Andrew.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
2011-10-19 14:13 ` Andrew Schulman
@ 2011-10-19 15:02 ` Jeremy Bopp
0 siblings, 0 replies; 8+ messages in thread
From: Jeremy Bopp @ 2011-10-19 15:02 UTC (permalink / raw)
To: cygwin
On 10/19/2011 09:13, Andrew Schulman wrote:
>> How about templates?
>>
>> For example if package like Mercurial provide
>> WEB templates which I like to customize (fix time format to ISO-8601).
>> Templates lies in /lib/python2.6/site-packages/mercurial/templates/*.
>
> It seems that that's something you'll have to work out with the Mercurial
> package maintainer. A postinstall script can certainly check to see if
> templates have changed, and if they have either leave them in place, or
> even merge in new changes, if you can work out a good way to do that
> without prompting the user.
According to this page, you can change where hgweb looks for templates
by editing either /etc/mercurial/hgrc or the .hgrc file in the home
directory of the user running hgweb:
http://mercurial.selenic.com/wiki/Theming
Rather than making a complex postinstall script than can manage
overrides sanely, it would be better to copy the packaged template files
into a new location outside of the paths managed by the packages and
then configure hgweb to look for them in the new location. You'll then
be free to make any changes you like then without fear that they will be
inadvertently clobbered.
-Jeremy
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files?
2011-10-19 13:28 ` Andrew Schulman
2011-10-19 14:02 ` Oleksandr Gavenko
@ 2011-10-19 17:01 ` Yaakov (Cygwin/X)
2011-10-19 17:08 ` Andrew Schulman
1 sibling, 1 reply; 8+ messages in thread
From: Yaakov (Cygwin/X) @ 2011-10-19 17:01 UTC (permalink / raw)
To: cygwin
On Wed, 2011-10-19 at 09:27 -0400, Andrew Schulman wrote:
> This is up to each package maintainer. Current best practice - at least,
> as of a year or two ago when I asked about it on cygwin-apps I think - is
> to include:
>
> (1) a default config file in /etc/defaults/etc;
> (2) a preremove script that removes the existing config file iff it hasn't
> change from the default; and
> (3) a postinstall script that installs the default config into /etc if no
> other config file is already there.
>
> If all three of those are present, then a package upgrade will replace the
> existing config files if and only if they haven't changed since they were
> installed. If they have changed, then it's up to the user to merge the old
> and new configs.
>
> cygport provides automatic support for (1) and (3) above if you call e.g.
>
> make_etc_defaults /etc/lftp.conf
>
> To complete the set, package maintainers have to separately include a
> simple preremove script, e.g.
Actually, cygport handles (2) as well. No further intervention should
be necessary once make_etc_defaults is called.
Yaakov
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-10-23 3:05 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-19 10:12 How does setup.exe cope with upgrading of already installed packages if there exist modification in installed files? Oleksandr Gavenko
2011-10-19 13:28 ` Andrew Schulman
2011-10-19 14:02 ` Oleksandr Gavenko
2011-10-19 14:13 ` Andrew Schulman
2011-10-19 15:02 ` Jeremy Bopp
2011-10-19 17:01 ` Yaakov (Cygwin/X)
2011-10-19 17:08 ` Andrew Schulman
2011-10-23 3:05 ` Yaakov (Cygwin/X)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).