jmmv / pkg_comp

Automates the build of pkgsrc binary packages in a sandbox
BSD 3-Clause "New" or "Revised" License
15 stars 3 forks source link

Reinstalling pkg_comp-cron adds semi-duplicate entry to crontab #8

Open truist opened 7 years ago

truist commented 7 years ago

Twice now I've uninstalled pkg_comp-cron and reinstalled it, and later realized that it has re-added the @daily cron task. I change it to @weekly, so I end up with it configured twice.

It's not really surprising that it does that, but it would be nice if it would e.g. check if anything in the crontab already had pkg_comp4cron in it, and just skipped adding it again.

jmmv commented 7 years ago

Well, it's a little bit surprising. The logic to detect if the job is already configured or not should be pretty permissive regarding the crontab contents, as it only looks for a combination of pkg_comp4cron and the default configuration file. Changes to the timespec should not affect this.

Was @daily to @weekly the only thing you changed?

See CRONTAB_RE in pkgsrc/pkgtools/pkg_comp-cron/INSTALL for details on how this is checked.

truist commented 7 years ago

Ah, that's the issue. I don't use the default configuration path. (I standardize all the config into /etc.)

Is that part of the check really necessary? I can't think of a case where it is better than just checking for pkg_comp4cron.

This raises another issue - each time I reinstall pkg_comp-cron, I have to re-delete the config files it installs. Maybe a better model would be to install "sample" config files in e.g. share/ and just explain where to find them and where to put them? That would also help fix the confusion about the config files installed in /etc (from pkg_comp).