<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Doinst.sh</id>
	<title>Doinst.sh - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Doinst.sh"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Doinst.sh&amp;action=history"/>
	<updated>2026-04-08T16:09:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26&amp;oldid=prev</id>
		<title>Dugan: Migrated from old wiki</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Doinst.sh&amp;diff=26&amp;oldid=prev"/>
		<updated>2009-05-28T20:09:56Z</updated>

		<summary type="html">&lt;p&gt;Migrated from old wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This script is usually included under ./install within Slackware [[packages]] and contains post-install actions.&lt;br /&gt;
&lt;br /&gt;
Usually automatically created by [[makepkg]] for cleaning up and recreating symbolic links, advanced packagers may wish to include further configuration instructions here to be executed after files have been extracted from the .tgz package.&lt;br /&gt;
&lt;br /&gt;
== Files ==&lt;br /&gt;
&lt;br /&gt;
Within packages, doinst.sh is located in install/.&lt;br /&gt;
&lt;br /&gt;
After installation, the doinst.sh scripts are placed in /var/log/scripts, and renamed into the package name.&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Handling symbolic links ===&lt;br /&gt;
&lt;br /&gt;
The package 'udev-064-i486-2' (from Slackware 10.2), contains a doinst.sh script which includes the following:&lt;br /&gt;
&lt;br /&gt;
 ( cd etc/hotplug.d/default ; rm -rf 10-udev.hotplug )&lt;br /&gt;
 ( cd etc/hotplug.d/default ; ln -sf /sbin/udevsend 10-udev.hotplug )&lt;br /&gt;
 ( cd usr/man/man8 ; rm -rf udevsend.8.gz )&lt;br /&gt;
 ( cd usr/man/man8 ; ln -sf udevd.8.gz udevsend.8.gz )&lt;br /&gt;
&lt;br /&gt;
Thus, during installation of this package, it will delete 'etc/hotplug.d/default/10-udev.hotplug' and 'usr/man/man8/udevsend.8.gz', then immediately recreate them using symbolic links.&lt;br /&gt;
&lt;br /&gt;
This part of doinst.sh scripts is the most common, and is almost always generated by [[makepkg]] automatically during the creation of the package. In fact, 'makepkg' strongly suggests handling symbolic links using the doinst.sh script this way.&lt;br /&gt;
&lt;br /&gt;
=== Configuration Files ===&lt;br /&gt;
&lt;br /&gt;
The package 'vim-7.0.109-i486-1' (from Slackware 11.0), contains a doinst.sh script which includes the following:&lt;br /&gt;
&lt;br /&gt;
 config() {&lt;br /&gt;
  NEW=&amp;quot;$1&amp;quot;&lt;br /&gt;
  OLD=&amp;quot;$(dirname $NEW)/$(basename $NEW .new)&amp;quot;&lt;br /&gt;
  # If there's no config file by that name, mv it over:&lt;br /&gt;
  if [ ! -r $OLD ]; then&lt;br /&gt;
    mv $NEW $OLD&lt;br /&gt;
  elif [ &amp;quot;$(cat $OLD | md5sum)&amp;quot; = &amp;quot;$(cat $NEW | md5sum)&amp;quot; ]; then # toss the redundant copy&lt;br /&gt;
    rm $NEW&lt;br /&gt;
  fi&lt;br /&gt;
  # Otherwise, we leave the .new copy for the admin to consider...&lt;br /&gt;
 }&lt;br /&gt;
 config usr/share/vim/vimrc.new&lt;br /&gt;
&lt;br /&gt;
The config() function checks whether the configuration file in the package (vimrc) already exists on the system, or is exactly the same as the new one included in the package; if it exists and is not the same as the package's copy, it will not overwrite the old one but instead will be copied with a .new file extension (vimrc.new).&lt;br /&gt;
&lt;br /&gt;
This is a common, and the preferred, way of dealing with configuration files in Slackware packages.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[Packages]]&lt;br /&gt;
* [[Building A Package]]&lt;/div&gt;</summary>
		<author><name>Dugan</name></author>
	</entry>
</feed>