syntax errors (and unchanged example files to be left behind) on Interix;
it probably causes a problem on others.
(This test appears to work around a case where two files were exactly the
same by inode, and have the script *not* delete the file in that case.
I'm not exactly sure why that is desirable at all.)
+RCD_SCRIPTS, and +PERMS subscripts to handle copying config files
and rc.d scripts, and setting special permissions on files. The +FILES
and +RCD_SCRIPTS are basically identical except for different embedded
packets of data, and they feature reference-counting for the files in
case multiple packages share the same config file.
Garbage-collect unused functions and definitions in the install scripts
now that the subscripts are self-contained.
now simply make ${PKG_REFCOUNT_DBDIR} always be ${PKG_DBDIR}.refcount
so that it always follows the location of ${PKG_DBDIR}. This preserves
the ability for PKG_DBDIR (and PKG_REFCOUNT_DBDIR) to be different on
different machines despite using the same binary packages.
CHECK-REMOVE. The users and groups are now printed on the same line
with whitespace separating the entries (for easy copy-and-pasting info
commands), and wrapping to successive lines if we overflow the length
of the current line.
script that is unpacked by the +INSTALL script at PRE-INSTALL time
before any other actions take place, and invoke +USERGROUP to create
any necessary users and groups. Remove the now-unused code for
PKG_USERS and PKG_GROUPS from the install and deinstall templates.
We also reference count the users and groups and store the reference
counts in ${PKG_DBDIR}/.refcount/{users,groups}. This allows multiple
packages to register that they use same users and groups, and allows
+USERGROUP to be invoked at any time to repair an installed package.
Also fix the install and deinstall templates to invoke the CHECK-*
actions with ${PKG_METADATA_DIR} so that the correct PKGNAME can be
derived. This fixes the weird messages asking the user to create
directories for ".pkgdb" during a "make install".
of directories needed for the proper functioning of each package.
The +INSTALL script unpacks a +DIRS script that adds and removes
directories. The +DIRS script entirely encapsulates the directory
creation and removal, and completely replaces the code in the
mk/install/install and mk/install/deinstall templates that handled
{MAKE,OWN}_DIRS and {MAKE,OWN}_DIRS_PERMS.
The +DIRS script is meant to be executed from within the package
meta-data directory, e.g. /var/db/pkg/<pkgname>. It's usage is:
./+DIRS ADD|REMOVE|CHECK-ADD|CHECK-REMOVE
The ADD and REMOVE actions cause the necessary directories to be added
or removed from the system. The CHECK-ADD and CHECK-REMOVE actions
print out informative messages prompting the user to either create or
remove some necessary directories.
The behaviour of "ADD" is such that if the directory already exists
on the system and is not already ref-counted, then that directory is
marked as "pre-existing". On "REMOVE", pre-existing directories are
left untouched on the filesystem.
At any time, the root user can sanity-check the directories needed by
packages by invoking all of the +DIRS scripts with the "CHECK-ADD"
action. If there are missing directories, then invoking all of the
+DIRS scripts with the "ADD" action will ensure that any missing
directories are created.
The reference counts database is stored in ${PKG_DBDIR}/.refcount.
The reference counts related to directories managed by the +DIRS script
are stored in ${PKG_DBDIR}/.refcount/dirs. If the directory reference
counts database is removed, then invoking all of the +DIRS scripts
with the "ADD" action will reconstruct the database; however, directories
may be marked as being pre-existing, so they won't be removed at
package de-installation (although a message will be displayed informing
the user that those directories can be removed).
Previously, ttmkfdir's output was redirected to fonts.dir,
while the correct behaviour is to let it create fonts.scale
and then let mkfontdir merge fonts.scale into fonts.dir.
type1 handling had a similar problem.
Get the wanted behaviour by automatically appending the contents of
FONTS_TTF_DIRS and FONTS_TYPE1_DIRS to FONTS_X11_DIRS.
Also, save a subshell in install/fonts while there.
Bump PKGREVISION for all affected packages.
jmmv@ says ok.
and groupadd commands won't follow the calling conventions of the
NetBSD useradd/groupadd. Modify the INSTALL scripts to *never* create
users or groups if there is no available ${USERADD} or ${GROUPADD}
command, but will warn the user of users and groups that need to be
created before the package can be installed.
${PREFIX}. It is not an absolute path because with the automatic
addition of the entry to the PLIST would be bogus if someone
defined it to some RCD_SCRIPTS_EXAMPLEDIR outside of PREFIX.
(This may cause multiple rc.d directories if there are multiple
PREFIXes, but I think that is fine.)
Note that at this time, this doesn't change the RCD_SCRIPTS_EXAMPLEDIR
default directory. This will change soon.
Most of this has been in use for over a year.
Also some of this is from Greg Woods. Thank you Greg.
I will next update a few other references to RCD_SCRIPTS_EXAMPLEDIR.
This way font directories are not automatically removed; the package must
define OWN_DIRS if it wants them to be deleted during deinstallation.
This is done to avoid removal of standard font directories (those that
appear in *.dist files).
* Ensure that VIEW-INSTALL is called after _all_ POST-INSTALL actions
(including any in the INSTALL_EXTRA_TMPL file) by moving the call to
a file that is included after all other INSTALL templates.
* Ensure that VIEW-DEINSTALL is called before _all_ DEINSTALL actions
(including any in the DEINSTALL_EXTRA_TMPL file) by moving the call to
a file that is included before all other DEINSTALL templates.
config directory matches the config directory for the dependency
listed in CONF_DEPENDS. Use symlinks to physically point the
package's config directory to the dependency's config directory, and
handle all of this in the INSTALL/DEINSTALL scripts.
Also make the INSTALL/DEINSTALL scripts a bit smarter about not
copying files and not removing files if the source and destination
file locations point to the same thing.
PKG_SYSCONFBASE when they want PKG_SYSCONFDIR stripped of
PKG_SYSCONFSUBDIR. This makes PKG_SYSCONFBASE=/etc work with pkgviews by
installing all config files into /etc/packages/<pkg> instead of
occasionally putting some directly into /etc.
Also only create PKG_SYSCONFDIR if we're actually going to copy config
files.
file exist when installing a package and it does not contain at
least one line starting with '*' then remove it and let install-info
create a new one.
This should address PR pkg/22555 from reed@.
directory file remove it if it is empty i.e. if it contains only one
menu/entry line i.e. only one line starting with '*'.
This allow INFO_DIR to be set to a package specific directory while
not registering in the PLIST the Info directory file (${INFOR_DIR}/dir).
Registering such an Info directory file in the PLIST is not really
possible as a md5 signature of it holding the registered info entries
would be stored in PKG_DBDIR. At deinstall time this signature would not be
matched because the DEINSTALL script would have modified it by
un-registering the info files from it. Hence the package removal would
be reported as incomplete...
You are probably right if this looks like a hack to you...
makeinfo commands.
The goal of the new framework is twofold:
- reduce the number of '@exec' and '@unexec' in PLIST by
using INSTALL/DEINSTALL scripts to handle entries addition/removal
Info directory file.
- achieve lighter dependencies by avoiding unnecessary run-time
dependency on the gtexinfo package and if needed with the help of the
standalone install-info command provided by the recently imported package
pkgtools/pkg_install-info.
A package must be sightly updated to use this new framework and
must define the variable USE_NEW_TEXINFO. This variable will
be removed from the pkgsrc tree when all package would have been
updated.
For details see section 10.24 of Packages.txt, comments in
mk/{texinfo.mk,buildlink2/bsd.buildlink2.mk} and upcoming mail to
<tech-pkg at netbsd dot org>.
fonts.dir, fonts.scale and Fontmap files (depending on the font type) in
the right directories at (de)install time. Support included for TrueType,
Type1 and standard X11 fonts.
Reviewed by jlam.
we can more accurately determine if we "own" a directory. Ownership is
determined by seeing if the directory doesn't exist before the package is
installed.
that are outside of ${LOCALBASE} belong to the package that lists them.
If the directory already exists before the package is installed, then
we don't presume ownership of the directory.
This addresses pkg/18383 by Grant Beattie.