This is the mail archive of the cygwin-apps@cygwin.com 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


John,

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"
else
  /bin/rm /etc/profile
fi

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
fi

would have).

BTW, a question to setup developers: did we ever figure out how to get
preremove scripts to run reliably?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,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]