← Commit list

17908bf76

Denys Vlasenko
Denys Vlasenko
2026-07-14
SUCCESS Duration: 149s

Subject

cp: accept --sparse=ANYTHING

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

coreutils/cp.c+15 -0
@@ -29,6 +29,11 @@
//config: bool "Enable --reflink[=auto]"
//config: default y
//config: depends on FEATURE_CP_LONG_OPTIONS
+//config:
+//config:config FEATURE_CP_SPARSE
+//config: bool "Enable --sparse=WHEN"
+//config: default y
+//config: depends on FEATURE_CP_LONG_OPTIONS
//applet:IF_CP(APPLET_NOEXEC(cp, cp, BB_DIR_BIN, BB_SUID_DROP, cp))
/* NOEXEC despite cases when it can be a "runner" (cp -r LARGE_DIR NEW_DIR) */
@@ -129,6 +134,9 @@ int cp_main(int argc, char **argv)
};
# if ENABLE_FEATURE_CP_REFLINK
char *reflink = NULL;
+# endif
+# if ENABLE_FEATURE_CP_SPARSE
+ char *sparse = NULL;
# endif
flags = getopt32long(argv, "^"
FILEUTILS_CP_OPTSTR
@@ -158,10 +166,17 @@ int cp_main(int argc, char **argv)
"parents\0" No_argument "\xfe"
# if ENABLE_FEATURE_CP_REFLINK
"reflink\0" Optional_argument "\xfd"
+# endif
+# if ENABLE_FEATURE_CP_SPARSE
+ "sparse\0" Optional_argument "\xfc"
# endif
, &last
# if ENABLE_FEATURE_CP_REFLINK
, &reflink
+# endif
+# if ENABLE_FEATURE_CP_SPARSE
+ // NOP for now
+ , &sparse
# endif
);
# if ENABLE_FEATURE_CP_REFLINK