On 2 Sep 2002, James Sparenberg wrote: > All, > > When creating a new rpm of a product that is an update to a previous > one I need to ensure that previous log files don't get overwritten with > new versions and blank them out. Many of the Mandrake RPMS are able to > handle things like this elegantly by saving new files as rpmnew. How is > this handled in rpm?
You can add the check inside the rpm spec file as part of the install section. You can either make the script itself look for the old log file to rename it, or use the 'install' utility to automatically do so. > > Second is there any way to build an rpm with an either/or dependency? > I've run into problems with a cross distro situation. One names an rpm > with a - another with an _ Would this be handled in the program itself > or can an rpm be created with a dependency as a boolean or rather than > an and. Instead of checking for the filename itself, you can try checking for the dependency that the package provides. For example, you can test that 'webserver' exists, rather than a specific version of apache. If you're doing the check against a filename, you can also try querying using the -queryformat option. This will help if the underscore or dash is used to separate the parts of the package name.
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
