╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ update_netbsd_libc.zig ───────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
26 std.log.err("unable to open destination directory '{s}': {t}", .{ dest_dir_path, err }); 27 std.process.exit(1); 28 }; 29 defer dest_dir.close(io); 30 31 var netbsd_src_dir = try Io.Dir.cwd().openDir(io, netbsd_src_path, .{}); 32 defer netbsd_src_dir.close(io); 33 34 // Copy updated files from upstream. 35 { 36 var walker = try dest_dir.walk(arena); 37 defer walker.deinit(); 38 39 walk: while (try walker.next(io)) |entry| { 40 if (entry.kind != .file) continue; 41 if (std.mem.startsWith(u8, entry.basename, ".")) continue; 42 for (exempt_files) |p| { 43 if (std.mem.eql(u8, entry.path, p)) continue :walk; 44 } 45 46 std.log.info("updating '{s}/{s}' from '{s}/{s}'", .{ 47 dest_dir_path, entry.path, 48 netbsd_src_path, entry.path, 49 }); 50 51 netbsd_src_dir.copyFile(entry.path, dest_dir, entry.path, io, .{}) catch |err| { 52 std.log.warn("unable to copy '{s}/{s}' to '{s}/{s}': {t}", .{ 53 netbsd_src_path, entry.path, dest_dir_path, entry.path, err, 54 }); 55 if (err == error.FileNotFound) { 56 try dest_dir.deleteFile(io, entry.path); 57 } 58 }; 59 } 60 } 61 } 62