This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

base-files request


Would it be possible to add the base-files package version to the header
comment of all the scripts in base-files?  It would then be apparent which
version of the base-files package each script came from.

Another thing that was talked about was checking whether /etc/profile was
edited and updating it if it wasn't (same probably goes for other
/etc/defaults scripts).  One way to do this is to compare /etc/profile
with /etc/defaults/etc/profile in the preremove script, and if it's the
same, remove /etc/profile, i.e.,

if /bin/cmp -s /etc/defaults/etc/profile /etc/profile; then
  echo "/etc/profile was modified, leaving as-is"
elif [ $? -eq 127 ]; then
  echo "diffutils must have been uninstalled, sorry"
  /bin/rm /etc/profile

The contortions above are needed to correctly handle the case when
"diffutils" is being upgraded as well.  Of course, upgrading "fileutils"
will cause "rm" to fail, and no postinstall script will work if either
"cygwin" or "bash" is upgraded, but at least the above won't remove
/etc/profile if /bin/cmp is missing (as the first obvious choice,

if ! /bin/cmp -s /etc/defaults/etc/profile /etc/profile; then
  /bin/rm /etc/profile

would have).

BTW, a question to setup developers: did we ever figure out how to get
preremove scripts to run reliably?
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster."  -- Patrick Naughton

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]