diff --git a/generator/GObject.ml b/generator/GObject.ml index eada33cee..cb96eb9cb 100644 --- a/generator/GObject.ml +++ b/generator/GObject.ml @@ -1118,9 +1118,11 @@ guestfs_session_close (GuestfsSession *session, GError **err) ); pr "\n"; (match deprecated_by with - | None -> () - | Some alt -> + | Not_deprecated -> () + | Replaced_by alt -> pr " * Deprecated: In new code, use guestfs_session_%s() instead\n" alt + | Deprecated_no_replacement -> + pr " * Deprecated: There is no documented replacement\n" ); (match version_added f with | None -> () diff --git a/generator/OCaml.ml b/generator/OCaml.ml index 083e50530..40fd9454f 100644 --- a/generator/OCaml.ml +++ b/generator/OCaml.ml @@ -186,10 +186,13 @@ end opt ); (match f.deprecated_by with - | None -> () - | Some replacement -> + | Not_deprecated -> () + | Replaced_by replacement -> has_tags := true; pr "\n\n @deprecated Use {!%s} instead" replacement + | Deprecated_no_replacement -> + has_tags := true; + pr "\n\n @deprecated There is no documented replacement" ); (match version_added f with | None -> () diff --git a/generator/actions_core_deprecated.ml b/generator/actions_core_deprecated.ml index b8cca791b..5d13187ea 100644 --- a/generator/actions_core_deprecated.ml +++ b/generator/actions_core_deprecated.ml @@ -28,7 +28,7 @@ let non_daemon_functions = [ name = "wait_ready"; added = (0, 0, 3); style = RErr, [], []; visibility = VStateTest; - deprecated_by = Some "launch"; + deprecated_by = Deprecated_no_replacement; blocking = false; shortdesc = "wait until the hypervisor launches (no op)"; longdesc = "\ @@ -46,7 +46,7 @@ versions of the API." }; { defaults with name = "kill_subprocess"; added = (0, 0, 3); style = RErr, [], []; - deprecated_by = Some "shutdown"; + deprecated_by = Replaced_by "shutdown"; shortdesc = "kill the hypervisor"; longdesc = "\ This kills the hypervisor. @@ -56,7 +56,7 @@ Do not call this. See: C instead." }; { defaults with name = "add_cdrom"; added = (0, 0, 3); style = RErr, [String "filename"], []; - deprecated_by = Some "add_drive_ro"; config_only = true; + deprecated_by = Replaced_by "add_drive_ro"; config_only = true; blocking = false; shortdesc = "add a CD-ROM disk image to examine"; longdesc = "\ @@ -68,7 +68,7 @@ of C." }; { defaults with name = "add_drive_with_if"; added = (1, 0, 84); style = RErr, [String "filename"; String "iface"], []; - deprecated_by = Some "add_drive"; config_only = true; + deprecated_by = Replaced_by "add_drive"; config_only = true; blocking = false; shortdesc = "add a drive specifying the QEMU block emulation to use"; longdesc = "\ @@ -79,7 +79,7 @@ to specify the QEMU interface emulation to use at run time." }; name = "add_drive_ro_with_if"; added = (1, 0, 84); style = RErr, [String "filename"; String "iface"], []; blocking = false; - deprecated_by = Some "add_drive"; config_only = true; + deprecated_by = Replaced_by "add_drive"; config_only = true; shortdesc = "add a drive read-only specifying the QEMU block emulation to use"; longdesc = "\ This is the same as C but it allows you @@ -88,7 +88,7 @@ to specify the QEMU interface emulation to use at run time." }; { defaults with name = "lstatlist"; added = (1, 0, 77); style = RStructList ("statbufs", "stat"), [Pathname "path"; FilenameList "names"], []; - deprecated_by = Some "lstatnslist"; + deprecated_by = Replaced_by "lstatnslist"; shortdesc = "lstat on multiple files"; longdesc = "\ This call allows you to perform the C operation @@ -108,7 +108,7 @@ for getting extended attributes." }; { defaults with name = "stat"; added = (1, 9, 2); style = RStruct ("statbuf", "stat"), [Pathname "path"], []; - deprecated_by = Some "statns"; + deprecated_by = Replaced_by "statns"; tests = [ InitISOFS, Always, TestResult ( [["stat"; "/empty"]], "ret->size == 0"), [] @@ -122,7 +122,7 @@ This is the same as the L system call." }; { defaults with name = "lstat"; added = (1, 9, 2); style = RStruct ("statbuf", "stat"), [Pathname "path"], []; - deprecated_by = Some "lstatns"; + deprecated_by = Replaced_by "lstatns"; tests = [ InitISOFS, Always, TestResult ( [["lstat"; "/empty"]], "ret->size == 0"), [] @@ -145,7 +145,7 @@ let daemon_functions = [ style = RErr, [Device "device"; Int "cyls"; Int "heads"; Int "sectors"; StringList "lines"], []; - deprecated_by = Some "part_add"; + deprecated_by = Replaced_by "part_add"; shortdesc = "create partitions on a block device"; longdesc = "\ This is a direct interface to the L program for creating @@ -174,7 +174,7 @@ C" }; { defaults with name = "blockdev_setbsz"; added = (1, 9, 3); style = RErr, [Device "device"; Int "blocksize"], []; - deprecated_by = Some "mkfs"; + deprecated_by = Deprecated_no_replacement; shortdesc = "set blocksize of block device"; longdesc = "\ This call does nothing and has never done anything @@ -186,7 +186,7 @@ C option of C." }; { defaults with name = "tgz_in"; added = (1, 0, 3); style = RErr, [FileIn "tarball"; Pathname "directory"], []; - deprecated_by = Some "tar_in"; + deprecated_by = Replaced_by "tar_in"; cancellable = true; tests = [ InitScratchFS, Always, TestResultString ( @@ -202,7 +202,7 @@ I tar file) into F." }; { defaults with name = "tgz_out"; added = (1, 0, 3); style = RErr, [Pathname "directory"; FileOut "tarball"], []; - deprecated_by = Some "tar_out"; + deprecated_by = Replaced_by "tar_out"; cancellable = true; shortdesc = "pack directory into compressed tarball"; longdesc = "\ @@ -212,7 +212,7 @@ it to local file C." }; { defaults with name = "set_e2label"; added = (1, 0, 15); style = RErr, [Device "device"; String "label"], []; - deprecated_by = Some "set_label"; + deprecated_by = Replaced_by "set_label"; tests = [ InitBasicFS, Always, TestResultString ( [["set_e2label"; "/dev/sda1"; "testlabel"]; @@ -230,7 +230,7 @@ to return the existing label on a filesystem." }; { defaults with name = "get_e2label"; added = (1, 0, 15); style = RString "label", [Device "device"], []; - deprecated_by = Some "vfs_label"; + deprecated_by = Replaced_by "vfs_label"; shortdesc = "get the ext2/3/4 filesystem label"; longdesc = "\ This returns the ext2/3/4 filesystem label of the filesystem on @@ -239,7 +239,7 @@ C." }; { defaults with name = "set_e2uuid"; added = (1, 0, 15); style = RErr, [Device "device"; String "uuid"], []; - deprecated_by = Some "set_uuid"; + deprecated_by = Replaced_by "set_uuid"; tests = [ InitBasicFS, Always, TestResultString ( [["set_e2uuid"; "/dev/sda1"; stable_uuid]; @@ -267,7 +267,7 @@ of a filesystem." }; { defaults with name = "get_e2uuid"; added = (1, 0, 15); style = RString "uuid", [Device "device"], []; - deprecated_by = Some "vfs_uuid"; + deprecated_by = Replaced_by "vfs_uuid"; tests = [ (* We can't predict what UUID will be, so just check the command run; regression test for RHBZ#597112. *) @@ -285,7 +285,7 @@ C." }; style = RErr, [Device "device"; Int "partnum"; Int "cyls"; Int "heads"; Int "sectors"; String "line"], []; - deprecated_by = Some "part_add"; + deprecated_by = Replaced_by "part_add"; shortdesc = "modify a single partition on a block device"; longdesc = "\ This runs L option to modify just the single @@ -299,7 +299,7 @@ See also: C" }; { defaults with name = "sfdisk_l"; added = (1, 0, 26); style = RString "partitions", [Device "device"], []; - deprecated_by = Some "part_list"; + deprecated_by = Replaced_by "part_list"; shortdesc = "display the partition table"; longdesc = "\ This displays the partition table on C, in the @@ -311,7 +311,7 @@ See also: C" }; { defaults with name = "e2fsck_f"; added = (1, 0, 29); style = RErr, [Device "device"], []; - deprecated_by = Some "e2fsck"; + deprecated_by = Replaced_by "e2fsck"; shortdesc = "check an ext2/ext3 filesystem"; longdesc = "\ This runs C, ie. runs the ext2/ext3 @@ -321,7 +321,7 @@ even if the filesystem appears to be clean (I<-f>)." }; { defaults with name = "mkswap_L"; added = (1, 0, 55); style = RErr, [String "label"; Device "device"], []; - deprecated_by = Some "mkswap"; + deprecated_by = Replaced_by "mkswap"; tests = [ InitEmpty, Always, TestRun ( [["part_disk"; "/dev/sda"; "mbr"]; @@ -338,7 +338,7 @@ a limitation of the kernel or swap tools." }; { defaults with name = "mkswap_U"; added = (1, 0, 55); style = RErr, [String "uuid"; Device "device"], []; - deprecated_by = Some "mkswap"; + deprecated_by = Replaced_by "mkswap"; optional = Some "linuxfsuuid"; tests = [ InitEmpty, Always, TestRun ( @@ -352,7 +352,7 @@ Create a swap partition on C with UUID C." }; { defaults with name = "sfdiskM"; added = (1, 0, 55); style = RErr, [Device "device"; StringList "lines"], []; - deprecated_by = Some "part_add"; + deprecated_by = Replaced_by "part_add"; shortdesc = "create partitions on a block device"; longdesc = "\ This is a simplified interface to the C @@ -367,7 +367,7 @@ and C" }; { defaults with name = "zfile"; added = (1, 0, 59); style = RString "description", [String "meth"; Pathname "path"], []; - deprecated_by = Some "file"; + deprecated_by = Replaced_by "file"; shortdesc = "determine file type inside a compressed file"; longdesc = "\ This command runs F after first decompressing C @@ -382,7 +382,7 @@ process compressed files." }; name = "egrep"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["egrep"; "abc"; "/test-grep.txt"]], @@ -397,7 +397,7 @@ matching lines." }; name = "fgrep"; added = (1, 0, 66); style = RStringList "lines", [String "pattern"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["fgrep"; "abc"; "/test-grep.txt"]], @@ -412,7 +412,7 @@ matching lines." }; name = "grepi"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["grepi"; "abc"; "/test-grep.txt"]], @@ -427,7 +427,7 @@ matching lines." }; name = "egrepi"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["egrepi"; "abc"; "/test-grep.txt"]], @@ -442,7 +442,7 @@ matching lines." }; name = "fgrepi"; added = (1, 0, 66); style = RStringList "lines", [String "pattern"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["fgrepi"; "abc"; "/test-grep.txt"]], @@ -457,7 +457,7 @@ matching lines." }; name = "zgrep"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zgrep"; "abc"; "/test-grep.txt.gz"]], @@ -472,7 +472,7 @@ matching lines." }; name = "zegrep"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zegrep"; "abc"; "/test-grep.txt.gz"]], @@ -487,7 +487,7 @@ matching lines." }; name = "zfgrep"; added = (1, 0, 66); style = RStringList "lines", [String "pattern"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zfgrep"; "abc"; "/test-grep.txt.gz"]], @@ -503,7 +503,7 @@ matching lines." }; style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zgrepi"; "abc"; "/test-grep.txt.gz"]], @@ -518,7 +518,7 @@ matching lines." }; name = "zegrepi"; added = (1, 0, 66); style = RStringList "lines", [String "regex"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zegrepi"; "abc"; "/test-grep.txt.gz"]], @@ -533,7 +533,7 @@ matching lines." }; name = "zfgrepi"; added = (1, 0, 66); style = RStringList "lines", [String "pattern"; Pathname "path"], []; protocol_limit_warning = true; - deprecated_by = Some "grep"; + deprecated_by = Replaced_by "grep"; tests = [ InitISOFS, Always, TestResult ( [["zfgrepi"; "abc"; "/test-grep.txt.gz"]], @@ -547,7 +547,7 @@ matching lines." }; { defaults with name = "fallocate"; added = (1, 0, 66); style = RErr, [Pathname "path"; Int "len"], []; - deprecated_by = Some "fallocate64"; + deprecated_by = Replaced_by "fallocate64"; tests = [ InitScratchFS, Always, TestResult ( [["fallocate"; "/fallocate"; "1000000"]; @@ -567,7 +567,7 @@ attaches it as a device." }; name = "setcon"; added = (1, 0, 67); style = RErr, [String "context"], []; optional = Some "selinux"; - deprecated_by = Some "selinux_relabel"; + deprecated_by = Replaced_by "selinux_relabel"; shortdesc = "set SELinux security context"; longdesc = "\ This sets the SELinux security context of the daemon @@ -579,7 +579,7 @@ See the documentation about SELINUX in L." }; name = "getcon"; added = (1, 0, 67); style = RString "context", [], []; optional = Some "selinux"; - deprecated_by = Some "selinux_relabel"; + deprecated_by = Replaced_by "selinux_relabel"; shortdesc = "get SELinux security context"; longdesc = "\ This gets the SELinux security context of the daemon. @@ -590,7 +590,7 @@ and C" }; { defaults with name = "mkfs_b"; added = (1, 0, 68); style = RErr, [String "fstype"; Int "blocksize"; Device "device"], []; - deprecated_by = Some "mkfs"; + deprecated_by = Replaced_by "mkfs"; tests = [ InitEmpty, Always, TestResultString ( [["part_disk"; "/dev/sda"; "mbr"]; @@ -627,7 +627,7 @@ the requested cluster size." }; { defaults with name = "mke2journal"; added = (1, 0, 68); style = RErr, [Int "blocksize"; Device "device"], []; - deprecated_by = Some "mke2fs"; + deprecated_by = Replaced_by "mke2fs"; tests = [ InitEmpty, Always, TestResultString ( [["part_init"; "/dev/sda"; "mbr"]; @@ -649,7 +649,7 @@ to the command: { defaults with name = "mke2journal_L"; added = (1, 0, 68); style = RErr, [Int "blocksize"; String "label"; Device "device"], []; - deprecated_by = Some "mke2fs"; + deprecated_by = Replaced_by "mke2fs"; tests = [ InitEmpty, Always, TestResultString ( [["part_init"; "/dev/sda"; "mbr"]; @@ -668,7 +668,7 @@ This creates an ext2 external journal on C with label C