-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libindex: update and document file placement logic
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//go:build !unix | ||
|
||
package libindex | ||
|
||
// FixTemp is a no-op. | ||
func fixTemp(_ *string) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package libindex | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
// FixTemp modifies "dir" according to the documented defaults. | ||
// | ||
// See [NewRemoteFetchArena]. | ||
func fixTemp(dir *string) { | ||
if *dir != "" { | ||
return | ||
} | ||
if d, ok := os.LookupEnv("TMPDIR"); ok && d != "" { | ||
*dir = d | ||
return | ||
} | ||
*dir = "/var/tmp" | ||
} |