Koozali.org: home of the SME Server

RPMs should not install templates in templates-custom

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
RPMs should not install templates in templates-custom
« on: January 08, 2007, 12:48:36 PM »
[Repost from devinfo list]
[unsticky, linked from manual http://smeserver.sourceforge.net/sme7/tech/Chapter6#h1098-4]

Contrib developers, in particular, please remember:

   RPMs should not install templates in /etc/e-smith/templates-custom or templates-user-custom

Why not? Take this situation:

- User installs RPM which contains custom template
- User performs backup (which backs up custom templates, as it should)
- User restores backup on another machine (without the RPM installed)
- Custom template is restored, but the rest of the features from the RPM are not
- In the case of email, this could mean lost mail

Now take this one:

- User performs backup
- User upgrades various packages, including the RPMs with custom-templates
- User performs a restore, thinking they just restored user data
- Old custom template fragment causes pain

Custom templates are for the local sysadmin's use - to override behaviour on this system. RPMs should install fragments in /etc/e-smith/templates or /etc/e-smith/templates-user

In almost all cases you can add a new template fragment instead of overriding a standard fragment.

If you can't, then please RAISE A BUG and discuss what you want to change,  why you want to make the change and how you suggest changing it.

Please read the dev guide for details. It can be found at:
    http://wiki.contribs.org/development

Thanks,

Gordon
............

Offline kruhm

  • *
  • 680
  • +0/-0
RPMs should not install templates in templates-custom
« Reply #1 on: January 11, 2007, 02:44:45 PM »
Just some additional info that may be helpful & to make it clear...

-backup/restore doesn't restore the templates dir.
-to quickly see your custom changes in the templates dir run: /sbin/e-smith/audittools/templates

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
RPMs should not install templates in templates-custom
« Reply #2 on: January 11, 2007, 06:27:31 PM »
Quote from: "kruhm"
Just some additional info that may be helpful & to make it clear...

backup doesn't backup the templates dir.
As far as I remember it does, if not you should file a bug report.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline gordonr

  • *
  • 646
  • +0/-0
    • http://www.smeserver.com.au/
RPMs should not install templates in templates-custom
« Reply #3 on: January 11, 2007, 08:23:10 PM »
Quote from: "cactus"
Quote from: "kruhm"
Just some additional info that may be helpful & to make it clear...

backup doesn't backup the templates dir.
As far as I remember it does, if not you should file a bug report.


Actually, kruhm is correct, at least in the effect of a backup/restore. And you are technically correct that they are backed up (to tape).

The /etc/e-smith/templates and /etc/e-smith/templates-user directories are not restored when performing a restore and this is by design. The templates-custom and templates-user-custom directories are restored.

A tape backup backs up the entire system but only restores system configuration and user data. The standard templates directories are installed from RPMs, and thus do not need to, and should not, be restored.

In order to save space, a desktop backup only backs up system configuration and user data.

Both methods use the same list of files/directories to restore. The desktop backup also uses this list as the list of files/directories to backup.
............