Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryan Drewery bdrewery

View GitHub Profile
View git-fossil.sh
#! /bin/sh
# :vim setf sh:
#
# Copyright (c) 2013 Bryan Drewery <bryan@shatow.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
View bsd.alt.mk
DEFAULT_VERSIONS+= znc=1.6
# XXX: All the symlinks on the main files should be done via a script and the
# port should supply ALT_FILES via PKG_NOTES.
# Port configuration
ALT_VER_EPOCH= 14
ALT_FILES+= \
bin/znc bin/znc${ALT_VER} \
View split-package\Uses.local\split-package.sh
#! /bin/sh
. ${SCRIPTSDIR}/functions.sh
MOVE_FILES=$(mktemp -t tar_files)
PLIST_FILES=$(mktemp -t plist_files)
PLIST_DIRS=/dev/null
SED_FILE=$(mktemp -t sed_file)
PARSE_COMMENTS=1
parse_plist "${PREFIX}" ${PARSE_COMMENTS} < "${TMPPLIST}" 3>${PLIST_DIRS} \
@bdrewery
bdrewery / convert.sh
Created Apr 12, 2014
pkg_install conversion script
View convert.sh
#! /bin/sh
#
# Copyright (c) 2014 Bryan Drewery <bdrewery@FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@bdrewery
bdrewery / mfc.sh
Last active Jun 25, 2018
FreeBSD MFC script
View mfc.sh
#! /bin/sh
#
# Copyright (c) 2014 Bryan Drewery <bdrewery@FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
View keybase.md

Keybase proof

I hereby claim:

  • I am bdrewery on github.
  • I am bdrewery (https://keybase.io/bdrewery) on keybase.
  • I have a public key whose fingerprint is F917 3CB2 C3AA EA7A 5C8A 1F09 35D7 71BB 6E46 97CF

To claim this, I am signing this object:

@bdrewery
bdrewery / bulk.sh
Last active Jul 6, 2018
Hook to upload packages to S3 after bulk is successful.
View bulk.sh
#! /bin/sh
#
# Copyright (c) 2013-2014 Bryan Drewery <bdrewery@FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@bdrewery
bdrewery / poudriere-irc.sh
Last active Oct 19, 2018
IRC bot written in POSIX Shell using netcat
View poudriere-irc.sh
#! /bin/sh
#
# Copyright (c) 2013 Bryan Drewery <bdrewery@FreeBSD.org>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
@bdrewery
bdrewery / gist:6479394
Last active Dec 22, 2015
Poudriere atomic repository updating
View gist:6479394

This allows for atomic package repository updates and dry-runs. It will allow the repository to be usable during a package build session without a wrapper to do symlinks with latest or clones etc.

  1. On first build, repository is converted to symlinked structure
  2. On build startup, all of .real is hardlink-copied to .shadow
  3. Package building treats .shadow as the PACKAGES directory
  4. Because the top-level files and directories are symlinked to .real, the build leaves all existing files alone during the build. Hardlinks are safe as package building only overwrites. The repo files are explicitly copied to prevent accidental incremental updates to the production repo.
  5. Once build completes, the top-level .shadow is renamed to .real_TIMESTAMP and the .current symlink is atomically moved to the new package directory.

View during build

@bdrewery
bdrewery / be-upgrade.sh
Last active Dec 17, 2015
FreeBSD beadm upgrade script (requires sysutils/beadm)
View be-upgrade.sh
#! /bin/sh
#
# Copyright (c) 2013 Bryan Drewery <bryan@shatow.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
You can’t perform that action at this time.