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]

RE: base-files request

> From: Igor Pechtchanski
> 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.

Good idea :)

> 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.,

Yes, I've been playing with this idea...

> 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).

[ -f /etc/preremove/base-files-manifest.lst ] || exit 0

echo "*** Removing unmodified base files."
echo "*** These will be updated by the postinstall script."
echo "*** Please wait."

while read f; do
/bin/cmp -s "${f}" "/etc/defaults${f}"
  if [ "`echo $?`" -eq "0" ]; then
    echo ${f} hasn't been modified, it will be updated
    /bin/rm -f "${f}"
done < base-files-manifest.lst

but I'll add the test for diffutils :)

This way the skel files will be upgraded in the same manner.

I have been wondering how best to release this, there have been
several patches to profile, but if I release a new package with the
new version of profile then the preremove script will never
upgrade... but how long do I (we? ;) give people to upgrade?


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