May 2, 201115 yr Hi All, Is it possible for me to create a package that moves and replaces files that are already there? Eg, template.php. I know I can create a slackware package that installs files to /usr/#$#$/34#sdf/, but is it smart enough to move files too? Cheers
May 3, 201115 yr You can code up your own install/doinst.sh to do whatever you want upon installation. If you do not want to replace files, then you will need to have your files named differently inside your package and also have your install script decide what to do. For instance, what my packages do is copy certain files over to "filename.new" if it determines the files are different ["filename" and "filename.new"] and then indicates to the user to examine the files to make the appropriate changes as they see fit. If the files are identical then it doesn't copy over the "filename.new". This is vital to do for any/all of the /etc/rc.d/rc.* type of files. Here is the portion of my "install/doins.sh" for dealing with the /etc/rc.d/rc.local.new file. config() { NEW="$1" OLD="`dirname $NEW`/`basename $NEW .new`" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy rm $NEW fi # Otherwise, we leave the .new copy for the admin to consider... } # deal with rc.local if [ -r etc/rc.d/rc.local -a -r etc/rc.d/rc.local.new ]; then chmod --reference etc/rc.d/rc.local etc/rc.d/rc.local.new fi config etc/rc.d/rc.local.new
Archived
This topic is now archived and is closed to further replies.