PORG(8)

πŸ“¦ version 0.10, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ‘‘ PORG β€” the source code package organizer, bestie edition πŸ’…

okay so listen. porg is section 8 of the manual, it's a system thing, and it's literally your new best friend for installing stuff from source. let's get into it ✨


🌸 SYNOPSIS 🌸

porg [OPTIONS] <packages>
porg -l [OPTIONS] <package> <command>
porg -q <files>

πŸ’– DESCRIPTION πŸ’–

Porg is a program that helps you with package management when you're installing packages from source code. yes, from source. we're doing it the hard way and we're slaying at it. 🫢

when you install a package, you can run porg in log mode (that's the -l option) to wrap the install command β€” like, say, "make install" β€” and it logs every file that got created into a text database. no cap, it just keeps track. πŸ“

porg also gives you options for printing package information, printing package files, removing packages, or querying who owns a file. like a little detective. πŸ”

the special option '--' forces an end of option-scanning. this is super useful when you're entering the install command in log mode and porg is out here trying to read your flags as its own. πŸ™ˆ

also, mandatory arguments to long options are mandatory to short options too. rules are rules. πŸ’…


✨ GENERAL OPTIONS ✨

  • -a, --all β€” apply to all installed packages (not with -r).
  • -L, --logdir=DIR β€” the base log directory. the logs for the installed packages get saved here. default is /var/lib/porg, unless the variable LOGDIR is set in the configuration file (type man porgrc for more info, iykyk).
  • -v, --verbose β€” verbose output. and -vv prints debugging messages too. yes, double it. πŸ‘€
  • -x, --exact-version β€” disable expansion of the package version (not with -l). by default, porg automatically expands the package names you give it as arguments, adding all the versions of the package that are registered in the porg database. for instance, if foo-1.0 and foo-2.0 are installed, the command porg -r foo would remove both packages, and porg -r foo-1 would remove only foo-1.0. the -x option inhibits this expansion, so package names must match the basename and the whole version of a registered package. strict queen behavior. πŸ‘‘
  • -h, --help β€” display a help message and exit.
  • -V, --version β€” display version information and exit.

πŸŽ€ GENERAL LIST OPTIONS πŸŽ€

these options can be used to list packages or files. very "let me see everything" energy. 🌈

  • -R, --reverse β€” reverse the order while sorting.
  • -t, --total β€” print totals at the bottom of the list, when applicable. when printing total sizes, the sizes of hardlinks to installed files are counted only once. efficiency, we love to see it. ✨
  • -z, --no-package-name β€” do not print the name of the package when listing. useful for scripts. no fluff, just data. 🧚

πŸ¦‹ PACKAGE LIST OPTIONS πŸ¦‹

  • -s, --size β€” print the installed size of the package. sizes of hardlinks to installed files are counted only once.
  • -F, --nfiles β€” print the number of installed files.
  • -d, --date β€” print the installation date of the package. double it (-dd) to print the hour too. double it, bestie. πŸ’…
  • -S, --sort=WORD β€” sort the list by WORD: 'name', 'size', 'files' or 'date'.

🌸 FILE LIST OPTIONS 🌸

  • -f, --files β€” list the files installed by the package.
  • -s, --size β€” print the size of each file.
  • -y, --symlinks β€” print the contents of symbolic links.
  • -S, --sort=WORD β€” sort the list by WORD: 'name' or 'size'.

πŸ’œ PACKAGE INFORMATION OPTIONS πŸ’œ

only one of these options may be used at once. pick one, bestie. one. πŸ™ˆ
  • -i, --info β€” print package information (like summary, author, URL…), if available.
  • -o, --configure-options β€” print the arguments (command line options and environment variables) passed to the 'configure' script when the package was built.
  • -q, --query β€” query for the packages that own the files specified as arguments.

πŸ”₯ PACKAGE LOG OPTIONS πŸ”₯

  • -l, --log β€” enable log mode. if a shell command is given as an argument, execute and monitor it, logging the created files; otherwise the list of files to be logged is read from the standard input. in either case, the relative paths are automatically resolved. the list of logged files is printed to the standard output, unless any of the -p or -D options is used, in which case it's assumed that a package is to be registered into the porg database. see EXAMPLES and FILE NAMES WITH SPACES below. πŸ‘‡
  • -p, --package=PKG β€” specify the name of the package to be logged. with -v, the list of logged files is also printed to the standard error stream. with -vv, porg prints detailed information about the install process. this holds for option -D too.
  • -D, --dirname β€” use the name of the current directory as the name of the package to be logged. main character energy, honestly. ✨
  • -E, --exclude=PATH1:PATH2:... β€” colon-separated list of paths to skip when logging the installed files. default is /tmp:/dev:/proc:/sys:/run, unless the variable exclude is set in the configuration file (type man porgrc for more information). shell wildcards are allowed in the PATHs. see PATH MATCHING below for more details.
  • -I, --include=PATH1:PATH2:... β€” colon-separated list of paths to scan when logging the installed files. default is /, unless the variable include is set in the configuration file (type man porgrc for more information). shell wildcards are allowed in the PATHs. see PATH MATCHING below for more details.
  • -j, --log-missing β€” by default, when installing a package, porg registers only those files that exist in the filesystem right after the installation. with this option, porg registers also the missing files. spooky but useful. πŸ‘»
  • -+, --append β€” with -p or -D, if the package is already registered, append the list of created files to its log.

πŸ’€ PACKAGE REMOVE OPTIONS πŸ’€

  • -r, --remove β€” remove a package, keeping the shared files and asking for confirmation by default. it's polite like that. 🫢
  • -U, --unlog β€” unregister the package from the database, without removing any file. it's just forgetting, not deleting. 😭
  • -b, --batch β€” don't prompt for confirmation when removing or unlogging (and assume yes to all questions). bold. risky. iconic. πŸ’…
  • -e, --skip=PATH1:PATH2:... β€” colon-separated list of paths to skip when removing a package. default is '' (all logged files are removed), unless the variable remove_skip is set in the configuration file (type man porgrc for more information). shell wildcards are allowed in the PATHs. see PATH MATCHING for more details.

🌈 PATH MATCHING 🌈

options -I, -E and -e accept a colon-separated list of paths, each of which may contain shell-like wildcards (*, ? and [..]). files are matched against each of those paths, following the standard shell-like expansion, but with the following exception:

if a path in the list does not contain any wildcard, and it is a directory, it matches any file within that directory.

note that if wildcards are to be used, the whole list of paths must be enclosed in single quotes (') to protect it from being expanded by the shell. protect your paths, bestie. πŸ›‘οΈ


πŸ“ FILE NAMES WITH SPACES πŸ“

as of version 0.3, porg accepts filenames with spaces when logging package installations. although IMHO this should be seen as an improvement in general terms, it may cause problems when trying to feed porg -l with a list of files separated by spaces. for example, the following command:

echo /bin/foo /bin/bar | porg -l

would try to log the file "/bin/foo /bin/bar" instead of logging /bin/foo and /bin/bar separately. 😭 to fix this, one may use newlines to separate file names, and pass option -e to echo so it honours escape characters, like this:

echo -e "/bin/foo\n/bin/bar" | porg -l

or either write the list of files separated by newlines into a temporary file, and run:

cat tmpfile | porg -l

⭐ EXAMPLES ⭐

to log the installation of the package 'foo-1.0', which is installed with the command 'make -C src install':

porg -lp foo-1.0 "make -C src install"

note that in this example the quotes are required to prevent porg from considering '-C' as a command line option. the special end-of-option argument '--' may be used for the same purpose:

porg -lp foo-1.0 -- make -C src install

use single quotes if the command already contains double quotes:

porg -lp foo-1.0 'echo "hello world" > /var/log/foo.log'

alternatively, we can use the basename of the current directory as the name of the package to be logged, using the option -D instead of -p:

porg -lD "make install && make install.man"

if we have forgotten to install a file, it can be added to a previously created log with the option -+:

porg -lp+ foo-1.0 "install bar /bin/bar"

note that the option -+ cannot be used to remove a file from the log. for instance, the following command:

porg -lp+ foo-1.0 "rm /bin/bar"

would not remove the file /bin/bar from the log of foo-1.0. nope. not happening. πŸ™…

to avoid such behaviour it is sometimes useful to join up composed install commands into one single command and run porg once. for instance, imagine that a package installs the file /bin/bar, but we want it to be installed in /usr/bin/bar instead. if one runs this:

porg -lp foo-1.0 make install
porg -lp+ foo-1.0 "mv /bin/bar /usr/bin/bar"

both files, /bin/bar and /usr/bin/bar, remain in the log. this is usually not the desired behaviour. as a workaround one can join up both commands in one single porg run:

porg -lp foo-1.0 "make install && mv /bin/bar /usr/bin/bar"

in this case only /usr/bin/bar is logged. slay. ✨

to remove the package foo-3.3, keeping the files in /etc and the files ending with ".conf":

porg -r -e '/etc:*.conf' foo-3.3

you have installed the package 'boo-1.9' in prefix '/opt/boo-1.9', but you haven't logged the installation with porg. no problem! just create a log for it thusly:

find /opt/boo-1.9 | porg -lp boo-1.9

by the way, porg internally converts all package names to lower case; 'FooBar' and 'foobar' are the same package. case-insensitive queen. πŸ‘‘


😭 BUGS 😭

due to LD_PRELOAD limitations, porg can't follow the trace of suid programs.

for the same reason, porg does not work with programs that statically link libc.

so real. so valid. so unfortunately true. πŸ’€

🧚 FILES 🧚

  • /etc/porgrc β€” configuration file
  • /var/lib/porg β€” default log directory

🌸 AUTHOR 🌸

written by David Ricart (http://porg.sourceforge.net)


🫢 SEE ALSO 🫢

porgrc(5), porgball(8)


and that's the whole thing bestie β€” porg 0.10, dated 17 May 2016 πŸ’– go log some packages, you absolute legend βœ¨πŸŽ€

πŸ“¦ where this page comes from