Page MenuHomeFreeBSD

rc: ignore .pkgsave files

Authored by on Jan 4 2021, 9:48 PM.
Referenced Files
Unknown Object (File)
Wed, Jun 26, 8:26 PM
Unknown Object (File)
Wed, Jun 26, 10:01 AM
Unknown Object (File)
Tue, Jun 25, 9:50 PM
Unknown Object (File)
Tue, Jun 25, 4:26 AM
Unknown Object (File)
Jun 15 2024, 4:54 AM
Unknown Object (File)
Jun 12 2024, 3:11 PM
Unknown Object (File)
Jun 12 2024, 2:59 PM
Unknown Object (File)
Jun 12 2024, 2:02 AM


Group Reviewers
rG3693d9140e05: rc: ignore .pkgsave files

the local parts of rc already skip .sample files; we add .pkgsave to the
for base, we add an equivalent function and for now only ignore .pkgsave

thanks to RhodiumToad for getting this started in

Motivation: having this in place means that people can much quicker get into testing pkgbase, instead of cleaning up after pkg

Test Plan

tested on my laptop by

  • copying /etc/rc.d/* to /etc/rc.d/*.pkgsave and
  • *not seeing* daemons getting started twice

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline created this revision.

Skipping any file with "." in it seems a bit harsh. rc.subr is used by the scripts in /usr/local/etc/rc.d too, including anything users might write for local things. You're basically deciding that people can't have scripts named "" "mything.test" "" etc. without any way of knowing why this one case silently breaks. Seems not ideal to me.

I suggested this kind of approach in D27959 for kldxref; I think it's reasonable in that case, although perhaps we could indeed end up with something like if_em.test.ko


as you can see from the function name, this is restricted to /etc/rc.d

/usr/local/etc/rc.d has other restrictions, which we only extended

however, we could log this skip case, so people know what's up


Ah, right. Still, might be better to only skip the things we know need to be skipped, IMHO. edited the summary of this revision. (Show Details) marked 2 inline comments as done.

addressed @swills' concerns.

kevans added inline comments.

I don't think we want this part, though. If you end up with .pkgnew or .pkgsave in the local scripts, then that's indicative of a real problem -- this is based on a vague recollection of a remark by @bapt that ports trying to mark anything as config file rather than using the sample mechanism should be smacked with an oversized broomstick.


We should also skip *.pkgnew here

I'll be updating this review and try to revive it.

does this need a documentation update?


we could move this to the part that has a *warning* about a bunch fragments:

        *[~#]|*.OLD|*.bak|*.orig|*,v)   # scratch file; skip          
                warn "Ignoring scratch file $_file"

So where is this review? It seems to have wound down a bit.


If you did this, add *~ to the list too... emacs backup files should be ignored too.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 15 2023, 3:08 AM
Closed by commit rG3693d9140e05: rc: ignore .pkgsave files (authored by, committed by imp). · Explain Why
This revision was automatically updated to reflect the committed changes.