nixpkgs/pkgs/by-name/qb/qbe/001-dont-hardcode-tmp.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
965 B
Diff

diff --git a/minic/mcc b/minic/mcc
index 492947e..5258aac 100755
--- a/minic/mcc
+++ b/minic/mcc
@@ -31,9 +31,9 @@ then
fi
-$DIR/minic < $file > /tmp/minic.ssa &&
-$QBE < /tmp/minic.ssa > /tmp/minic.s &&
-cc /tmp/minic.s $flags
+$DIR/minic < $file > ${TMPDIR:-/tmp}/minic.ssa &&
+$QBE < ${TMPDIR:-/tmp}/minic.ssa > ${TMPDIR:-/tmp}/minic.s &&
+cc ${TMPDIR:-/tmp}/minic.s $flags
if test $? -ne 0
then
diff --git a/tools/cra.sh b/tools/cra.sh
index 5988267..57a4b34 100755
--- a/tools/cra.sh
+++ b/tools/cra.sh
@@ -2,7 +2,7 @@
DIR=`cd $(dirname "$0"); pwd`
QBE=$DIR/../qbe
-BUGF=/tmp/bug.id
+BUGF=${TMPDIR:-/tmp}/bug.id
FIND=$1
FIND=${FIND:-afl-find}
diff --git a/tools/test.sh b/tools/test.sh
index 23c6663..fb36222 100755
--- a/tools/test.sh
+++ b/tools/test.sh
@@ -4,7 +4,7 @@ dir=`dirname "$0"`
bin=$dir/../qbe
binref=$dir/../qbe.ref
-tmp=/tmp/qbe.zzzz
+tmp=${TMPDIR:-/tmp}/qbe.zzzz
drv=$tmp.c
asm=$tmp.s