- Package:
- src:hexedit
- Source:
- hexedit
- Submitter:
- Paul Wise
- Date:
- 2022-07-11 03:36:03 UTC
- Severity:
- wishlist
Please add this autopkgtest that tests editing both non-empty and empty
files by passing keys via terminal escape sequences and bytes. You will
need to test-depend on colorized-logs for pipetty and ansi2txt. It
should be possible to add more scenarios by typing keys into hexdump
and converting those to the corresponding printf sequences.
#!/bin/sh
set -e
rm -f nonempty empty result
echo nonempty > nonempty
touch empty
echo result > result
for f in nonempty empty ; do
echo "Editing $f in hexedit"
printf "$f"'\n\tresult\x18y' |
pipetty hexedit 2>&1 |
ansi2txt |
tr '\r' '\n'
done
head -vn-0 nonempty empty result
for f in nonempty empty ; do
cmp "$f" result
done
Em ter., 17 de ago. de 2021 às 01:33, Paul Wise <pabs@debian.org> escreveu: Thanks for your help. Unfortunately, your script ends with 'pipetty: can't allocate a pseudo-terminal: No such file or directory'. If possible, to create an empty file in Bash, use '> file' instead of 'touch file'. Regards, Eriberto
Control: tags -1 - moreinfo
Please CC submitters when you have questions/comments they should see,
I only saw your message by coincidence when looking at the bug.
I don't get this on the machine where I tested the script.
It sounds like your test environment doesn't have /dev/pts/ mounted?
I've adopted that. The script also had some other issues that I fixed;
it was not compatible with dash printf (which doesn't support \xNN),
included unwanted LF bytes and also neglected to truncate the file at
the right place after writing the result string.
Please include this script instead:
#!/bin/sh
set -e
rm -f nonempty empty result
echo -n nonempty > nonempty
echo -n > empty
echo -n result > result
for f in nonempty empty ; do
echo "Editing $f in hexedit"
printf "$f"'\n\tresult\33ty\30y' |
pipetty hexedit 2>&1 |
ansi2txt |
tr '\r' '\n'
done
head -vn-0 nonempty empty result ; echo
for f in nonempty empty ; do
cmp "$f" result
done
Hi Pabs, Sorry for the long time to react. Em qui., 6 de jan. de 2022 às 03:07, Paul Wise <pabs@debian.org> escreveu: Ok. Yes, you are right. My jail was missing /dev/pts. Very good. However, the Salsa returned 'Error opening terminal: unknown'[1]. So I added a TERM variable to fix this issue and the CI worked fine in Salsa[2]. See the change below. - pipetty hexedit 2>&1 | + TERM=xterm pipetty hexedit 2>&1 | [1] https://salsa.debian.org/debian/hexedit/-/jobs/2981702 [2] https://salsa.debian.org/debian/hexedit/-/jobs/2981737 What do you think about this change? I am ready to upload a new upstream version with your new test. Cheers, Eriberto
The approach seems reasonable. I'm not sure that xterm is the correct TERM value to use since pipetty is just a psuedo-terminal. OTOH you likely need to test that hexedit works with any terminal type, so maybe test with multiple different values; dumb linux vt100 vt102 vt220 xterm
Em dom., 10 de jul. de 2022 às 22:11, Paul Wise <pabs@debian.org> escreveu: hexedit also works with linux, but I will send the package with xterm to see the results on ci.debian.net. I think this is sufficient to make a good test. Thanks a lot for your help. Eriberto
We believe that the bug you reported is fixed in the latest version of
hexedit, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 992313@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Joao Eriberto Mota Filho <eriberto@debian.org> (supplier of updated hexedit package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Sun, 10 Jul 2022 17:35:05 -0300
Source: hexedit
Architecture: source
Version: 1.6-1
Distribution: unstable
Urgency: medium
Maintainer: Joao Eriberto Mota Filho <eriberto@debian.org>
Changed-By: Joao Eriberto Mota Filho <eriberto@debian.org>
Closes: 992313
Changes:
hexedit (1.6-1) unstable; urgency=medium
.
* New upstream version 1.6.
* debian/control: bumped Standards-Version to 4.6.1.
* debian/copyright: updated upstream and packaging copyright years.
* debian/patches/: dropped the following patches, already present in new
upstream release (1.6):
- 010_prevent-division-by-zero.patch
- 020_fix-crash-resize.patch
* debian/tests/: added a non-superficial test. Thanks to Paul Wise
<pabs@debian.org>. (Closes: #992313)
Checksums-Sha1:
b5e262c9670b590b7693f6dc540d647f9c066b1c 1882 hexedit_1.6-1.dsc
561e967aecff92a487614ed0f98f917949b39ac4 31085 hexedit_1.6.orig.tar.gz
edb2cf12368ea74b50e0b23ec233d06b12de7f6c 6452 hexedit_1.6-1.debian.tar.xz
9261d4cce9c79646e9a2a188b0b2e865b195b236 5966 hexedit_1.6-1_source.buildinfo
Checksums-Sha256:
6c3971a53763df97761cbb3e6144fd5edae716753e11654b368d4138a9c405ca 1882 hexedit_1.6-1.dsc
598906131934f88003a6a937fab10542686ce5f661134bc336053e978c4baae3 31085 hexedit_1.6.orig.tar.gz
10fc1c10b1c37d1d67510305be6f22f3d29b9a8a751cbfc864102fa4dad836bf 6452 hexedit_1.6-1.debian.tar.xz
4f77577a4a59bdac89866b7601bf9e8da8c30a359cf048ba0273e6367a7cc102 5966 hexedit_1.6-1_source.buildinfo
Files:
159d3acfdf2697e0fe6876820868f7a1 1882 editors optional hexedit_1.6-1.dsc
9b5849759dbda9ab25ec22818c16e970 31085 editors optional hexedit_1.6.orig.tar.gz
8c18f74a472969221add96bdd6e256d5 6452 editors optional hexedit_1.6-1.debian.tar.xz
e9a92b805ff7a861f1d4bea05bf0f266 5966 editors optional hexedit_1.6-1_source.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEENX3LDuyVoBrrofDS3mO5xwTr6e8FAmLLk0sACgkQ3mO5xwTr
6e8JTA/+LXUS9nlEHamzqKzwaOWFyhHx0c5IMLZ+UXVYGEnUleu9PUOV1XTIxhTF
xPSUQiLTRmKMdzWi6ZFHXKfg7aluSntBzENFfaC8iv9430WvQr2qn0nNceBggyzS
9Kpj2GkJIcV/jDJjzQ0FrIFpp1XIlTeIXvLBtHLQtrMdC+tdCp/SX9c70a8M4TfZ
3x5W5SYbAntPUhvhYvshDc139tmLuLIom+cZLpM5cElpgSn4WAwqVKTNL0+je28x
W51cWXA4HdNAcBZ1JxYmU0Gs/l8w7wdmibmb9K/bqfiD81V/x8Fn9Mn+d9KgN5eq
oKkxidUnrWp1F37l1c65EYSRBQ9miNE4fpBxJBTositNX+6zfhoOgNfMkFaYnHoj
z9mRvnSi2LcZP6tngSu46WsqCo0bMs/+PKdKgmCTdQoZE0Vjg/TzVAzCBNBX4VT3
Q48Yub9qlNdZZZsxb2P2D4CAlK9+QjVxnotKxM9Zgp42kb/h0uBb7gm+vYTH49IF
UTPNyz7EgXOLPXLWIogopzIAlawAh3Po3HznU6FzDTL8NeVkylNMvVFhOYj8Qa3r
qV/NK1Tyi8MCQLBB7na3W2JTwjy7eU9Zw2M6+L8yRSgzW95rm7baqiB/aE92t1Vn
bkMS9HTF6aNxhoJZ9s7gFEiPIGktfAjVqXLqo1DGS+7SXosiONM=
=i0Af
-----END PGP SIGNATURE-----