Skip to content
  • Eli Schwartz's avatar
    ftpdir-cleanup,sourceballs: replace external find command with bash globbing · c82f4372
    Eli Schwartz authored
    This fully removes the use of find from the codebase, leads to a
    micro-optimization in a couple cases, and ensures that $PKGEXT is
    consistently treated as a shell globbing character (which is important
    because it is used as one).
    
    Of the eight instances in these files:
    
    - One was unnecessary as `cat` can natively consume all files passed to
      it and no directory traversal was in use.
    
    - Two were unnecessary as they were hardcoded to read a single file....
    
    - Another four were only being used to strip leading directory paths,
      and can be replaced by globstar and ${filepath##*/}
    
    - The final two were checking the modification time of the files, and
      can be replaced with touch(1) and [[ -nt ]]. Although this introduces
      an additional temporary file, this is not such a big deal.
    c82f4372