Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# Copyright © 2020-2022 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
From 4313d3755a182cf6dc5ca526549ecb5cd140fde5 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Mon, 26 Oct 2020 13:27:55 +0000
Subject: [PATCH] _v2-entry-point: Check whether launch_args is empty before
use
In newer versions of bash, an empty array counts as having been set,
and can be dereferenced as `"${array[@]}"` without triggering `set -u`.
However, in older versions, empty arrays count as being unset, and the
entry point script fails with `launch_args[@]: unbound variable`.
@smcv
smcv / gist:53a18b52a7ee9340ff18c15d048fbc13
Created May 2, 2018 12:18 — forked from TTimo/gist:267db48c0f20b06c6be1dfd05cd9ff56
File descriptor redirections and capture magic
#!/usr/bin/env python
# python 2.7 and >= 3.4 supported
from __future__ import print_function
import sys
if (sys.version_info < (3, 0)):
assert(sys.version_info >= (2, 7))
else:
@smcv
smcv / open-build-server-tests.md
Last active August 29, 2015 13:56
making open-build-service able to run its tests