[
  {
    "path": ".gitignore",
    "content": "*.swp\n*.html\n*.deb\n*.dsc\n*.debian.tar.gz\n*.diff.gz\n*.orig.tar.gz\n*.tar.gz\n*~\netc/freight.conf\nvar\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2010 Richard Crowley. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    1.  Redistributions of source code must retain the above copyright\n        notice, this list of conditions and the following disclaimer.\n\n    2.  Redistributions in binary form must reproduce the above\n        copyright notice, this list of conditions and the following\n        disclaimer in the documentation and/or other materials provided\n        with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY RICHARD CROWLEY ``AS IS'' AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL RICHARD CROWLEY OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF\nTHE POSSIBILITY OF SUCH DAMAGE.\n\nThe views and conclusions contained in the software and documentation\nare those of the authors and should not be interpreted as representing\nofficial policies, either expressed or implied, of Richard Crowley.\n"
  },
  {
    "path": "Makefile",
    "content": "VERSION=0.3.5\nBUILD=1\n\nprefix=/usr/local\nbindir=${prefix}/bin\nlibdir=${prefix}/lib\nsysconfdir=${prefix}/etc\nmandir=${prefix}/share/man\n\nall:\n\nclean:\n\trm -rf *.deb debian man/man*/*.html\n\tfind . -name '*~' -delete\n\ninstall: install-bin install-lib install-man install-sysconf\n\ninstall-bin:\n\tfind bin -type f -printf %P\\\\0 | xargs -0r -I__ install -D bin/__ $(DESTDIR)$(bindir)/__\n\ninstall-lib:\n\tfind lib -type f -printf %P\\\\0 | xargs -0r -I__ install -m644 -D lib/__ $(DESTDIR)$(libdir)/__\n\ninstall-man:\n\tfind man -type f -name \\*.[12345678] -printf %P\\\\0 | xargs -0r -I__ install -m644 -D man/__ $(DESTDIR)$(mandir)/__\n\tfind man -type f -name \\*.[12345678] -printf %P\\\\0 | xargs -0r -I__ gzip $(DESTDIR)$(mandir)/__\n\ninstall-sysconf:\n\tfind etc -type f -not -name freight.conf -printf %P\\\\0 | xargs -0r -I__ install -m644 -D etc/__ $(DESTDIR)$(sysconfdir)/__\n\nuninstall: uninstall-bin uninstall-lib uninstall-man uninstall-sysconf\n\nuninstall-bin:\n\tfind bin -type f -printf %P\\\\0 | xargs -0r -I__ rm -f $(DESTDIR)$(bindir)/__\n\trmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(bindir) || true\n\nuninstall-lib:\n\tfind lib -type f -printf %P\\\\0 | xargs -0r -I__ rm -f $(DESTDIR)$(libdir)/__\n\tfind lib -depth -mindepth 1 -type d -printf %P\\\\0 | xargs -0r -I__ rmdir $(DESTDIR)$(libdir)/__ || true\n\trmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(libdir) || true\n\nuninstall-man:\n\tfind man -type f -name \\*.[12345678] -printf %P\\\\0 | xargs -0r -I__ rm -f $(DESTDIR)$(mandir)/__.gz\n\tfind man -depth -mindepth 1 -type d -printf %P\\\\0 | xargs -0r -I__ rmdir $(DESTDIR)$(mandir)/__ || true\n\trmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(mandir) || true\n\nuninstall-sysconf:\n\tfind etc -type f -printf %P\\\\0 | xargs -0r -I__ rm -f $(DESTDIR)$(sysconfdir)/__\n\tfind etc -depth -mindepth 1 -type d -printf %P\\\\0 | xargs -0r -I__ rmdir $(DESTDIR)$(sysconfdir)/__ || true\n\trmdir -p --ignore-fail-on-non-empty $(DESTDIR)$(sysconfdir) || true\n\nbuild:\n\tmake install prefix=/usr sysconfdir=/etc DESTDIR=debian\n\tfpm -s dir -t deb \\\n\t\t-n freight -v $(VERSION) --iteration $(BUILD) -a all \\\n\t\t-d coreutils -d dash -d dpkg -d gnupg -d grep \\\n\t\t-m \"Richard Crowley <r@rcrowley.org>\" \\\n\t\t--url \"https://github.com/rcrowley/freight\" \\\n\t\t--description \"A modern take on the Debian archive.\" \\\n\t\t-C debian .\n\tmake uninstall prefix=/usr sysconfdir=/etc DESTDIR=debian\n\ndeploy:\n\tscp freight_$(VERSION)-$(BUILD)_all.deb root@rcrowley.org:\n\tssh -t root@rcrowley.org \"freight add freight_$(VERSION)-$(BUILD)_all.deb apt/squeeze apt/wheezy apt/sid apt/lucid apt/precise apt/quantal apt/raring apt/saucy apt/trusty && rm freight_$(VERSION)-$(BUILD)_all.deb && freight cache apt/squeeze apt/wheezy apt/sid apt/lucid apt/precise apt/quantal apt/raring apt/saucy apt/trusty\"\n\nman:\n\tfind man -name \\*.ronn | xargs -n1 ronn --manual=Freight --style=toc\n\ndocs:\n\tfor SH in $$(find bin lib -type f -not -name \\*.html); do \\\n\t\tshocco $$SH >$$SH.html; \\\n\tdone\n\ngh-pages: man\n\tmkdir -p gh-pages\n\tfind man -name \\*.html | xargs -I__ mv __ gh-pages/\n\tgit checkout -q gh-pages\n\tcp -R gh-pages/* ./\n\trm -rf gh-pages\n\tgit add .\n\tgit commit -m \"Rebuilt manual.\"\n\tgit push origin gh-pages\n\tgit checkout -q master\n\n.PHONY: all install uninstall deb deploy man gh-pages\n"
  },
  {
    "path": "NOTES",
    "content": "Store repositories in a root as /var/lib/freight/<manager>/<distro>/<deb>.\n\"Compile\" to /var/cache/freight.\n\nfreight-add <deb> <manager>/<distro>...\n\tCopy and hard link <deb> into place in each <manager>/<distro>\n\t\tIf you do backups, make sure to use the -H option to rsync(1).\n\t\tDon't have to copy if we're on the same device.\n\t(Optionally) remove files from each distro that start with \"<name>_\".\n\nfreight-cache <manager>/<distro>...\n\tSort the packages in each distro.\n\tBuild a Packages file for each architecture mentioned.\n\t\tGrab the control file from each package.\n\t\tAugment it with Size, MD5Sum, SHA1, SHA256, and Filename.\n\t\tMake sure Package is first, Version is second, and Description is last.\n\tgzip every Packages file.\n\tBuild the Release file for each architecture mentioned.\n\tBuild the Release file with the checksums for each contained Release and Packages file.\n\tgpg sign the Release file.\n\nDefault directories?\n\t/var/lib/freight/<manager>/<distro>\n\t/var/cache/freight/<manager>/<distro>/{dists,pool}\n\nFor Debian-style, all that's important is the dists/ hierarchy?\n"
  },
  {
    "path": "README.md",
    "content": "# Freight\n\nA modern take on the Debian archive.\n\n## Usage\n\nInstall Freight and create a minimal configuration in `/usr/local/etc/freight.conf` or `/etc/freight.conf` as appropriate containing the name of your GPG key:\n\n\tGPG=\"example@example.com\"\n\nAdd packages to particular distros:\n\n\tfreight add foobar_1.2.3-1_all.deb apt/squeeze apt/lucid apt/natty\n\nBuild the cache of all the files needed to be accepted as a Debian archive:\n\n\tfreight cache\n\nServe `/var/cache/freight` via your favorite web server and install it as an APT source:\n\n\techo \"deb http://example.com $(lsb_release -sc) main\" | sudo tee /etc/apt/sources.list.d/example.list\n\tsudo wget -O /etc/apt/trusted.gpg.d/example.gpg http://example.com/keyring.gpg\n\tsudo apt-get update\n\tsudo apt-get -y install foobar\n\n## Installation\n\n### From source\n\n\tgit clone git://github.com/rcrowley/freight.git\n\tcd freight && make && sudo make install\n\n### From a Debian archive\n\n\techo \"deb http://packages.rcrowley.org $(lsb_release -sc) main\" | sudo tee /etc/apt/sources.list.d/rcrowley.list\n\tsudo wget -O /etc/apt/trusted.gpg.d/rcrowley.gpg http://packages.rcrowley.org/keyring.gpg\n\tsudo apt-get update\n\tsudo apt-get -y install freight\n\n### From Fedora/EPEL repositories\n\nEL users must first [configure EPEL](http://fedoraproject.org/wiki/EPEL/FAQ#How_can_I_install_the_packages_from_the_EPEL_software_repository.3F).\n\n\tyum -y install freight\n\n## Documentation\n\n* [Debian packaging for busy people](http://rcrowley.org/articles/packaging.html)\n\nThere's also [French documentation](http://blog.valouille.fr/2014/03/creer-un-depot-debian-signe-avec-freight/) assembled by Valérian Beaudoin.\n\n## Manuals\n\n* [`freight`(1)](http://rcrowley.github.com/freight/freight.1.html)\n* [`freight-add`(1)](http://rcrowley.github.com/freight/freight-add.1.html)\n* [`freight-cache`(1)](http://rcrowley.github.com/freight/freight-cache.1.html)\n* [`freight`(5)](http://rcrowley.github.com/freight/freight.5.html)\n\n## Contribute\n\nFreight is [BSD-licensed](https://github.com/rcrowley/freight/blob/master/LICENSE)\n\n* Source code: <https://github.com/rcrowley/freight>\n* Issue tracker: <https://github.com/rcrowley/freight/issues>\n* Wiki: <https://github.com/rcrowley/freight/wiki>\n"
  },
  {
    "path": "bin/freight",
    "content": "#!/bin/sh\n\n# `freight` dispatches to `freight-*` commands.\n\nset -e\n\n# Just like the DevStructure tools, which try to be just like Git, accept\n# a subcommand that really just completes the name of a real command.\nCOMMAND=$0-$1\n[ -x $COMMAND ] && {\n\tshift\n\texec $COMMAND \"$@\"\n}\n\n# Be helpful in this case since no subcommand was found.\necho \"Usage: $(basename $0) <command> [...]\" >&2\necho \"Common commands: add cache init\" >&2\necho \"See all available commands by typing \\\"$(basename $0)-<TAB><TAB>\\\"\" >&2\nexit 1\n"
  },
  {
    "path": "bin/freight-add",
    "content": "#!/bin/sh\n\n# Add a package to the Freight library.\n\n#/ Usage: freight add [-c <conf>] [-v] [-h] <package> <manager>/<distro>...\n#/   -c <conf>, --conf=<conf> config file to parse\n#/   -v, --verbose            verbose mode\n#/   -h, --help               show this help message\n\nset -e\n\nusage() {\n    grep \"^#/\" \"$0\" | cut -c\"4-\" >&2\n    exit \"$1\"\n}\nwhile [ \"$#\" -gt 0 ]\ndo\n\tcase \"$1\" in\n\t\t-c|--conf) CONF=\"$2\" shift 2;;\n\t\t-c*) CONF=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--conf=*) CONF=\"$(echo \"$1\" | cut -c\"8-\")\" shift;;\n\t\t-v|--verbose) VERBOSE=1 shift;;\n\t\t-h|--help) usage 0;;\n\t\t-*) echo \"# [freight] unknown switch: $1\" >&2;;\n\t\t*) break;;\n\tesac\ndone\n\n. \"$(dirname $(dirname $0))/lib/freight/conf.sh\"\n\n# The non-option argument(s) following the last option are package files.\n# Binary packages have only one but source packages require two or three.\n# When the last of these is found, the remaining arguments are each assumed\n# to be `<manager>/<distro>` pairs for this (source) package.\nwhile [ \"$#\" -gt 0 ]\ndo\n\tcase \"$1\" in\n\t\t*.deb|*.dsc|*.orig.tar.gz|*.diff.gz|*.debian.tar.gz|*.tar.gz)\n\t\t\tPATHNAMES=\"$PATHNAMES $1\" shift;;\n\t\t*.build|*.changes) shift;;\n\t\t*) break;;\n\tesac\ndone\n[ -z \"$PATHNAMES\" ] && usage 1\n[ -z \"$*\" ] && usage 1\n\n# Create a working directory on the same device as the Freight library and\n# copy this package there.  This used to be a link but is now a copy because\n# later Freight commands will rely on the link count being reduced to one.\nmkdir -p \"$VARLIB\"\nTMP=\"$(mktemp -d \"$VARLIB/freight.$$.XXXXXXXXXX\")\"\ntrap \"rm -rf \\\"$TMP\\\"\" EXIT INT TERM\nfor PATHNAME in $PATHNAMES\ndo\n\tcp \"$PATHNAME\" \"$TMP/\"\ndone\n\n# Enter the Freight library directory so that items in `$@` may be given as\n# absolute paths or as partial paths of the form `<manager>/<distro>` that\n# are ultimately taken relative to the Freight library.\ncd \"$VARLIB\"\n\n# Add a file to the Freight library.  The arguments are FILENAME, DIRNAME, and\n# PATHNAME.  The first two are given fairly directly to ln(1); the final one\n# is used to create appropriate success or failure messages.\nadd() {\n    if ln \"$TMP/$1\" \"$2/$1\" 2>\"$TMP/ln\"\n    then echo \"# [freight] added $3 to $2${4+\" as \"}$4\" >&2\n    else\n        if grep -q \"File exists\" \"$TMP/ln\"\n        then echo \"# [freight] $2 already has $3${4+\" as \"}$4\" >&2\n        else cat \"$TMP/ln\" >&2\n        fi\n    fi\n}\n\n# Hard link this package into every `<manager>/<distro>` given in `$@`.\n# These links will later be used to compile the `Release` and `Packages`\n# files in the Freight cache.\nfor PATHNAME in $PATHNAMES\ndo\n\tFILENAME=\"$(basename \"$PATHNAME\")\"\n\tfor DIRNAME in \"$@\"\n\tdo\n\t\tmkdir -p \"$DIRNAME\"\n        case \"$FILENAME\" in\n            *_*_*.deb) add \"$FILENAME\" \"$DIRNAME\" \"$PATHNAME\";;\n            *.deb)\n                . \"$(dirname \"$(dirname \"$0\")\")/lib/freight/apt.sh\"\n                dpkg-deb -I \"$TMP/$FILENAME\" \"control\" >\"$TMP/$FILENAME-control\"\n                DEBNAME=\"$(\n                    apt_binary_name \"$TMP/$FILENAME-control\"\n                )_$(\n                    apt_binary_version \"$TMP/$FILENAME-control\"\n                )_$(\n                    apt_binary_arch \"$TMP/$FILENAME-control\"\n                ).deb\"\n                add \"$FILENAME\" \"$DIRNAME\" \"$PATHNAME\" \"$DEBNAME\";;\n            *) add \"$FILENAME\" \"$DIRNAME\" \"$PATHNAME\";;\n        esac\n\tdone\ndone\n"
  },
  {
    "path": "bin/freight-cache",
    "content": "#!/bin/sh\n\n# Rebuild the Freight cache from the Freight library.  The cache contains\n# actual repositories that are suitable targets for `apt-get` (and maybe\n# more in the future).\n\n#/ Usage: freight cache [-k] [-g <email>] [-p <passphrase-file>] [-c <conf>] [-v] [-h] [<manager>/<distro>][...]\n#/   -k, --keep                          keep unreferenced versions of packages\n#/   -g <email>, --gpg=<email>           GPG key to use\n#/   -p <passphrase file>, \n#/   --passphrase-file=<passphrase-file> path to file containing the passphrase of the GPG key\n#/   -c <conf>, --conf=<conf>            config file to parse\n#/   -v, --verbose                       verbose mode\n#/   -h, --help                          show this help message\n\nset -e\n\nusage() {\n\tgrep \"^#/\" \"$0\" | cut -c\"4-\" >&2\n\texit \"$1\"\n}\nwhile [ \"$#\" -gt 0 ]\ndo\n\tcase \"$1\" in\n\t\t-k|--keep) KEEP=1 shift;;\n\t\t-g|--gpg) GPG=\"$2\" shift 2;;\n\t\t-g*) GPG=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--gpg=*) GPG=\"$(echo \"$1\" | cut -c\"7-\")\" shift;;\n\t\t-p|--passphrase-file) GPG_PASSPHRASE_FILE=\"$2\" shift 2;;\n\t\t-p*) GPG_PASSPHRASE_FILE=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--passphrase-file=*) GPG_PASSPHRASE_FILE=\"$(echo \"$1\" | cut -c\"19-\")\" shift;;\n\t\t-c|--conf) CONF=\"$2\" shift 2;;\n\t\t-c*) CONF=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--conf=*) CONF=\"$(echo \"$1\" | cut -c\"8-\")\" shift;;\n\t\t-v|--verbose) VERBOSE=1 shift;;\n\t\t-h|--help) usage 0;;\n\t\t-*) echo \"# [freight] unknown switch: $1\" >&2;;\n\t\t*) break;;\n\tesac\ndone\n\nLIB=\"$(cd \"$(dirname \"$(dirname \"$0\")\")/lib/freight\" && pwd)\"\n. \"$LIB/conf.sh\"\n\n# If `GPG_PASSPHRASE_FILE` is set the specified file should exist and be\n# readable by the user running Freight.\n[ -z \"$GPG_PASSPHRASE_FILE\" -o -r \"$GPG_PASSPHRASE_FILE\" ] || echo \"# [freight] could not read passphrase file: $GPG_PASSPHRASE_FILE.\" >&2\n\n# Create a working directory on the same device as the Freight cache.\nmkdir -p \"$VARCACHE\"\nTMP=\"$(mktemp -d \"$VARCACHE/work.$$.XXXXXXXXXX\")\"\ntrap \"rm -rf \\\"$TMP\\\"\" EXIT INT TERM\n\n# Enter the Freight library directory so that items in `$@` may be given as\n# absolute paths or as partial paths of the form `<manager>/<distro>` that\n# are ultimately taken relative to the Freight library.\nmkdir -p \"$VARLIB\"\ncd \"$VARLIB\"\n\n# Rebuild each distro serially.\nif [ -z \"$*\" ]\nthen\n\tDIRS=\"$(\n\t\tfind \"$VARLIB\" -mindepth 2 -maxdepth 2 -type d -printf \"%P\\n\" |\n\t\tgrep -v \"^\\\\.\" |\n\t\ttr \"\\n\" \" \"\n\t)\"\nelse\n\tDIRS=\"$@\"\nfi\nfor DIR in $DIRS\ndo\n\n\t# Parse the manager and distro out of the Freight library path.\n\tDIR=\"$(readlink -f \"$DIR\")\"\n\tDIR=\"${DIR##\"$VARLIB/\"}\"\n\tMANAGER=\"$(dirname \"$DIR\")\"\n\tDIST=\"$(basename \"$DIR\")\"\n\n\t# Should we follow symbolic links when finding components to cache?\n\t[ \"$SYMLINKS\" = \"on\" ] && FIND_L=\"-L\" || FIND_L=\"\"\n\n\t# From here the process is customized on a per-manager basis.  The\n\t# sorted list of package filenames comes on `stdin` and the name of\n\t# the distro is the only argument.  From there, each manager can do\n\t# whatever it wants.\n\t. \"$LIB/$MANAGER.sh\"\n\tSORT=\"$(sort -V <\"/dev/null\" 2>\"/dev/null\" && echo \"sort -V\" || echo \"sort\")\"\n\tfind $FIND_L \"$DIR\" -type \"f\" -printf \"%P\\n\" 2>\"/dev/null\" |\n\teval \"$SORT\" |\n\teval \"${MANAGER}_cache\" \"$DIST\"\n\n\t# Clean up old packages as dictated by the manager.\n\t[ -z \"$KEEP\" ] && eval \"${MANAGER}_clean\"\n\ndone\n"
  },
  {
    "path": "bin/freight-clear-cache",
    "content": "#!/bin/sh\n\n# Clear the cache that is built up during freight-cache runs\n# so that it can be regenerated on the next freight-cache invocation.\n\n#/ Usage: freight clear-cache [-c <conf>] [-v] [-h] [<manager>/<distro>][...]\n#/   -c <conf>, --conf=<conf>  config file to parse\n#/   -v, --verbose             verbose mode\n#/   -h, --help                show this help message\n\nset -e\n\nusage() {\n\tgrep \"^#/\" \"$0\" | cut -c\"4-\" >&2\n\texit \"$1\"\n}\nwhile [ \"$#\" -gt 0 ]\ndo\n\tcase \"$1\" in\n\t\t-c|--conf) CONF=\"$2\" shift 2;;\n\t\t-c*) CONF=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--conf=*) CONF=\"$(echo \"$1\" | cut -c\"8-\")\" shift;;\n\t\t-v|--verbose) VERBOSE=1 shift;;\n\t\t-h|--help) usage 0;;\n\t\t-*) echo \"# [freight] unknown switch: $1\" >&2;;\n\t\t*) break;;\n\tesac\ndone\n\n. \"$(dirname \"$(dirname \"$0\")\")/lib/freight/conf.sh\"\n\n# Create a working directory on the same device as the Freight cache.\nmkdir -p \"$VARCACHE\"\nTMP=\"$(mktemp -d \"$VARCACHE/work.$$.XXXXXXXXXX\")\"\ntrap \"rm -rf \\\"$TMP\\\"\" EXIT INT TERM\n\n# Enter the Freight library directory so that items in `$@` may be given as\n# absolute paths or as partial paths of the form `<manager>/<distro>` that\n# are ultimately taken relative to the Freight library.\nmkdir -p \"$VARLIB\"\ncd \"$VARLIB\"\n\n# Rebuild each distro serially.\nif [ -z \"$*\" ]\nthen\n\tDIRS=\"$(\n\t\tfind \"$VARLIB\" -mindepth 2 -maxdepth 2 -type d -printf \"%P\\n\" |\n\t\tgrep -v \"^\\\\.\" |\n\t\ttr \"\\n\" \" \"\n\t)\"\nelse\n\tDIRS=\"$@\"\nfi\nfor DIR in $DIRS\ndo\n\n\t# Parse the manager and distro out of the Freight library path.\n\tDIR=\"$(readlink -f \"$DIR\")\"\n\tDIR=\"${DIR##\"$VARLIB/\"}\"\n\tMANAGER=\"$(dirname \"$DIR\")\"\n\tDIST=\"$(basename \"$DIR\")\"\n\n\t# From here the process is customized on a per-manager basis.\n\t. \"$(dirname \"$(dirname \"$0\")\")/lib/freight/$MANAGER.sh\"\n\teval \"${MANAGER}_clear_cache\" \"$DIST\"\n\ndone\n"
  },
  {
    "path": "bin/freight-init",
    "content": "#!/bin/sh\n\n# Initialize a Freight directory (similar to git init).\n\n#/ Usage: freight init -g<email> [--libdir=<libdir>] [--cachedir=<cachedir>] [--archs=<archs>] [--origin=<origin>] [--label=<label>] [-v] [-h] [<dirname>]\n#/   -g<email>, --gpg=<email> GPG key to use\n#/   -c<conf>, --conf=<conf>  config file to create (default etc/freight.conf)\n#/   --libdir=<libdir>        library directory (default var/lib/freight)\n#/   --cachedir=<cachedir>    cache directory (default var/cache/freight)\n#/   --archs=<archs>          architectures to support (default \"i386 amd64\")\n#/   --origin=<origin>        Debian archive Origin field (default \"Freight\")\n#/   --label=<label>          Debian archive Label field (default \"Freight\")\n#/   --suite=<suite>          Debian archive Suite field\n#/   -v, --verbose            verbose mode\n#/   -h, --help               show this help message\n\nset -e\n\nCONF=\"etc/freight.conf\"\n\nusage() {\n    grep \"^#/\" \"$0\" | cut -c\"4-\" >&2\n    exit \"$1\"\n}\nwhile [ \"$#\" -gt 0 ]\ndo\n\tcase \"$1\" in\n\t\t-g|--gpg) GPG=\"$2\" shift 2;;\n\t\t-g*) GPG=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--gpg=*) GPG=\"$(echo \"$1\" | cut -c\"7-\")\" shift;;\n\t\t-c|--conf) CONF=\"$2\" shift 2;;\n\t\t-c*) CONF=\"$(echo \"$1\" | cut -c\"3-\")\" shift;;\n\t\t--conf=*) CONF=\"$(echo \"$1\" | cut -c\"8-\")\" shift;;\n\t\t--libdir) VARLIB=\"$2\" shift 2;;\n\t\t--libdir=*) VARLIB=\"$(echo \"$1\" | cut -c\"10-\")\" shift;;\n\t\t--cachedir) VARCACHE=\"$2\" shift 2;;\n\t\t--cachedir=*) VARCACHE=\"$(echo \"$1\" | cut -c\"12-\")\" shift;;\n\t\t--archs) ARCHS=\"$2\" shift 2;;\n\t\t--archs=*) ARCHS=\"$(echo \"$1\" | cut -c\"9-\")\" shift;;\n\t\t--origin) ORIGIN=\"$2\" shift 2;;\n\t\t--origin=*) ORIGIN=\"$(echo \"$1\" | cut -c\"10-\")\" shift;;\n\t\t--label) LABEL=\"$2\" shift 2;;\n\t\t--label=*) LABEL=\"$(echo \"$1\" | cut -c\"9-\")\" shift;;\n\t\t--suite) SUITE=\"$2\" shift 2;;\n\t\t--suite=*) SUITE=\"$(echo \"$1\" | cut -c\"9-\")\" shift;;\n\t\t-v|--verbose) VERBOSE=1 shift;;\n\t\t-h|--help) usage 0;;\n\t\t-*) echo \"# [freight] unknown switch: $1\" >&2;;\n\t\t*) break;;\n\tesac\ndone\nDIRNAME=\"$(cd \"${1:-\".\"}\" && pwd)\"\n[ -z \"$GPG\" -o -z \"$DIRNAME\" ] && usage 1\n\n# The default value for VARLIB and VARCACHE lies within DIRNAME but otherwise\n# follows the FHS style.\nVARLIB=\"${VARLIB:-\"$DIRNAME/var/lib\"}\"\nVARCACHE=\"${VARCACHE:-\"$DIRNAME/var/cache\"}\"\n\n# Create the directory where `CONF` will be placed.  This is likely given\n# relative to `DIRNAME` so change to that directory to make things easy.\nmkdir -p \"$DIRNAME\"\ncd \"$DIRNAME\"\nmkdir -p \"$(dirname \"$CONF\")\"\n\n# Generate `etc/freight.conf` (or some other pathname) with all the options.\ncat >\"$CONF\" <<EOF\nVARLIB=\"$VARLIB\"\nVARCACHE=\"$VARCACHE\"\nGPG=\"$GPG\"\nEOF\n[ \"$ARCHS\" ] && echo \"ARCHS=\\\"$ARCHS\\\"\" >>\"$CONF\"\n[ \"$ORIGIN\" ] && echo \"ORIGIN=\\\"$ORIGIN\\\"\" >>\"$CONF\"\n[ \"$LABEL\" ] && echo \"LABEL=\\\"$LABEL\\\"\" >>\"$CONF\"\n[ \"$SUITE\" ] && echo \"SUITE=\\\"$SUITE\\\"\" >>\"$CONF\"\n\n# return 0 when we come here\nexit 0\n"
  },
  {
    "path": "etc/bash_completion.d/freight",
    "content": ""
  },
  {
    "path": "etc/freight.conf.example",
    "content": "# Example Freight configuration.\n\n# Directories for the Freight library and Freight cache.  Your web\n# server's document root should be `$VARCACHE`.\nVARLIB=\"/var/lib/freight\"\nVARCACHE=\"/var/cache/freight\"\n\n# Default `Origin` and `Label` fields for `Release` files.\nORIGIN=\"Freight\"\nLABEL=\"Freight\"\n\n# Cache the control files after each run (on), or regenerate them every\n# time (off).\nCACHE=\"off\"\n\n# GPG key to use to sign repositories.  This is required by the `apt`\n# repository provider.  Use `gpg --gen-key` (see `gpg`(1) for more\n# details) to generate a key and put its email address here.\nGPG=\"example@example.com\"\n\n# Whether to follow symbolic links in `$VARLIB` to produce extra components\n# in the cache directory (on) or not (off).\nSYMLINKS=\"off\"\n"
  },
  {
    "path": "etc/profile.d/freight.sh",
    "content": ""
  },
  {
    "path": "lib/freight/apt.sh",
    "content": "TTY=\"$(tty -s && echo \"1\" || :)\"\n\n# Fetch the given field from the package's control file.\napt_info() {\n\tegrep -i \"^$2:\" \"$1\" | cut -d: -f2- | awk '{print $1}'\n}\n\n# Print the package name from the given control file.\napt_binary_name() {\n\tapt_info \"$1\" Package\n}\n\n# Print the version from the given control file.\napt_binary_version() {\n\tapt_info \"$1\" Version\n}\n\n# Print the architecture from the given control file.\napt_binary_arch() {\n\tapt_info \"$1\" Architecture\n}\n\napt_binary_filesize() {\n\tapt_info \"$1\" Size\n}\n\n# Print the source name from the given control file.\napt_binary_sourcename() {\n\tSOURCE=\"$(apt_info \"$1\" Source)\"\n\t[ -z \"$SOURCE\" ] && SOURCE=\"$(apt_binary_name \"$1\")\"\n\techo \"$SOURCE\"\n}\n\n# Print the prefix the given control file should use in the pool.\napt_binary_prefix() {\n\tapt_prefix \"$(apt_binary_sourcename \"$1\")\"\n}\n\n# Print the name portion of a source package's pathname.\napt_source_name() {\n\tbasename \"$1\" \".dsc\" | cut -d_ -f1\n}\n\n# Print the version portion of a source package's pathname.\napt_source_version() {\n\tbasename \"$1\" \".dsc\" | cut -d_ -f2\n}\n\n# Print the original version portion of a source package's pathname.\napt_source_origversion() {\n\tapt_source_version \"$1\" | cut -d- -f1\n}\n\n# Print the prefix for a package name.\napt_prefix() {\n\t[ \"$(echo \"$1\" | cut -c1-3)\" = \"lib\" ] && C=4 || C=1\n\techo \"$1\" | cut -c-$C\n}\n\n# Print the checksum portion of the normal checksumming programs' output.\napt_md5() {\n\tmd5sum \"$1\" | cut -d\" \" -f1\n}\napt_sha1() {\n\tsha1sum \"$1\" | cut -d\" \" -f1\n}\napt_sha256() {\n\tsha256sum \"$1\" | cut -d\" \" -f1\n}\n\n# Print the size of the given file.\napt_filesize() {\n\tstat -c%s \"$1\"\n}\n\n# Setup the repository for the distro named in the first argument,\n# including all packages read from `stdin`.\napt_cache() {\n\tDIST=\"$1\"\n\tSUITE=\"${SUITE:-$DIST}\"\n\n\t# Generate a timestamp to use in this build's directory name.\n\tDATE=\"$(date +%Y%m%d%H%M%S%N)\"\n\tDISTCACHE=\"$VARCACHE/dists/$DIST-$DATE\"\n\n\t# For a Debian archive, each distribution needs at least this directory\n\t# structure in place.  The directory for this build must not exist,\n\t# otherwise this build would clobber a previous one.  The `.refs`\n\t# directory contains links to all the packages currently included in\n\t# this distribution to enable cleaning by link count later.\n\tmkdir -p \"$DISTCACHE/.refs\"\n\tmkdir -p \"$VARCACHE/pool/$DIST\"\n\n\t# Work through every package that should be part of this distro.\n\twhile read PATHNAME\n\tdo\n\n\t\t# Extract the component, if present, from the package's pathname.\n\t\tcase \"$PATHNAME\" in\n\t\t\t*/*) COMP=\"${PATHNAME%%/*}\" PACKAGE=\"${PATHNAME##*/}\";;\n\t\t\t*) COMP=\"main\" PACKAGE=\"$PATHNAME\";;\n\t\tesac\n\n\t\tcase \"$PATHNAME\" in\n\n\t\t\t# Binary packages.\n\t\t\t*.deb) apt_cache_binary \"$DIST\" \"$DISTCACHE\" \"$PATHNAME\" \"$COMP\" \"$PACKAGE\";;\n\n\t\t\t# Source packages.  The *.dsc file is considered the \"entrypoint\"\n\t\t\t# and will find the associated *.orig.tar.gz, *.diff.gz, and/or\n            # *.tar.gz as they are needed.\n\t\t\t*.dsc) apt_cache_source \"$DIST\" \"$DISTCACHE\" \"$PATHNAME\" \"$COMP\" \"$PACKAGE\";;\n\t\t\t*.debian.tar.gz|*.diff.gz|*.orig.tar.gz|*.tar.gz|*.deb-control|*.dsc-cached) ;;\n\n\t\t\t*) echo \"# [freight] skipping extraneous file $PATHNAME\" >&2;;\n\t\tesac\n\tdone\n\tCOMPS=\"$(ls \"$DISTCACHE\")\"\n\n\t# Build a `Release` file for each component and architecture.  `gzip`\n\t# the `Packages` file, too.\n\tfor COMP in $COMPS\n\tdo\n\t\tfor ARCH in $ARCHS\n\t\tdo\n\t\t\tcat >\"$DISTCACHE/$COMP/binary-$ARCH/Release\" <<EOF\nArchive: $SUITE\nComponent: $COMP\nOrigin: $ORIGIN\nLabel: $LABEL\nArchitecture: $ARCH\nEOF\n\t\t\tgzip -c \"$DISTCACHE/$COMP/binary-$ARCH/Packages\" \\\n\t\t\t\t>\"$DISTCACHE/$COMP/binary-$ARCH/Packages.gz\"\n\t\tdone\n\t\tif [ -d \"$DISTCACHE/$COMP/source\" ]\n\t\tthen\n\t\t\tcat >\"$DISTCACHE/$COMP/source/Release\" <<EOF\nArchive: $SUITE\nComponent: $COMP\nOrigin: $ORIGIN\nLabel: $LABEL\nArchitecture: source\nEOF\n\t\t\tgzip -c \"$DISTCACHE/$COMP/source/Sources\" \\\n\t\t\t\t>\"$DISTCACHE/$COMP/source/Sources.gz\"\n\t\tfi\n\tdone\n\n\t# Begin the top-level `Release` file with the lists of components\n\t# and architectures present in this repository and the checksums\n\t# of all the `Release` and `Packages.gz` files within.\n\t{\n\t\tcat <<EOF\nOrigin: $ORIGIN\nLabel: $LABEL\nSuite: $SUITE\nCodename: $DIST\nComponents: $(echo \"$COMPS\" | tr \\\\n \" \")\nArchitectures: $ARCHS\nEOF\n\n\t\t# Finish the top-level `Release` file with references and\n\t\t# checksums for each sub-`Release` file and `Packages.gz` file.\n\t\t# In the future, `Sources` may find a place here, too.\n\t\tfind \"$DISTCACHE\" -mindepth 2 -type f -printf %P\\\\n |\n\t\tgrep -v ^\\\\. |\n\t\twhile read FILE\n\t\tdo\n\t\t\tSIZE=\"$(apt_filesize \"$DISTCACHE/$FILE\")\"\n\t\t\techo \" $(apt_md5 \"$DISTCACHE/$FILE\" ) $SIZE $FILE\" >&3\n\t\t\techo \" $(apt_sha1 \"$DISTCACHE/$FILE\" ) $SIZE $FILE\" >&4\n\t\t\techo \" $(apt_sha256 \"$DISTCACHE/$FILE\" ) $SIZE $FILE\" >&5\n\t\tdone 3>\"$TMP/md5sums\" 4>\"$TMP/sha1sums\" 5>\"$TMP/sha256sums\"\n\t\techo \"MD5Sum:\"\n\t\tcat \"$TMP/md5sums\"\n\t\techo \"SHA1:\"\n\t\tcat \"$TMP/sha1sums\"\n\t\techo \"SHA256:\"\n\t\tcat \"$TMP/sha256sums\"\n\n\t} >\"$DISTCACHE/Release\"\n\n\t# Sign the top-level `Release` file with `gpg`.\n\tgpg -abs$([ \"$TTY\" ] || echo \" --no-tty\") --use-agent -u\"$GPG\" \\\n\t\t$([ \"$GPG_PASSPHRASE_FILE\" ] && echo \" --batch --passphrase-fd 1 --passphrase-file $GPG_PASSPHRASE_FILE\") \\\n\t\t-o\"$DISTCACHE/Release.gpg\" \"$DISTCACHE/Release\" || {\n\t\tcat <<EOF\n# [freight] couldn't sign the repository, perhaps you need to run\n# [freight] gpg --gen-key and update the GPG setting in $CONF\n# [freight] (see freight(5) for more information)\nEOF\n\t\trm -rf \"$DISTCACHE\"\n\t\texit 1\n\t}\n\n\t# Generate `pubkey.gpg` containing the plaintext public key and\n\t# `keyring.gpg` containing a complete GPG keyring containing only\n\t# the appropriate public key.  `keyring.gpg` is appropriate for\n\t# copying directly to `/etc/apt/trusted.gpg.d`.\n\tmkdir -m700 -p \"$TMP/gpg\"\n\tgpg -q --export -a \"$GPG\" |\n\ttee \"$VARCACHE/pubkey.gpg\" |\n\tgpg -q --homedir \"$TMP/gpg\" --import\n\tchmod 644 \"$TMP/gpg/pubring.gpg\"\n\tmv \"$TMP/gpg/pubring.gpg\" \"$VARCACHE/keyring.gpg\"\n\n\t# Move the symbolic link for this distro to this build.\n\tln -s \"$DIST-$DATE\" \"$DISTCACHE-\"\n\tOLD=\"$(readlink \"$VARCACHE/dists/$DIST\" || true)\"\n\tmv -T \"$DISTCACHE-\" \"$VARCACHE/dists/$DIST\"\n\t[ -z \"$OLD\" ] || rm -rf \"$VARCACHE/dists/$OLD\"\n\n}\n\n# Clear the cached control files from the dist\napt_clear_cache() {\n\t# First remove the binary control cache\n\tfind \"$VARLIB/apt/$DIST\" -name *-control | xargs --no-run-if-empty rm\n\t# Next remove the source control cache\n\tfind \"$VARLIB/apt/$DIST\" -name *-cached | xargs --no-run-if-empty rm\n}\n\n# Add a binary package to the given dist and to the pool.\napt_cache_binary() {\n\tDIST=\"$1\"\n\tDISTCACHE=\"$2\"\n\tPATHNAME=\"$3\"\n\tCOMP=\"$4\"\n\tPACKAGE=\"$5\"\n\n\t# Verify this package by way of extracting its control information\n\t# to be used throughout this iteration of the loop.\n\t# Don't extract the deb archive each time. Stick the control file\n\t# in the $VARLIB alongside the other package artifacts for easy\n\t# use later.\n\tif [ \"$CACHE\" = \"on\" ]; then\n\t\tCONTROL=\"$VARLIB/apt/$DIST/$PATHNAME-control\"\n\telse\n\t\tCONTROL=\"$TMP/DEBIAN/binary-control\"\n\tfi\n\t# If caching is off or if the binary has changed size, this will generate the\n\t# binary control file\n\tif ! ( [ -e \"$CONTROL\" ] && \\\n\t\t[ \"$(apt_binary_filesize \"$CONTROL\")\" -eq \"$(apt_filesize \"$VARLIB/apt/$DIST/$PATHNAME\")\" ] ); then\n\t\tdpkg-deb -e \"$VARLIB/apt/$DIST/$PATHNAME\" \"$TMP/DEBIAN\" || {\n\t\t\techo \"# [freight] skipping invalid Debian package $PATHNAME\" >&2\n\t\t\treturn\n\t\t}\n\t\t{\n\t\t\t# Grab and augment the control file from this package.  Remove\n\t\t\t# `Size`, `MD5Sum`, etc. lines and replace them with newly\n\t\t\t# generated values. Update it once when generating the\n\t\t\t# cached control file. Add a Filename line that can be updated\n\t\t\t# easily later with the real path.  Strip out empty control fields\n\t\t\t# as these might cause problems.\n\t\t\tgrep . \"$TMP/DEBIAN/control\" |\n\t\t\tgrep -E -v \"^[A-Za-z-]+:\\s+$\" |\n\t\t\tgrep -v \"^(Essential|Filename|MD5Sum|SHA1|SHA256|Size)\"\n\t\t\tcat <<EOF\nFilename: FILENAME\nMD5sum: $(apt_md5 \"$VARLIB/apt/$DIST/$PATHNAME\")\nSHA1: $(apt_sha1 \"$VARLIB/apt/$DIST/$PATHNAME\")\nSHA256: $(apt_sha256 \"$VARLIB/apt/$DIST/$PATHNAME\")\nSize: $(apt_filesize \"$VARLIB/apt/$DIST/$PATHNAME\")\nEOF\n\t\techo\n\t\t} > \"$CONTROL\"\n\tfi\n\n\t# Create all architecture-specific directories.  This will allow\n\t# packages marked `all` to actually be placed in all architectures.\n\tfor ARCH in $ARCHS\n\tdo\n\t\tmkdir -p \"$DISTCACHE/$COMP/binary-$ARCH\"\n\t\ttouch \"$DISTCACHE/$COMP/binary-$ARCH/Packages\"\n\tdone\n\n\t# Link or copy this package into this distro's `.refs` directory.\n\tmkdir -p \"$DISTCACHE/.refs/$COMP\"\n\tln \"$VARLIB/apt/$DIST/$PATHNAME\" \"$DISTCACHE/.refs/$COMP\" ||\n\tcp \"$VARLIB/apt/$DIST/$PATHNAME\" \"$DISTCACHE/.refs/$COMP\"\n\n\t# Package properties.  Remove the epoch from the version number\n\t# in the package filename, as is customary.\n\tARCH=\"$(apt_binary_arch \"$CONTROL\")\"\n\tNAME=\"$(apt_binary_name \"$CONTROL\")\"\n\tVERSION=\"$(apt_binary_version \"$CONTROL\")\"\n\tPREFIX=\"$(apt_binary_prefix \"$CONTROL\")\"\n\tSOURCE=\"$(apt_binary_sourcename \"$CONTROL\")\"\n\tFILENAME=\"${NAME}_${VERSION##*:}_${ARCH}.deb\"\n\n\t# Link this package into the pool.\n\tPOOL=\"pool/$DIST/$COMP/$PREFIX/$SOURCE\"\n\tmkdir -p \"$VARCACHE/$POOL\"\n\tif [ ! -f \"$VARCACHE/$POOL/$FILENAME\" ]\n\tthen\n\t\tif [ \"$PACKAGE\" != \"$FILENAME\" ]\n\t\tthen echo \"# [freight] adding $PACKAGE to pool (as $FILENAME)\" >&2\n\t\telse echo \"# [freight] adding $PACKAGE to pool\" >&2\n\t\tfi\n\t\tln \"$DISTCACHE/.refs/$COMP/$PACKAGE\" \"$VARCACHE/$POOL/$FILENAME\"\n\tfi\n\n\t# Build a list of the one-or-more `Packages` files to append with\n\t# this package's info.\n\tif [ \"$ARCH\" = \"all\" ]\n\tthen FILES=\"$(find \"$DISTCACHE/$COMP\" -type f -name \"Packages\")\"\n\telse FILES=\"$DISTCACHE/$COMP/binary-$ARCH/Packages\"\n\tfi\n\n\t# Add the `Filename` field containing the path to the\n\t# package, starting with `pool/`.\n\tsed \"s,^Filename: FILENAME$,Filename: $POOL/$FILENAME,g\" \"$CONTROL\" |\n\ttee -a $FILES >/dev/null\n\n\t# Cleanup the extracted package\n\tif [ -d \"$TMP/DEBIAN\" ]; then\n\t\trm -rf \"$TMP/DEBIAN\"\n\tfi\n\n}\n\n# Add a source package to the given dist and to the pool.  *.orig.tar.gz,\n# *.diff.gz, and/or *.tar.gz will be found based on PATHNAME and associated\n# with the correct source package.\napt_cache_source() {\n\tDIST=\"$1\"\n\tDISTCACHE=\"$2\"\n\tPATHNAME=\"$3\"\n\tCOMP=\"$4\"\n\tPACKAGE=\"$5\"\n\n\tNAME=\"$(apt_source_name \"$PATHNAME\")\"\n\tVERSION=\"$(apt_source_version \"$PATHNAME\")\"\n\tORIG_VERSION=\"$(apt_source_origversion \"$PATHNAME\")\"\n\tDIRNAME=\"$(dirname \"$PATHNAME\")\"\n\tDSC_FILENAME=\"${NAME}_${VERSION%*:}.dsc\"\n\tDEBTAR_FILENAME=\"${NAME}_${VERSION%*:}.debian.tar.gz\"\n\tDIFFGZ_FILENAME=\"${NAME}_${VERSION%*:}.diff.gz\"\n\tORIG_FILENAME=\"${NAME}_${ORIG_VERSION}.orig.tar.gz\"\n\tTAR_FILENAME=\"${NAME}_${VERSION%*:}.tar.gz\"\n\n    # Find which style of diff they're using.\n\tif [ -f \"$VARLIB/apt/$DIST/$DIRNAME/$DEBTAR_FILENAME\" ]\n\tthen DIFF_FILENAME=${DEBTAR_FILENAME}\n\telse DIFF_FILENAME=${DIFFGZ_FILENAME}\n\tfi\n\n\t# Verify this package by ensuring the other necessary files are present.\n\t[ -f \"$VARLIB/apt/$DIST/$DIRNAME/$ORIG_FILENAME\" -a -f \"$VARLIB/apt/$DIST/$DIRNAME/$DIFF_FILENAME\" -o -f \"$VARLIB/apt/$DIST/$DIRNAME/$TAR_FILENAME\" ] || {\n\t\techo \"# [freight] skipping invalid Debian source package $PATHNAME\" >&2\n\t\treturn\n\t}\n\n\t# Create the architecture-parallel source directory and manifest.\n\tmkdir -p \"$DISTCACHE/$COMP/source\"\n\ttouch \"$DISTCACHE/$COMP/source/Sources\"\n\n\t# Link or copy this source package into this distro's `.refs` directory\n\t# if it isn't already there (which can happen when two packages derive\n\t# from the same original tarball).\n\tmkdir -p \"$DISTCACHE/.refs/$COMP\"\n\tfor FILENAME in \"$DSC_FILENAME\" \"$ORIG_FILENAME\" \"$DIFF_FILENAME\" \"$TAR_FILENAME\"\n\tdo\n        [ -f \"$VARLIB/apt/$DIST/$DIRNAME/$FILENAME\" ] || continue\n        [ -f \"$DISTCACHE/.refs/$COMP/$FILENAME\" ] ||\n        ln \"$VARLIB/apt/$DIST/$DIRNAME/$FILENAME\" \"$DISTCACHE/.refs/$COMP\" ||\n        cp \"$VARLIB/apt/$DIST/$DIRNAME/$FILENAME\" \"$DISTCACHE/.refs/$COMP\"\n\tdone\n\n\t# Package properties.  Remove the epoch from the version number\n\t# in the package filename, as is customary.\n\n\t# Link this source package into the pool.\n\tPOOL=\"pool/$DIST/$COMP/$(apt_prefix \"$NAME\")/$NAME\"\n\tmkdir -p \"$VARCACHE/$POOL\"\n\tfor FILENAME in \"$DSC_FILENAME\" \"$ORIG_FILENAME\" \"$DIFF_FILENAME\" \"$TAR_FILENAME\"\n\tdo\n\t\tif [ -f \"$DISTCACHE/.refs/$COMP/$FILENAME\" -a ! -f \"$VARCACHE/$POOL/$FILENAME\" ]\n\t\tthen\n\t\t\techo \"# [freight] adding $FILENAME to pool\" >&2\n\t\t\tln \"$DISTCACHE/.refs/$COMP/$FILENAME\" \"$VARCACHE/$POOL\"\n\t\tfi\n\tdone\n\n\t# Grab and augment the control fields from this source package.  Remove\n\t# and recalculate file checksums.  Change the `Source` field to `Package`.\n\t# Add the `Directory` field. Only do this if a cached copy does not exist.\n\tif [ \"$CACHE\" = \"on\" ]; then\n\t\tCONTROL=\"$VARLIB/apt/$DIST/$PATHNAME-cached\"\n\telse\n\t\tCONTROL=\"$TMP/source-control\"\n\tfi\n\tif ! [ -e \"$CONTROL\" ]; then\n\t\t{\n\t\t\tegrep \"^[A-Z][^:]+: .\" \"$VARLIB/apt/$DIST/$PATHNAME\" |\n\t\t\tegrep -v \"^(Version: GnuPG|Hash: )\" |\n\t\t\tsed \"s/^Source:/Package:/\"\n\t\t\techo \"Directory: DIRECTORY\"\n\t\t\techo \"Files:\"\n\t\t\tfor FILENAME in \"$DSC_FILENAME\" \"$ORIG_FILENAME\" \"$DIFF_FILENAME\" \"$TAR_FILENAME\"\n\t\t\tdo\n                [ -f \"$VARCACHE/$POOL/$FILENAME\" ] || continue\n\t\t\t\tSIZE=\"$(apt_filesize \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\tMD5=\"$(apt_md5 \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\techo \" $MD5 $SIZE $FILENAME\"\n\t\t\tdone\n\t\t\techo \"Checksums-Sha1:\"\n\t\t\tfor FILENAME in \"$DSC_FILENAME\" \"$ORIG_FILENAME\" \"$DIFF_FILENAME\" \"$TAR_FILENAME\"\n\t\t\tdo\n                [ -f \"$VARCACHE/$POOL/$FILENAME\" ] || continue\n\t\t\t\tSIZE=\"$(apt_filesize \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\tSHA1=\"$(apt_sha1 \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\techo \" $SHA1 $SIZE $FILENAME\"\n\t\t\tdone\n\t\t\techo \"Checksums-Sha256:\"\n\t\t\tfor FILENAME in \"$DSC_FILENAME\" \"$ORIG_FILENAME\" \"$DIFF_FILENAME\" \"$TAR_FILENAME\"\n\t\t\tdo\n                [ -f \"$VARCACHE/$POOL/$FILENAME\" ] || continue\n\t\t\t\tSIZE=\"$(apt_filesize \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\tSHA256=\"$(apt_sha256 \"$VARCACHE/$POOL/$FILENAME\")\"\n\t\t\t\techo \" $SHA256 $SIZE $FILENAME\"\n\t\t\tdone\n\t\t\techo\n\t\t} > \"$CONTROL\"\n\tfi\n\n\tsed \"s,^Directory: DIRECTORY$,Directory: $POOL,g\" \"$CONTROL\" |\n\ttee -a \"$DISTCACHE/$COMP/source/Sources\" >/dev/null\n\n# Clean up the tmp space\n\tif [ -f \"$TMP/source-control\" ]; then\n\t\trm \"$TMP/source-control\"\n\tfi\n\n}\n\n# Clean up old packages in the pool.\napt_clean() {\n\tfind \"$VARCACHE/pool\" -links 1 -delete || true\n}\n"
  },
  {
    "path": "lib/freight/conf.sh",
    "content": "# Freight configuration.\n\n# Default directories for the Freight library and Freight cache.  Your\n# web server's document root should be `$VARCACHE`.\nVARLIB=\"/var/lib/freight\"\nVARCACHE=\"/var/cache/freight\"\n\n# Default architectures.\nARCHS=\"i386 amd64\"\n\n# Default `Origin` and `Label` fields for `Release` files.\nORIGIN=\"Freight\"\nLABEL=\"Freight\"\n\nCACHE=\"off\"\n\nSYMLINKS=\"off\"\n\n# Source all existing configuration files from lowest- to highest-priority.\nPREFIX=\"$(dirname $(dirname $0))\"\nif [ \"$PREFIX\" = \"/usr\" ]\nthen [ -f \"/etc/freight.conf\" ] && . \"/etc/freight.conf\"\nelse [ -f \"$PREFIX/etc/freight.conf\" ] && . \"$PREFIX/etc/freight.conf\"\nfi\n[ -f \"$HOME/.freight.conf\" ] && . \"$HOME/.freight.conf\"\nDIRNAME=\"$PWD\"\nwhile true\ndo\n\t[ -f \"$DIRNAME/etc/freight.conf\" ] && . \"$DIRNAME/etc/freight.conf\" && break\n\t[ -f \"$DIRNAME/.freight.conf\" ] && . \"$DIRNAME/.freight.conf\" && break\n\t[ \"$DIRNAME\" = \"/\" ] && break\n\tDIRNAME=\"$(dirname \"$DIRNAME\")\"\ndone\n[ \"$FREIGHT_CONF\" -a -f \"$FREIGHT_CONF\" ] && . \"$FREIGHT_CONF\"\nif [ \"$CONF\" ]\nthen\n    if [ -f \"$CONF\" ]\n    then . \"$CONF\"\n    else\n        echo \"# [freight] $CONF does not exist\" >&2\n        exit 1\n    fi\nfi\n\n# Normalize directory names.\nVARLIB=${VARLIB%%/}\nVARCACHE=${VARCACHE%%/}\n"
  },
  {
    "path": "man/man1/freight-add.1",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\\-ADD\" \"1\" \"January 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\-add\\fR \\- add a package to Freight\n.\n.SH \"SYNOPSIS\"\n\\fBfreight add\\fR [\\fB\\-c\\fR \\fIconf\\fR] [\\fB\\-v\\fR] [\\fB\\-h\\fR] \\fIpackage\\fR \\fImanager\\fR/\\fIdistro\\fR[/\\fIcomponent\\fR][\\.\\.\\.]\n.\n.SH \"DESCRIPTION\"\n\\fBfreight\\-add\\fR registers \\fIpackage\\fR with one or more \\fImanager\\fR/\\fIdistro\\fR[/\\fIcomponent\\fR] pairs (or triples)\\. Currently, \\fBapt\\fR is the only supported \\fImanager\\fR and \\fIpackage\\fR must be one of \\fI*\\.deb\\fR, \\fI*\\.dsc *\\.debian\\.tar\\.gz *\\.orig\\.tar\\.gz\\fR, \\fI*\\.dsc *\\.diff\\.gz *\\.orig\\.tar\\.gz\\fR, or \\fI*\\.dsc *\\.tar\\.gz\\fR\\. \\fIdistro\\fR may be any arbitrary value but is best suited to naming a particular version of the target operating system (for example, \"wheezy\" or \"precise\")\\. \\fIcomponent\\fR is optional and for \\fBapt\\fR defaults to \\fBmain\\fR\\.\n.\n.P\nThe package files are organized in the Freight library so \\fBfreight\\-cache\\fR(1) has an easy time of creating package repositories for each \\fImanager\\fR/\\fIdistro\\fR[/\\fIcomponent\\fR] later\\.\n.\n.SH \"OPTIONS\"\n.\n.TP\n\\fB\\-c\\fR \\fIconf\\fR, \\fB\\-\\-conf=\\fR\\fIconf\\fR\nUse an alternate configuration file\\.\n.\n.TP\n\\fB\\-v\\fR, \\fB\\-\\-verbose\\fR\nVerbose mode\\.\n.\n.TP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\nShow a help message\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR, \\fI~/\\.freight\\.conf\\fR, \\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nThe default configuration files\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"ENVIRONMENT VARIABLES\"\n.\n.TP\n\\fBFREIGHT_CONF\\fR\nThe pathname of an alternate configuration file\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nRichard Crowley \\fIr@rcrowley\\.org\\fR\n.\n.SH \"SEE ALSO\"\nPart of \\fBfreight\\fR(1)\\.\n.\n.P\n\\fBfreight\\-cache\\fR(1) builds package repositories from the intermediate \"Freight library\" managed by \\fBfreight\\-add\\fR\\.\n"
  },
  {
    "path": "man/man1/freight-add.1.ronn",
    "content": "freight-add(1) -- add a package to Freight\n==========================================\n\n## SYNOPSIS\n\n`freight add` [`-c` _conf_] [`-v`] [`-h`] _package_ _manager_/_distro_[/_component_][...]  \n\n## DESCRIPTION\n\n`freight-add` registers _package_ with one or more _manager_/_distro_[/_component_] pairs (or triples).  Currently, `apt` is the only supported _manager_ and _package_ must be one of _\\*.deb_, _\\*.dsc \\*.debian.tar.gz \\*.orig.tar.gz_, _\\*.dsc \\*.diff.gz \\*.orig.tar.gz_, or _\\*.dsc \\*.tar.gz_.  _distro_ may be any arbitrary value but is best suited to naming a particular version of the target operating system (for example, \"wheezy\" or \"precise\").  _component_ is optional and for `apt` defaults to `main`.\n\nThe package files are organized in the Freight library so `freight-cache`(1) has an easy time of creating package repositories for each _manager_/_distro_[/_component_] later.\n\n## OPTIONS\n\n* `-c` _conf_, `--conf=`_conf_:\n  Use an alternate configuration file.\n* `-v`, `--verbose`:\n  Verbose mode.\n* `-h`, `--help`:\n  Show a help message.\n\n## FILES\n\n* _/etc/freight.conf_, _~/.freight.conf_, _etc/freight.conf_, _.freight.conf_:\n  The default configuration files.  See `freight`(5).\n\n## ENVIRONMENT VARIABLES\n\n* `FREIGHT_CONF`:\n  The pathname of an alternate configuration file.  See `freight`(5).\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nRichard Crowley <r@rcrowley.org>\n\n## SEE ALSO\n\nPart of `freight`(1).\n\n`freight-cache`(1) builds package repositories from the intermediate \"Freight library\" managed by `freight-add`.\n"
  },
  {
    "path": "man/man1/freight-cache.1",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\\-CACHE\" \"1\" \"January 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\-cache\\fR \\- (re)builds package repositories\n.\n.SH \"SYNOPSIS\"\n\\fBfreight cache\\fR [\\fB\\-k\\fR] [\\fB\\-g\\fR \\fIemail\\fR] [\\fB\\-p\\fR \\fIpassphrase file\\fR] [\\fB\\-c\\fR \\fIconf\\fR] [\\fB\\-v\\fR] [\\fB\\-h\\fR] [\\fImanager\\fR/\\fIdistro\\fR][\\.\\.\\.]\n.\n.SH \"DESCRIPTION\"\n\\fBfreight\\-cache\\fR converts each \\fImanager\\fR/\\fIdistro\\fR given into a package repository (only Debian archives are supported currently)\\. The \\fImanager\\fR indicates the type of repository (again, \\fBapt\\fR is the only supported value)\\. The \\fIdistro\\fR is an arbitrary string that should match a release of the target operating system (for example, \"lenny\" or \"lucid\")\\. If none are given, \\fBfreight\\-cache\\fR converts all \\fImanager\\fR/\\fIdistro\\fR pairs found in \\fB$VARLIB\\fR\\.\n.\n.P\nPackages are read from the Freight library (\\fB$VARLIB\\fR in the configuration, see \\fBfreight\\fR(5)) and organized into a working repository in the Freight cache (\\fB$VARCACHE\\fR in the configuration)\\.\n.\n.P\nServing the repositories is left as an exercise for the reader\\. The Freight cache is the only directory that needs to be exposed, so create a virtual host with \\fB$VARCACHE\\fR as its document root and everything will be fine\\.\n.\n.P\nFrom version 0\\.0\\.8 onwards, distros in an APT repository no longer share the contents of the \\fBpool/\\fR\\. After upgrading to this version and running \\fBfreight\\-cache\\fR for all your distros, it is safe and recommended to \\fBrm \\-rf $VARCACHE/pool/main\\fR to reset link counts to the proper value\\.\n.\n.SH \"OPTIONS\"\n.\n.TP\n\\fB\\-k\\fR, \\fB\\-\\-keep\\fR\nKeep unreferenced versions of packages\\. This is different than keeping multiple versions of a package in the repository, which is supported without any special options\\.\n.\n.TP\n\\fB\\-g\\fR \\fIemail\\fR, \\fB\\-\\-gpg=\\fR\\fIemail\\fR\nUse an alternate GPG key\\.\n.\n.TP\n\\fB\\-p\\fR \\fIpassphrase file\\fR, \\fB\\-\\-passphrase\\-file=\\fR\\fIpassphrase file\\fR\nUse an alternate file containing the GPG key passphrase\\. This file should obviously be protected and only readable by the user running Freight\\.\n.\n.TP\n\\fB\\-c\\fR \\fIconf\\fR, \\fB\\-\\-conf=\\fR\\fIconf\\fR\nUse an alternate configuration file\\.\n.\n.TP\n\\fB\\-v\\fR, \\fB\\-\\-verbose\\fR\nVerbose mode\\.\n.\n.TP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\nShow a help message\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR, \\fI~/\\.freight\\.conf\\fR, \\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nThe default configuration files\\. See \\fBfreight\\fR(5)\\.\n.\n.TP\n\\fI$VARCACHE\\fR\\fB/pubkey\\.gpg\\fR\nThe exported public key used for signing each release\\.\n.\n.SH \"ENVIRONMENT VARIABLES\"\n.\n.TP\n\\fBFREIGHT_CONF\\fR\nThe pathname of an alternate configuration file\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nRichard Crowley \\fIr@rcrowley\\.org\\fR\n.\n.SH \"SEE ALSO\"\nPart of \\fBfreight\\fR(1)\\.\n.\n.P\n\\fBfreight\\-add\\fR(1) adds packages to the intermediate \"Freight library\" that is used by \\fBfreight\\-cache\\fR to build the actual repositories\\.\n"
  },
  {
    "path": "man/man1/freight-cache.1.ronn",
    "content": "freight-cache(1) -- (re)builds package repositories\n===================================================\n\n## SYNOPSIS\n\n`freight cache` [`-k`] [`-g` _email_] [`-p` _passphrase file_] [`-c` _conf_] [`-v`] [`-h`] [_manager_/_distro_][...]  \n\n## DESCRIPTION\n\n`freight-cache` converts each _manager_/_distro_ given into a package repository (only Debian archives are supported currently).  The _manager_ indicates the type of repository (again, `apt` is the only supported value).  The _distro_ is an arbitrary string that should match a release of the target operating system (for example, \"lenny\" or \"lucid\").  If none are given, `freight-cache` converts all _manager_/_distro_ pairs found in `$VARLIB`.\n\nPackages are read from the Freight library (`$VARLIB` in the configuration, see `freight`(5)) and organized into a working repository in the Freight cache (`$VARCACHE` in the configuration).\n\nServing the repositories is left as an exercise for the reader.  The Freight cache is the only directory that needs to be exposed, so create a virtual host with `$VARCACHE` as its document root and everything will be fine.\n\nFrom version 0.0.8 onwards, distros in an APT repository no longer share the contents of the `pool/`.  After upgrading to this version and running `freight-cache` for all your distros, it is safe and recommended to `rm -rf $VARCACHE/pool/main` to reset link counts to the proper value.\n\n## OPTIONS\n\n* `-k`, `--keep`:\n  Keep unreferenced versions of packages.  This is different than keeping multiple versions of a package in the repository, which is supported without any special options.\n* `-g` _email_, `--gpg=`_email_:\n  Use an alternate GPG key.\n* `-p` _passphrase file_, `--passphrase-file=`_passphrase file_:\n  Use an alternate file containing the GPG key passphrase. This file should obviously be protected and only readable by the user running Freight.\n* `-c` _conf_, `--conf=`_conf_:\n  Use an alternate configuration file.\n* `-v`, `--verbose`:\n  Verbose mode.\n* `-h`, `--help`:\n  Show a help message.\n\n## FILES\n\n* _/etc/freight.conf_, _~/.freight.conf_, _etc/freight.conf_, _.freight.conf_:\n  The default configuration files.  See `freight`(5).\n* _$VARCACHE_`/pubkey.gpg`:\n  The exported public key used for signing each release.\n\n## ENVIRONMENT VARIABLES\n\n* `FREIGHT_CONF`:\n  The pathname of an alternate configuration file.  See `freight`(5).\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nRichard Crowley <r@rcrowley.org>\n\n## SEE ALSO\n\nPart of `freight`(1).\n\n`freight-add`(1) adds packages to the intermediate \"Freight library\" that is used by `freight-cache` to build the actual repositories.\n"
  },
  {
    "path": "man/man1/freight-clear-cache.1",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\\-CLEAR\\-CACHE\" \"1\" \"July 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\-clear\\-cache\\fR \\- clears existing package repositories\n.\n.SH \"SYNOPSIS\"\n\\fBfreight clear\\-cache\\fR [\\fB\\-c\\fR \\fIconf\\fR] [\\fB\\-v\\fR] [\\fB\\-h\\fR] [\\fImanager\\fR/\\fIdistro\\fR][\\.\\.\\.]\n.\n.SH \"DESCRIPTION\"\n\\fBfreight\\-clear\\-cache\\fR clears the cache generated during \\fBfreight\\-cache\\fR runs so that it can be regenerated on the next \\fBfreight\\-cache\\fR invocation\\.\n.\n.SH \"OPTIONS\"\n.\n.TP\n\\fB\\-c\\fR \\fIconf\\fR, \\fB\\-\\-conf=\\fR\\fIconf\\fR\nUse an alternate configuration file\\.\n.\n.TP\n\\fB\\-v\\fR, \\fB\\-\\-verbose\\fR\nVerbose mode\\.\n.\n.TP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\nShow a help message\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR, \\fI~/\\.freight\\.conf\\fR, \\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nThe default configuration files\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"ENVIRONMENT VARIABLES\"\n.\n.TP\n\\fBFREIGHT_CONF\\fR\nThe pathname of an alternate configuration file\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nRichard Crowley \\fIr@rcrowley\\.org\\fR\n.\n.SH \"SEE ALSO\"\nPart of \\fBfreight\\fR(1)\\.\n.\n.P\n\\fBfreight\\-cache\\fR(1) can be used to build the repository again\\.\n"
  },
  {
    "path": "man/man1/freight-clear-cache.1.ronn",
    "content": "freight-clear-cache(1) -- clears existing package repositories\n==============================================================\n\n## SYNOPSIS\n\n`freight clear-cache` [`-c` _conf_] [`-v`] [`-h`] [_manager_/_distro_][...]  \n\n## DESCRIPTION\n\n`freight-clear-cache` clears the cache generated during `freight-cache` runs so that it can be regenerated on the next `freight-cache` invocation.\n\n## OPTIONS\n\n* `-c` _conf_, `--conf=`_conf_:\n  Use an alternate configuration file.\n* `-v`, `--verbose`:\n  Verbose mode.\n* `-h`, `--help`:\n  Show a help message.\n\n## FILES\n\n* _/etc/freight.conf_, _~/.freight.conf_, _etc/freight.conf_, _.freight.conf_:\n  The default configuration files.  See `freight`(5).\n\n## ENVIRONMENT VARIABLES\n\n* `FREIGHT_CONF`:\n  The pathname of an alternate configuration file.  See `freight`(5).\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nRichard Crowley <r@rcrowley.org>\n\n## SEE ALSO\n\nPart of `freight`(1).\n\n`freight-cache`(1) can be used to build the repository again.\n"
  },
  {
    "path": "man/man1/freight-init.1",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\\-INIT\" \"1\" \"January 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\-init\\fR \\- initialize a Freight directory\n.\n.SH \"SYNOPSIS\"\n\\fBfreight init\\fR [\\fB\\-l\\fR \\fIvarlib\\fR] [\\fB\\-\\-cache\\fR \\fIvarcache\\fR] \\fB\\-g\\fR \\fIgpg\\fR \\fIdirname\\fR\n.\n.SH \"DESCRIPTION\"\n\\fBfreight\\-init\\fR will setup a directory to be used by Freight\\. It will generate small wrappers around the original Freight commands\\. Use \\fB\\./freight\\-add\\fR and \\fB\\./freight\\-cache\\fR to work against the \\fBVARLIB\\fR and \\fBVARCACHE\\fR given to \\fBfreight init\\fR\\.\n.\n.P\nThe benefit of using \\fBfreight\\-init\\fR is, that all data is stored in one place and dont have to pass \\fB\\-c _conf_\\fR option all the time\\.\n.\n.P\nConfiguration is stored in \\fB_dirname_/\\.freight\\.conf\\fR\\.\n.\n.SH \"OPTIONS\"\n.\n.TP\n\\fB\\-g\\fR \\fIgpg\\fR, \\fB\\-\\-gpg=\\fR\\fIgpg\\fR`\nGPG key\\.\n.\n.TP\n\\fB\\-l\\fR \\fIvarlib\\fR, \\fB\\-\\-varlib=\\fR\\fIvarlib\\fB_\\fR\\fR\nVARLIB directory to use\\. Defaults todirname_/lib`\n.\n.TP\n\\fB\\-\\-varcache=\\fR\\fIvarcache\\fB_\\fR\\fR\nVARCACHE directory to use\\. Defaults todirname_/cache`\n.\n.TP\n\\fB\\-v\\fR, \\fB\\-\\-verbose\\fR\nVerbose mode\\.\n.\n.TP\n\\fB\\-h\\fR, \\fB\\-\\-help\\fR\nShow a help message\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR, \\fI~/\\.freight\\.conf\\fR, \\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nThe default configuration files\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nJens Braeuer \\fIbraeuer\\.jens@googlemail\\.com\\fR\n.\n.SH \"SEE ALSO\"\nPart of \\fBfreight\\fR(1)\\.\n"
  },
  {
    "path": "man/man1/freight-init.1.ronn",
    "content": "freight-init(1) -- initialize a Freight directory\n=================================================\n\n## SYNOPSIS\n\n`freight init` [`-l` _varlib_] [`--cache` _varcache_] `-g` _gpg_ _dirname_\n\n## DESCRIPTION\n\n`freight-init` will setup a directory to be used by Freight.  It will generate small wrappers around the original Freight commands.  Use `./freight-add` and `./freight-cache` to work against the `VARLIB` and `VARCACHE` given to `freight init`.\n\nThe benefit of using `freight-init` is, that all data is stored in one place and dont have to pass `-c _conf_` option all the time.\n\nConfiguration is stored in `_dirname_/.freight.conf`.\n\n## OPTIONS\n\n* `-g` _gpg_, `--gpg=`_gpg_`:\n  GPG key.\n* `-l` _varlib_, `--varlib=`_varlib`_:\n  VARLIB directory to use.  Defaults to `_dirname_/lib`\n* `--varcache=`_varcache`_:\n  VARCACHE directory to use.  Defaults to `_dirname_/cache`\n* `-v`, `--verbose`:\n  Verbose mode.\n* `-h`, `--help`:\n  Show a help message.\n\n## FILES\n\n* _/etc/freight.conf_, _~/.freight.conf_, _etc/freight.conf_, _.freight.conf_:\n  The default configuration files.  See `freight`(5).\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nJens Braeuer <braeuer.jens@googlemail.com>\n\n## SEE ALSO\n\nPart of `freight`(1).\n"
  },
  {
    "path": "man/man1/freight.1",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\" \"1\" \"January 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\fR \\- a modern take on the Debian archive\n.\n.SH \"SYNOPSIS\"\n\\fBfreight\\fR \\fIcommand\\fR [\\fI\\.\\.\\.\\fR]\n.\n.SH \"DESCRIPTION\"\n\\fBfreight\\fR programs create the files needed to serve a Debian archive\\. The actual serving is done via your favorite HTTP server\\.\n.\n.TP\n\\fBfreight\\-add\\fR(1)\nAdd a package to Freight\\.\n.\n.TP\n\\fBfreight\\-cache\\fR(1)\n(Re)builds package repositories\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR, \\fI~/\\.freight\\.conf\\fR, \\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nThe default configuration files\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"ENVIRONMENT VARIABLES\"\n.\n.TP\n\\fBFREIGHT_CONF\\fR\nThe pathname of an alternate configuration file\\. See \\fBfreight\\fR(5)\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nRichard Crowley \\fIr@rcrowley\\.org\\fR\n.\n.SH \"SEE ALSO\"\n\\fBreprepro\\fR(1) manages Debian archives, too, if Freight isn\\'t your thing\\.\n"
  },
  {
    "path": "man/man1/freight.1.ronn",
    "content": "freight(1) -- a modern take on the Debian archive\n=================================================\n\n## SYNOPSIS\n\n`freight` _command_ [_..._]  \n\n## DESCRIPTION\n\n`freight` programs create the files needed to serve a Debian archive.  The actual serving is done via your favorite HTTP server.\n\n* `freight-add`(1):\n  Add a package to Freight.\n* `freight-cache`(1):\n  (Re)builds package repositories.\n\n## FILES\n\n* _/etc/freight.conf_, _~/.freight.conf_, _etc/freight.conf_, _.freight.conf_:\n  The default configuration files.  See `freight`(5).\n\n## ENVIRONMENT VARIABLES\n\n* `FREIGHT_CONF`:\n  The pathname of an alternate configuration file.  See `freight`(5).\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nRichard Crowley <r@rcrowley.org>\n\n## SEE ALSO\n\n`reprepro`(1) manages Debian archives, too, if Freight isn't your thing.\n"
  },
  {
    "path": "man/man5/freight.5",
    "content": ".\\\" generated with Ronn/v0.7.3\n.\\\" http://github.com/rtomayko/ronn/tree/0.7.3\n.\n.TH \"FREIGHT\" \"5\" \"January 2014\" \"\" \"Freight\"\n.\n.SH \"NAME\"\n\\fBfreight\\fR \\- Freight configuration\n.\n.SH \"DESCRIPTION\"\nThe Freight configuration is a \\fBsource\\fRd shell script that defines a few important variables\\.\n.\n.SH \"OPTIONS\"\n.\n.TP\n\\fBVARLIB\\fR\nThe Freight library directory\\. Typically \\fI/var/lib/freight\\fR\\.\n.\n.TP\n\\fBVARCACHE\\fR\nThe Freight cache directory\\. Typically \\fI/var/cache/freight\\fR\\. This should be the document root of the web server\\.\n.\n.TP\n\\fBARCHS\\fR\nThe architectures to support\\. Typically \\fIi386 amd64\\fR\\.\n.\n.TP\n\\fBORIGIN\\fR\nThe \\fBOrigin\\fR field in the Debian archive\\.\n.\n.TP\n\\fBLABEL\\fR\nThe \\fBLabel\\fR field in the Debian archive\\.\n.\n.TP\n\\fBCACHE\\fR\n\\fIon\\fR to cache package control files or \\fIoff\\fR to read them from the packages on each \\fBfreight\\-cache\\fR(1) run\\.\n.\n.TP\n\\fBGPG\\fR\nThe GPG key to use\\. This value must be set either in a configuration file or by using the \\fB\\-g\\fR option to \\fBfreight\\-cache\\fR(1)\\.\n.\n.TP\n\\fBGPG_PASSPHRASE_FILE\\fR\nPathname of a file containing the GPGP private key\\'s passphrase\\. This sets the \\fB\\-\\-passphrase\\-fd\\fR and \\fB\\-\\-passphrase\\-file\\fR options to \\fBgpg\\fR(1)\\. The passphrase file can be set either in a configuration file or by using the \\fB\\-p\\fR option to \\fBfreight\\-cache\\fR(1)\\.\n.\n.TP\n\\fBSYMLINKS\\fR\n\\fIon\\fR to follow symbolic links in \\fBVARLIB\\fR to produce extra components in the cache directory or \\fIoff\\fR to offer no special treatment\\.\n.\n.SH \"FILES\"\n.\n.TP\n\\fI/etc/freight\\.conf\\fR\nThe default configuration file\\.\n.\n.TP\n\\fI~/\\.freight\\.conf\\fR\nUser\\-specific configuration file\\.\n.\n.TP\n\\fIetc/freight\\.conf\\fR, \\fI\\.freight\\.conf\\fR\nDirectory\\-specific configuration files\\.\n.\n.SH \"ENVIRONMENT VARIABLES\"\n.\n.TP\n\\fBFREIGHT_CONF\\fR\nThe pathname of an alternate configuration file\\.\n.\n.SH \"THEME SONG\"\nThe New Pornographers \\- \"All the Old Showstoppers\"\n.\n.SH \"AUTHOR\"\nRichard Crowley \\fIr@rcrowley\\.org\\fR\n.\n.SH \"SEE ALSO\"\n\\fBfreight\\-add\\fR(1) adds packages to the intermediate \"Freight library\" that is used by \\fBfreight\\-cache\\fR(1) to build the actual repositories\\.\n.\n.P\n\\fBreprepro\\fR(1) manages Debian archives, too, if Freight isn\\'t your thing\\.\n"
  },
  {
    "path": "man/man5/freight.5.ronn",
    "content": "freight(5) -- Freight configuration\n===================================\n\n## DESCRIPTION\n\nThe Freight configuration is a `source`d shell script that defines a few important variables.\n\n## OPTIONS\n\n* `VARLIB`:\n  The Freight library directory.  Typically _/var/lib/freight_.\n* `VARCACHE`:\n  The Freight cache directory.  Typically _/var/cache/freight_.  This should be the document root of the web server.\n* `ARCHS`:\n  The architectures to support.  Typically _i386 amd64_.\n* `ORIGIN`:\n  The `Origin` field in the Debian archive.\n* `LABEL`:\n  The `Label` field in the Debian archive.\n* `CACHE`:\n  _on_ to cache package control files or _off_ to read them from the packages on each `freight-cache`(1) run.\n* `GPG`:\n  The GPG key to use.  This value must be set either in a configuration file or by using the `-g` option to `freight-cache`(1).\n* `GPG_PASSPHRASE_FILE`:\n  Pathname of a file containing the GPGP private key's passphrase.  This sets the `--passphrase-fd` and `--passphrase-file` options to `gpg`(1).  The passphrase file can be set either in a configuration file or by using the `-p` option to `freight-cache`(1).\n* `SYMLINKS`:\n  _on_ to follow symbolic links in `VARLIB` to produce extra components in the cache directory or _off_ to offer no special treatment.\n\n## FILES\n\n* _/etc/freight.conf_:\n  The default configuration file.\n* _~/.freight.conf_:\n  User-specific configuration file.\n* _etc/freight.conf_, _.freight.conf_:\n  Directory-specific configuration files.\n\n## ENVIRONMENT VARIABLES\n\n* `FREIGHT_CONF`:\n  The pathname of an alternate configuration file.\n\n## THEME SONG\n\nThe New Pornographers - \"All the Old Showstoppers\"\n\n## AUTHOR\n\nRichard Crowley <r@rcrowley.org>\n\n## SEE ALSO\n\n`freight-add`(1) adds packages to the intermediate \"Freight library\" that is used by `freight-cache`(1) to build the actual repositories.\n\n`reprepro`(1) manages Debian archives, too, if Freight isn't your thing.\n"
  }
]