Update from the upstream. (BUILD=4200)
* Updated the version from 2.25 to 2.26.
* Refined build rules for macOS.
* Code refactoring.
There are no feature changes between 2.25 and 2.26.
The diffrences are only build system updates (i.e. supports of Python3, Bazel, etc.) and code refactoring.
Hiroyuki Komatsu
3 years ago
134 | 134 |
parser.add_option("--verify", dest="verify", action="store_true",
|
135 | 135 |
default=False)
|
136 | 136 |
parser.add_option("--notarization_id", dest="notarization_id")
|
|
137 |
parser.add_option("--output", dest="output")
|
137 | 138 |
(options, unused_args) = parser.parse_args()
|
138 | 139 |
|
139 | 140 |
if not options.target:
|
|
175 | 176 |
if opts.notarization_id:
|
176 | 177 |
Notarize(opts.target, opts.notarization_id)
|
177 | 178 |
|
|
179 |
# Output something to make the processes trackable.
|
|
180 |
if opts.output:
|
|
181 |
with open(opts.output, "w") as output:
|
|
182 |
output.write("Done")
|
178 | 183 |
|
179 | 184 |
if __name__ == "__main__":
|
180 | 185 |
main()
|
27 | 27 |
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28 | 28 |
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29 | 29 |
|
30 | |
"""Creates versioned files and information files of the files.
|
|
30 |
r"""Creates versioned files and information files of the files.
|
31 | 31 |
|
32 | 32 |
When the version is "1.2.3.4", the following command creates these four files.
|
33 | 33 |
/PATH/TO/file1-1.2.3.4.ext : Copied from /PATH/TO/file1.ext
|
|
53 | 53 |
import optparse
|
54 | 54 |
import os
|
55 | 55 |
import shutil
|
|
56 |
import six
|
56 | 57 |
|
57 | 58 |
from build_tools import mozc_version
|
58 | 59 |
|
|
88 | 89 |
package = os.path.basename(new_file_path)
|
89 | 90 |
file_size = os.path.getsize(new_file_path)
|
90 | 91 |
sha1_digest = _GetSha1Digest(new_file_path)
|
91 | |
sha1_hash = base64.b64encode(sha1_digest)
|
92 | |
sha1_hash_hex = sha1_digest.encode('hex')
|
|
92 |
if six.PY3:
|
|
93 |
sha1_hash = base64.b64encode(sha1_digest).decode('latin1')
|
|
94 |
sha1_hash_hex = sha1_digest.hex()
|
|
95 |
else:
|
|
96 |
sha1_hash = base64.b64encode(sha1_digest)
|
|
97 |
sha1_hash_hex = sha1_digest.encode('hex')
|
93 | 98 |
with open('%s.info' % new_file_path, 'w') as output:
|
94 | 99 |
output.write('package\t%s\n' % package)
|
95 | 100 |
output.write('build_id\t%s\n' % build_id)
|
49 | 49 |
std::string result;
|
50 | 50 |
size_t pos = 0;
|
51 | 51 |
|
52 | |
while (getline(std::cin, command)) {
|
|
52 |
while (std::getline(std::cin, command)) {
|
53 | 53 |
char initial = command[0];
|
54 | 54 |
if (initial == '-' || (initial >= '0' && initial <= '9')) {
|
55 | 55 |
std::stringstream ss;
|
47 | 47 |
|
48 | 48 |
std::string command;
|
49 | 49 |
std::string result;
|
50 | |
while (getline(std::cin, command)) {
|
|
50 |
while (std::getline(std::cin, command)) {
|
51 | 51 |
converter.Convert(command, &result);
|
52 | 52 |
std::cout << result << std::endl;
|
53 | 53 |
}
|
444 | 444 |
std::string line;
|
445 | 445 |
const std::string empty_pending("");
|
446 | 446 |
while (!is->eof()) {
|
447 | |
getline(*is, line);
|
|
447 |
std::getline(*is, line);
|
448 | 448 |
Util::ChopReturns(&line);
|
449 | 449 |
if (line.empty()) {
|
450 | 450 |
continue;
|
29 | 29 |
|
30 | 30 |
MAJOR = 2
|
31 | 31 |
|
32 | |
MINOR = 25
|
|
32 |
MINOR = 26
|
33 | 33 |
|
34 | 34 |
# Number to be increased. This value may be replaced by other tools.
|
35 | 35 |
BUILD = 4190
|
39 | 39 |
: stream_(filename.c_str()), done_(false), array_index_(-1), cost_(0) {
|
40 | 40 |
LOG(INFO) << "Loading " << filename;
|
41 | 41 |
std::string header;
|
42 | |
CHECK(!getline(stream_, header).fail()) << filename << " is empty.";
|
|
42 |
CHECK(!std::getline(stream_, header).fail()) << filename << " is empty.";
|
43 | 43 |
pos_size_ = NumberUtil::SimpleAtoi(header);
|
44 | 44 |
Next();
|
45 | 45 |
}
|
|
54 | 54 |
return;
|
55 | 55 |
}
|
56 | 56 |
std::string line;
|
57 | |
done_ = getline(stream_, line).fail();
|
|
57 |
done_ = std::getline(stream_, line).fail();
|
58 | 58 |
if (done_) {
|
59 | 59 |
return;
|
60 | 60 |
}
|
208 | 208 |
InputFileStream input(suggestion_filter_files_[i].c_str());
|
209 | 209 |
CHECK(input) << "cannot open: " << suggestion_filter_files_[i];
|
210 | 210 |
std::string line;
|
211 | |
while (getline(input, line)) {
|
|
211 |
while (std::getline(input, line)) {
|
212 | 212 |
if (line.empty() || line[0] == '#') {
|
213 | 213 |
continue;
|
214 | 214 |
}
|
|
226 | 226 |
CHECK(input) << "cannot open: " << dictionary_files_[i];
|
227 | 227 |
std::vector<std::string> fields;
|
228 | 228 |
std::string line;
|
229 | |
while (getline(input, line)) {
|
|
229 |
while (std::getline(input, line)) {
|
230 | 230 |
fields.clear();
|
231 | 231 |
Util::SplitStringUsing(line, "\t", &fields);
|
232 | 232 |
CHECK_GE(fields.size(), 5);
|
61 | 61 |
dic->clear();
|
62 | 62 |
std::string line;
|
63 | 63 |
std::vector<std::string> fields;
|
64 | |
while (!getline(*ifs, line).fail()) {
|
|
64 |
while (!std::getline(*ifs, line).fail()) {
|
65 | 65 |
fields.clear();
|
66 | 66 |
Util::SplitStringUsing(line, "\t", &fields);
|
67 | 67 |
CHECK_GE(fields.size(), 4);
|
49 | 49 |
void ReadWords(const std::string &name, std::vector<uint64> *words) {
|
50 | 50 |
std::string line;
|
51 | 51 |
mozc::InputFileStream input(name.c_str());
|
52 | |
while (getline(input, line)) {
|
|
52 |
while (std::getline(input, line)) {
|
53 | 53 |
if (line.empty() || line[0] == '#') {
|
54 | 54 |
continue;
|
55 | 55 |
}
|
57 | 57 |
InputFileStream ifs(FLAGS_collocation_data.c_str());
|
58 | 58 |
std::string line;
|
59 | 59 |
std::vector<std::string> entries;
|
60 | |
while (!getline(ifs, line).fail()) {
|
|
60 |
while (!std::getline(ifs, line).fail()) {
|
61 | 61 |
if (line.empty()) {
|
62 | 62 |
continue;
|
63 | 63 |
}
|
68 | 68 |
InputFileStream ifs(FLAGS_suppression_data.c_str());
|
69 | 69 |
std::string line;
|
70 | 70 |
|
71 | |
while (!getline(ifs, line).fail()) {
|
|
71 |
while (!std::getline(ifs, line).fail()) {
|
72 | 72 |
if (line.empty()) {
|
73 | 73 |
continue;
|
74 | 74 |
}
|
80 | 80 |
InputFileStream ifs(path.c_str());
|
81 | 81 |
|
82 | 82 |
std::string line;
|
83 | |
getline(ifs, line); // Skip header
|
|
83 |
std::getline(ifs, line); // Skip header
|
84 | 84 |
|
85 | 85 |
std::vector<std::pair<std::string, KeyList>> data;
|
86 | 86 |
mozc_hash_map<std::string, int> key_count;
|
87 | |
while (getline(ifs, line)) {
|
|
87 |
while (std::getline(ifs, line)) {
|
88 | 88 |
std::vector<absl::string_view> field_list;
|
89 | 89 |
Util::SplitStringUsing(line, "\t", &field_list);
|
90 | 90 |
CHECK_GE(field_list.size(), 2) << "Format error: " << line;
|
70 | 70 |
int sorting_key = 0;
|
71 | 71 |
InputFileStream rule_ifs(rule_file.c_str());
|
72 | 72 |
CHECK(rule_ifs.good());
|
73 | |
while (!getline(rule_ifs, line).fail()) {
|
|
73 |
while (!std::getline(rule_ifs, line).fail()) {
|
74 | 74 |
if (line.empty() || line[0] == '#') {
|
75 | 75 |
continue;
|
76 | 76 |
}
|
|
81 | 81 |
InputFileStream auto_ifs(auto_file.c_str());
|
82 | 82 |
CHECK(auto_ifs.good());
|
83 | 83 |
|
84 | |
while (!getline(auto_ifs, line).fail()) {
|
|
84 |
while (!std::getline(auto_ifs, line).fail()) {
|
85 | 85 |
if (line.empty() || line[0] == '#') {
|
86 | 86 |
continue;
|
87 | 87 |
}
|
|
156 | 156 |
CHECK(ifs.good());
|
157 | 157 |
|
158 | 158 |
std::string line;
|
159 | |
CHECK(!getline(ifs, line).fail()); // get first line
|
|
159 |
CHECK(!std::getline(ifs, line).fail()); // get first line
|
160 | 160 |
|
161 | 161 |
std::vector<std::string> fields;
|
162 | |
while (!getline(ifs, line).fail()) {
|
|
162 |
while (!std::getline(ifs, line).fail()) {
|
163 | 163 |
fields.clear();
|
164 | 164 |
// Format:
|
165 | 165 |
// POS <tab> value <tab> readings(space delimitered) <tab>
|
145 | 145 |
|
146 | 146 |
std::string line;
|
147 | 147 |
std::vector<std::string> fields;
|
148 | |
while (!getline(ifs, line).fail()) {
|
|
148 |
while (!std::getline(ifs, line).fail()) {
|
149 | 149 |
if (line.empty() || line[0] == '#') {
|
150 | 150 |
continue;
|
151 | 151 |
}
|
|
181 | 181 |
std::map<std::string, int> conjugation_id_map;
|
182 | 182 |
|
183 | 183 |
int conjugation_id = 0;
|
184 | |
while (!getline(ifs, line).fail()) {
|
|
184 |
while (!std::getline(ifs, line).fail()) {
|
185 | 185 |
if (line.empty() || line[0] == '#') {
|
186 | 186 |
// starting with '#' is a comment line.
|
187 | 187 |
continue;
|
59 | 59 |
std::vector<KeyInformation> result;
|
60 | 60 |
|
61 | 61 |
std::string line;
|
62 | |
getline(*ifs, line); // Skip the first line.
|
|
62 |
std::getline(*ifs, line); // Skip the first line.
|
63 | 63 |
while (!ifs->eof()) {
|
64 | |
getline(*ifs, line);
|
|
64 |
std::getline(*ifs, line);
|
65 | 65 |
Util::ChopReturns(&line);
|
66 | 66 |
if (line.empty() || line[0] == '#') {
|
67 | 67 |
// empty or comment
|
56 | 56 |
|
57 | 57 |
commands::Command command;
|
58 | 58 |
std::string line;
|
59 | |
while (getline(*input, line)) {
|
|
59 |
while (std::getline(*input, line)) {
|
60 | 60 |
Util::ChopReturns(&line);
|
61 | 61 |
if (line.size() > 1 && line[0] == '#' && line[1] == '#') {
|
62 | 62 |
continue;
|
348 | 348 |
std::string line_text;
|
349 | 349 |
int line_number = 0;
|
350 | 350 |
std::vector<std::string> columns;
|
351 | |
while (getline(input_stream, line_text)) {
|
|
351 |
while (std::getline(input_stream, line_text)) {
|
352 | 352 |
++line_number;
|
353 | 353 |
SCOPED_TRACE(Util::StringPrintf("Scenario: %s [%s:%d]", line_text.c_str(),
|
354 | 354 |
scenario_path.c_str(), line_number));
|
76 | 76 |
mozc::commands::Command command;
|
77 | 77 |
std::string line;
|
78 | 78 |
|
79 | |
while (getline(std::cin, line)) {
|
|
79 |
while (std::getline(std::cin, line)) {
|
80 | 80 |
command.clear_input();
|
81 | 81 |
command.clear_output();
|
82 | 82 |
uint32 event_id = 0;
|