bg-installer(1)

πŸ’– bg-installer(1) β€” like, the standardized installer program, bestie πŸ’–

okay so real talk: this is bg-installer from the General Commands Manual, section 1 (that's the one for user commands, iykyk). it's a standardized installer program and honestly? it's giving "does one job and does it flawlessly." let's get into it 🫢


✨ NAME ✨

bg-installer β€” the standardized installer program. periodt. that's the whole name, she's simple and she knows it πŸ’…


🌸 SYNOPSIS 🌸

bg-installer [top-directory] <LIST

like, you hand her a top-directory, you feed her a LIST on stdin, and she goes to work. that's the vibe 🌈


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea: bg-installer reads an installation instruction file from standard input, and then it executes those instructions inside the directory you named on the command line. main character behavior fr fr.

Every line in the file is an individual instruction. Some lines get special treatment:

  • blank lines β€” ignored, no thoughts head empty πŸ™ˆ
  • lines beginning with # β€” also ignored, they're just commentary
  • lines beginning with > β€” these, if present, tell bg-installer which base directory to use (more on that below πŸ‘‡)

Every other line has to have this format, exactly:

CMD:[OWNER]:[GROUP]:MODE:DIR[:FILENAME[:SOURCE]]

here's what each piece means, bestie:

  • CMD β€” a single character that says which installation command to run. It can optionally be followed by ?, which means "only execute this if the source exists." and if that ? is followed by a name, that name gets used instead of SOURCE as the filename to test. sneaky but iconic.
  • OWNER β€” (optional) the owner user ID or name for the target file.
  • GROUP β€” (optional) the group ID or name for the target file.
  • MODE β€” the permissions of the installed file, in octal.
  • DIR β€” the subdirectory of the installation prefix where the destination file goes.
  • FILENAME β€” (optional) the name of the file to install into the directory. You can straight up omit this for directories.
  • SOURCE β€” (optional) the name of the source file to install, if it differs from the destination file β€” or, the path in the symlink. versatile queen πŸ’…

Now the wildcard lore 🧚:

If SOURCE contains wildcards, the command gets repeated once for each matching filename. she's thorough like that.

If FILENAME is empty, it gets replaced with the value of SOURCE after wildcard expansion. And each instance of $N in FILENAME β€” where N is a single digit β€” gets replaced with the Nth part of the source filename. $0 gets replaced with the whole source filename. so $0, $1, $2… they're all little slots, and she fills them in for you πŸ’–

The target filename works out to:

PREFIX/TOP/DIR/FILENAME

where:

  • PREFIX is the value of $install_prefix if it is set,
  • TOP is the directory given on the command line,
  • DIR and FILENAME are the ones given in the installation file.

and here are the commands, aka the four flavors of slay πŸ”₯:

  • c lines copy regular files from the current directory
  • d lines create directories
  • s lines create symlinks β€” and heads up, UID, GID, and MODE are ignored for these
  • l lines copy libraries using libtool
πŸŽ€ and then there's the base directory directive thing: when bg-installer encounters one (the > lines we talked about), it opens the file named conf-BASE β€” where BASE is the word on the directive line β€” reads the first line, and uses that as the base directory (prefixed by $install_prefix, same as above). cute, right? πŸ’œ

✨ OPTIONS ✨

  • -v, --verbose β€” lists the files as they are processed. she's narrating her own life, as she should πŸ“£
  • -n, --dry-run β€” doesn't modify any files, just displays. window shopping only, no cap πŸ›οΈ
  • -c, --check β€” checks destinations instead of installing.
  • -h, --help β€” displays usage information and exits. the classic escape hatch 🫢

🌈 EXAMPLES 🌈

>bin
c:::755::prog2
c?:root:root:4750::prog2
>include
d:::755:package
c:::644:package:base.h:pkgbase.h
s:::::package.h:package/base.h

okay let's break down what this whole thing is doing, because it's lowkey beautiful ✨:

This reads conf-bin, and installs prog1 and setuid root prog2 (if it was built) under it. It then reads conf-include, creates the directory package under it, and installs pkgbase.h as base.h in that directory. It also creates a symlink package.h to package/base.h.

see? chef's kiss πŸ‘‘


πŸ’œ ENVIRONMENT πŸ’œ

  • install_prefix β€” if set, it is prefixed to all destination file names. that's it, that's the whole variable πŸ¦‹

πŸ‘‘ AUTHOR πŸ‘‘

Bruce Guenter <bruce@untroubled.org> β€” the legend herself. respect where respect is due πŸ’–


and that's the page, bestie πŸŽ€ this was bg-installer(1), straight out of the General Commands Manual, section 1. no version number and no date were printed on this one, so we're just vibing with the manual name and calling it a day. go install something cute, ily, bye πŸ’…βœ¨πŸŒΈ