This commit is contained in:
sylvestre
2023-05-23 02:38:08 +00:00
parent cd600241ee
commit b32440eef0
32 changed files with 85 additions and 55 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
(function() {var implementors = {
"uu_numfmt":[["impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uu_numfmt/format/struct.WhitespaceSplitter.html\" title=\"struct uu_numfmt::format::WhitespaceSplitter\">WhitespaceSplitter</a>&lt;'a&gt;"]],
"uu_tail":[["impl&lt;'a&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uu_tail/chunks/struct.ReverseChunks.html\" title=\"struct uu_tail::chunks::ReverseChunks\">ReverseChunks</a>&lt;'a&gt;"]],
"uucore":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uucore/utmpx/struct.UtmpxIter.html\" title=\"struct uucore::utmpx::UtmpxIter\">UtmpxIter</a>"],["impl&lt;B: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/std/io/trait.BufRead.html\" title=\"trait std::io::BufRead\">BufRead</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uucore/lines/struct.Lines.html\" title=\"struct uucore::lines::Lines\">Lines</a>&lt;B&gt;"]]
"uucore":[["impl&lt;B: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/std/io/trait.BufRead.html\" title=\"trait std::io::BufRead\">BufRead</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uucore/lines/struct.Lines.html\" title=\"struct uucore::lines::Lines\">Lines</a>&lt;B&gt;"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/iter/traits/iterator/trait.Iterator.html\" title=\"trait core::iter::traits::iterator::Iterator\">Iterator</a> for <a class=\"struct\" href=\"uucore/utmpx/struct.UtmpxIter.html\" title=\"struct uucore::utmpx::UtmpxIter\">UtmpxIter</a>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
+2 -2
View File
@@ -1,9 +1,9 @@
(function() {var implementors = {
"uu_cp":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.OverwriteMode.html\" title=\"enum uu_cp::OverwriteMode\">OverwriteMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.ClobberMode.html\" title=\"enum uu_cp::ClobberMode\">ClobberMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.ReflinkMode.html\" title=\"enum uu_cp::ReflinkMode\">ReflinkMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.SparseMode.html\" title=\"enum uu_cp::SparseMode\">SparseMode</a>"]],
"uu_cp":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.ClobberMode.html\" title=\"enum uu_cp::ClobberMode\">ClobberMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.SparseMode.html\" title=\"enum uu_cp::SparseMode\">SparseMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.OverwriteMode.html\" title=\"enum uu_cp::OverwriteMode\">OverwriteMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_cp/enum.ReflinkMode.html\" title=\"enum uu_cp::ReflinkMode\">ReflinkMode</a>"]],
"uu_kill":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_kill/enum.Mode.html\" title=\"enum uu_kill::Mode\">Mode</a>"]],
"uu_numfmt":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_numfmt/options/enum.RoundMethod.html\" title=\"enum uu_numfmt::options::RoundMethod\">RoundMethod</a>"]],
"uu_sort":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_sort/enum.GeneralF64ParseResult.html\" title=\"enum uu_sort::GeneralF64ParseResult\">GeneralF64ParseResult</a>"]],
"uu_stty":[["impl&lt;T: <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a>&gt; <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"struct\" href=\"uu_stty/struct.Flag.html\" title=\"struct uu_stty::Flag\">Flag</a>&lt;T&gt;"]],
"uu_tail":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_tail/args/enum.Signum.html\" title=\"enum uu_tail::args::Signum\">Signum</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uu_tail/args/enum.FollowMode.html\" title=\"enum uu_tail::args::FollowMode\">FollowMode</a>"]],
"uucore":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/fs/enum.ResolveMode.html\" title=\"enum uucore::fs::ResolveMode\">ResolveMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/backup_control/enum.BackupMode.html\" title=\"enum uucore::backup_control::BackupMode\">BackupMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/fs/enum.MissingHandling.html\" title=\"enum uucore::fs::MissingHandling\">MissingHandling</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/quoting_style/enum.Quotes.html\" title=\"enum uucore::quoting_style::Quotes\">Quotes</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/encoding/enum.Format.html\" title=\"enum uucore::encoding::Format\">Format</a>"]]
"uucore":[["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/fs/enum.MissingHandling.html\" title=\"enum uucore::fs::MissingHandling\">MissingHandling</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/fs/enum.ResolveMode.html\" title=\"enum uucore::fs::ResolveMode\">ResolveMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/encoding/enum.Format.html\" title=\"enum uucore::encoding::Format\">Format</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/backup_control/enum.BackupMode.html\" title=\"enum uucore::backup_control::BackupMode\">BackupMode</a>"],["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/1.69.0/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"uucore/quoting_style/enum.Quotes.html\" title=\"enum uucore::quoting_style::Quotes\">Quotes</a>"]]
};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -3
View File
File diff suppressed because one or more lines are too long
+21 -5
View File
@@ -213,6 +213,14 @@
<a href="#213" id="213">213</a>
<a href="#214" id="214">214</a>
<a href="#215" id="215">215</a>
<a href="#216" id="216">216</a>
<a href="#217" id="217">217</a>
<a href="#218" id="218">218</a>
<a href="#219" id="219">219</a>
<a href="#220" id="220">220</a>
<a href="#221" id="221">221</a>
<a href="#222" id="222">222</a>
<a href="#223" id="223">223</a>
</pre><pre class="rust"><code><span class="comment">// * This file is part of the uutils coreutils package.
// *
// * (c) Nicholas Juszczak &lt;juszczakn@gmail.com&gt;
@@ -235,7 +243,7 @@
<span class="kw">use </span>uucore::{display::Quotable, fs::dir_strip_dot_for_creation};
<span class="kw">use </span>uucore::{format_usage, help_about, help_section, help_usage, show, show_if_err};
<span class="kw">static </span>DEFAULT_PERM: u32 = <span class="number">0o755</span>;
<span class="kw">static </span>DEFAULT_PERM: u32 = <span class="number">0o777</span>;
<span class="kw">const </span>ABOUT: <span class="kw-2">&amp;</span>str = <span class="macro">help_about!</span>(<span class="string">&quot;mkdir.md&quot;</span>);
<span class="kw">const </span>USAGE: <span class="kw-2">&amp;</span>str = <span class="macro">help_usage!</span>(<span class="string">&quot;mkdir.md&quot;</span>);
@@ -256,7 +264,7 @@
<span class="attr">#[cfg(not(windows))]
</span><span class="kw">fn </span>get_mode(matches: <span class="kw-2">&amp;</span>ArgMatches, mode_had_minus_prefix: bool) -&gt; <span class="prelude-ty">Result</span>&lt;u32, String&gt; {
<span class="kw">let </span>digits: <span class="kw-2">&amp;</span>[char] = <span class="kw-2">&amp;</span>[<span class="string">&#39;0&#39;</span>, <span class="string">&#39;1&#39;</span>, <span class="string">&#39;2&#39;</span>, <span class="string">&#39;3&#39;</span>, <span class="string">&#39;4&#39;</span>, <span class="string">&#39;5&#39;</span>, <span class="string">&#39;6&#39;</span>, <span class="string">&#39;7&#39;</span>, <span class="string">&#39;8&#39;</span>, <span class="string">&#39;9&#39;</span>];
<span class="comment">// Translate a ~str in octal form to u16, default to 755
<span class="comment">// Translate a ~str in octal form to u16, default to 777
// Not tested on Windows
</span><span class="kw">let </span><span class="kw-2">mut </span>new_mode = DEFAULT_PERM;
<span class="kw">match </span>matches.get_one::&lt;String&gt;(options::MODE) {
@@ -373,7 +381,7 @@
}
<span class="kw">fn </span>mkdir(path: <span class="kw-2">&amp;</span>Path, recursive: bool, mode: u32, verbose: bool) -&gt; UResult&lt;()&gt; {
create_dir(path, recursive, verbose)<span class="question-mark">?</span>;
create_dir(path, recursive, verbose, <span class="bool-val">false</span>)<span class="question-mark">?</span>;
chmod(path, mode)
}
@@ -394,7 +402,9 @@
</span><span class="prelude-val">Ok</span>(())
}
<span class="kw">fn </span>create_dir(path: <span class="kw-2">&amp;</span>Path, recursive: bool, verbose: bool) -&gt; UResult&lt;()&gt; {
<span class="comment">// `is_parent` argument is not used on windows
</span><span class="attr">#[allow(unused_variables)]
</span><span class="kw">fn </span>create_dir(path: <span class="kw-2">&amp;</span>Path, recursive: bool, verbose: bool, is_parent: bool) -&gt; UResult&lt;()&gt; {
<span class="kw">if </span>path.exists() &amp;&amp; !recursive {
<span class="kw">return </span><span class="prelude-val">Err</span>(USimpleError::new(
<span class="number">1</span>,
@@ -407,7 +417,7 @@
<span class="kw">if </span>recursive {
<span class="kw">match </span>path.parent() {
<span class="prelude-val">Some</span>(p) =&gt; create_dir(p, recursive, verbose)<span class="question-mark">?</span>,
<span class="prelude-val">Some</span>(p) =&gt; create_dir(p, recursive, verbose, <span class="bool-val">true</span>)<span class="question-mark">?</span>,
<span class="prelude-val">None </span>=&gt; {
USimpleError::new(<span class="number">1</span>, <span class="string">&quot;failed to create whole tree&quot;</span>);
}
@@ -422,6 +432,12 @@
path.quote()
);
}
<span class="attr">#[cfg(not(windows))]
</span><span class="kw">if </span>is_parent {
<span class="comment">// directories created by -p have permission bits set to &#39;=rwx,u+wx&#39;,
// which is umask modified by &#39;u+wx&#39;
</span>chmod(path, (!mode::get_umask() &amp; <span class="number">0o0777</span>) | <span class="number">0o0300</span>)<span class="question-mark">?</span>;
}
<span class="prelude-val">Ok</span>(())
}
<span class="prelude-val">Err</span>(<span class="kw">_</span>) <span class="kw">if </span>path.is_dir() =&gt; <span class="prelude-val">Ok</span>(()),
+15 -1
View File
@@ -589,6 +589,13 @@
<a href="#589" id="589">589</a>
<a href="#590" id="590">590</a>
<a href="#591" id="591">591</a>
<a href="#592" id="592">592</a>
<a href="#593" id="593">593</a>
<a href="#594" id="594">594</a>
<a href="#595" id="595">595</a>
<a href="#596" id="596">596</a>
<a href="#597" id="597">597</a>
<a href="#598" id="598">598</a>
</pre><pre class="rust"><code><span class="comment">// This file is part of the uutils coreutils package.
//
// (c) Sunrin SHIMURA
@@ -633,6 +640,11 @@
<span class="kw">static </span>ARG_TEMPLATE: <span class="kw-2">&amp;</span>str = <span class="string">&quot;template&quot;</span>;
<span class="attr">#[cfg(not(windows))]
</span><span class="kw">const </span>TMPDIR_ENV_VAR: <span class="kw-2">&amp;</span>str = <span class="string">&quot;TMPDIR&quot;</span>;
<span class="attr">#[cfg(windows)]
</span><span class="kw">const </span>TMPDIR_ENV_VAR: <span class="kw-2">&amp;</span>str = <span class="string">&quot;TMP&quot;</span>;
<span class="attr">#[derive(Debug)]
</span><span class="kw">enum </span>MkTempError {
PersistError(PathBuf),
@@ -782,7 +794,9 @@
(tmpdir, template.to_string())
}
<span class="prelude-val">Some</span>(template) =&gt; {
<span class="kw">let </span>tmpdir = <span class="kw">if </span>matches.contains_id(OPT_TMPDIR) {
<span class="kw">let </span>tmpdir = <span class="kw">if </span>env::var(TMPDIR_ENV_VAR).is_ok() &amp;&amp; matches.get_flag(OPT_T) {
env::var(TMPDIR_ENV_VAR).ok()
} <span class="kw">else if </span>matches.contains_id(OPT_TMPDIR) {
matches.get_one::&lt;String&gt;(OPT_TMPDIR).map(String::from)
} <span class="kw">else if </span>matches.get_flag(OPT_T) {
<span class="comment">// mktemp -t foo.xxx should export in TMPDIR
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More