Skip to content

Commit

Permalink
Merge branch '0.29.1-prep' into release-0.29.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ag-eitilt committed Nov 28, 2022
2 parents 371fdfe + 8911c07 commit b0f6de0
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 12 deletions.
8 changes: 7 additions & 1 deletion debian/changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ wake (@VERSION@-1) unstable; urgency=medium

* Auto-generated release package.

-- Sam May <[email protected]> Mon, 21 Nov 2022 12:10:34 -0800
-- Sam May <[email protected]> Mon, 28 Nov 2022 14:53:04 -0800

wake (0.29.0-1) unstable; urgency=medium

* Auto-generated release package.

-- Sam May <[email protected]> Fri, 18 Nov 2022 11:51:35 -0800

wake (0.28.5-1) unstable; urgency=medium

Expand Down
29 changes: 20 additions & 9 deletions share/wake/lib/system/incremental.wake
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,26 @@ target tarExe Unit =
if gnutar ==* "gnutar" then which "tar" else gnutar

def targz output paths =
def cmd =
# Intentionally record mtime in ns (posix) => needed for incremental builds
tarExe Unit, "--numeric-owner", "--owner=0", "--group=0", "--format=posix", "-czf",
output, map getPathName paths | sortBy scmp
makeExecPlan cmd paths
| setPlanLocalOnly True
| setPlanFnOutputs (\_ output, Nil)
| runJobWith localRunner
| getJobOutput
require Pass fileList =
def fileListPath =
replace `\.tar\.gz` ".F" output
map getPathName paths
| sortBy scmp
| catWith "\n"
| write fileListPath
def script =
"""
# Intentionally record mtime in ns (posix) => needed for incremental builds
%{tarExe Unit} --numeric-owner --owner=0 --group=0 --format=posix -czf %{output}.tmp -T %{fileList.getPathName} && \
mv %{output}.tmp %{output}
"""
require Pass tar =
makePlan "incremental snapshot: {output}" paths script
| setPlanLocalOnly True
| setPlanFnOutputs (\_ output, Nil)
| runJobWith localRunner
| getJobOutput
Pass tar

# This API allows a Job to access those outputs from its last invocation
# which are accepted by reusedOutputFilterFn. To use this method, you must
Expand Down
Empty file.
5 changes: 5 additions & 0 deletions tests/command-line/clean/pass.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#! /bin/sh
WAKE="${1:+$1/wake}"
"${WAKE:-wake}" -q --init .
"${WAKE:-wake}" -q -x 'write "bug" ""'
"${WAKE:-wake}" --clean
Empty file added tests/command-line/clean/stdout
Empty file.
18 changes: 16 additions & 2 deletions tools/wake/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,22 @@ int main(int argc, char **argv) {

// Delete all the files
for (const auto &path : paths) {
// Don't delete the root directory
// - Certain writes will create the parent dir "." which shouldn't be deleted
if (path == ".") {
continue;
}

// First we try to unlink the file
if (unlink(path.c_str()) == -1) {
#if defined(__linux__)
bool is_dir = (errno == EISDIR);
#else
bool is_dir = (errno == EPERM || errno == EACCES);
#endif

// If it was actually a directory we remove it instead
if (errno == EISDIR) {
if (is_dir) {
if (rmdir(path.c_str()) == -1) {
if (errno == ENOTEMPTY) continue;
std::cerr << "error: rmdir(" << path << "): " << strerror(errno) << std::endl;
Expand All @@ -463,8 +475,10 @@ int main(int argc, char **argv) {
continue;
}

// If it wasn't a directory then we fail
// If the entry doesn't exist then nothing to delete
if (errno == ENOENT) continue;

// If it wasn't a directory then we fail
std::cerr << "error: unlink(" << path << "): " << strerror(errno) << std::endl;
return 1;
}
Expand Down

0 comments on commit b0f6de0

Please sign in to comment.