-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkg_deb: Create deb pkgs with unicode descriptions
pkg_deb would fail with an error when attempting to create debian packages with descriptions containing unicode characters or with utf-8 encoded description_files. Python's bytes objects can only contain ascii literal characters and so need decoding when they are sent to strings and non-ascii strings need encoding when sent to bytes objects. Resolves: #7370 Testing Done: - bazel test tools/build_defs/pkg:build_test Closes #7484. PiperOrigin-RevId: 240218536
- Loading branch information
1 parent
7363e84
commit 70e3c33
Showing
3 changed files
with
46 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
# -*- coding: utf-8 -*- | ||
|
||
# Copyright 2015 The Bazel Authors. All rights reserved. | ||
# | ||
|
@@ -181,8 +182,9 @@ function test_deb() { | |
check_eq "-rwxr-xr-x" "$(get_deb_permission test-deb.deb ./usr/titi)" | ||
check_eq "-rw-r--r--" "$(get_deb_permission test-deb.deb ./etc/nsswitch.conf)" | ||
get_deb_description test-deb.deb >$TEST_log | ||
expect_log "Description: toto" | ||
expect_log "Description: toto ®, Й, ק ,م, ๗, あ, 叶, 葉, 말, ü and é" | ||
expect_log "Package: titi" | ||
expect_log "somé[email protected]" | ||
expect_log "Depends: dep1, dep2" | ||
|
||
get_changes titi_test_all.changes >$TEST_log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Such paradigm of using
u''
strings is python2-like and is likely to break under python3.Suggest adding
py_test
formake_deb.py
to run under both python2 and python3 to avoid such regressions as #8465