XYZ File Manager
Current Path:
/usr/bin
usr
/
bin
/
📁
..
📁
X11
📄
[
(66.89 KB)
📄
ab
(58.42 KB)
📄
addpart
(30.31 KB)
📄
apt
(18.31 KB)
📄
apt-cache
(86.38 KB)
📄
apt-cdrom
(22.38 KB)
📄
apt-config
(26.31 KB)
📄
apt-get
(50.38 KB)
📄
apt-key
(27.32 KB)
📄
apt-mark
(58.38 KB)
📄
arch
(42.86 KB)
📄
awk
(154.66 KB)
📄
b2sum
(58.98 KB)
📄
base32
(46.89 KB)
📄
base64
(46.89 KB)
📄
basename
(42.83 KB)
📄
basenc
(54.89 KB)
📄
bash
(1.21 MB)
📄
bashbug
(6.7 KB)
📄
bdftopcf
(42.45 KB)
📄
bdftruncate
(10.22 KB)
📄
busctl
(90.5 KB)
📄
c_rehash
(6.68 KB)
📄
captoinfo
(90.34 KB)
📄
cat
(42.98 KB)
📄
certbot
(958 B)
📄
chage
(78.49 KB)
📄
chardet
(221 B)
📄
chardetect
(221 B)
📄
chattr
(14.24 KB)
📄
chcon
(67.11 KB)
📄
checkgid
(14.23 KB)
📄
chfn
(61.2 KB)
📄
chgrp
(67.05 KB)
📄
chmod
(62.98 KB)
📄
choom
(54.31 KB)
📄
chown
(71.05 KB)
📄
chrt
(66.31 KB)
📄
chsh
(51.64 KB)
📄
cksum
(139.05 KB)
📄
clear
(14.24 KB)
📄
clear_console
(14.15 KB)
📄
cmp
(50.95 KB)
📄
comm
(46.92 KB)
📄
corelist
(15.01 KB)
📄
cp
(147.61 KB)
📄
cpan
(8.16 KB)
📄
cpan5.36-x86_64-linux-gnu
(8.18 KB)
📄
csplit
(119.17 KB)
📄
ctstat
(26.59 KB)
📄
cut
(46.98 KB)
📄
dash
(122.7 KB)
📄
date
(119.05 KB)
📄
dbus-cleanup-sockets
(14.22 KB)
📄
dbus-daemon
(238.56 KB)
📄
dbus-monitor
(26.23 KB)
📄
dbus-run-session
(14.23 KB)
📄
dbus-send
(30.22 KB)
📄
dbus-update-activation-environment
(14.22 KB)
📄
dbus-uuidgen
(14.22 KB)
📄
dd
(87.15 KB)
📄
deb-systemd-helper
(23.79 KB)
📄
deb-systemd-invoke
(6.09 KB)
📄
debconf
(2.79 KB)
📄
debconf-apt-progress
(11.27 KB)
📄
debconf-communicate
(608 B)
📄
debconf-copydb
(1.68 KB)
📄
debconf-escape
(647 B)
📄
debconf-set-selections
(2.92 KB)
📄
debconf-show
(1.78 KB)
📄
delpart
(30.31 KB)
📄
df
(99.8 KB)
📄
dialog
(247.85 KB)
📄
diff
(151.58 KB)
📄
diff3
(67.14 KB)
📄
dir
(147.8 KB)
📄
dircolors
(50.92 KB)
📄
dirname
(38.83 KB)
📄
dmesg
(86.58 KB)
📄
dnsdomainname
(22.15 KB)
📄
domainname
(22.15 KB)
📄
dpkg
(310.64 KB)
📄
dpkg-deb
(166.52 KB)
📄
dpkg-divert
(154.55 KB)
📄
dpkg-maintscript-helper
(20.71 KB)
📄
dpkg-query
(158.58 KB)
📄
dpkg-realpath
(4.09 KB)
📄
dpkg-split
(126.48 KB)
📄
dpkg-statoverride
(62.33 KB)
📄
dpkg-trigger
(86.48 KB)
📄
du
(171.33 KB)
📄
dvipdf
(1007 B)
📄
echo
(42.83 KB)
📄
editor
(3.48 MB)
📄
egrep
(41 B)
📄
enc2xs
(40.96 KB)
📄
encguess
(3 KB)
📄
env
(47.4 KB)
📄
eps2eps
(639 B)
📄
ex
(3.48 MB)
📄
expand
(42.92 KB)
📄
expiry
(30.45 KB)
📄
expr
(115.05 KB)
📄
factor
(83.2 KB)
📄
faillog
(22.53 KB)
📄
fallocate
(34.31 KB)
📄
false
(34.83 KB)
📄
fcgistarter
(14.23 KB)
📄
fgrep
(41 B)
📄
fincore
(34.36 KB)
📄
find
(219.58 KB)
📄
findmnt
(83.59 KB)
📄
flock
(34.39 KB)
📄
fmt
(46.89 KB)
📄
fold
(42.89 KB)
📄
fonttosfnt
(34.41 KB)
📄
free
(26.3 KB)
📄
fuser
(39.83 KB)
📄
getconf
(26.5 KB)
📄
getent
(35.47 KB)
📄
getopt
(34.31 KB)
📄
ghostscript
(14.23 KB)
📄
gpasswd
(86.42 KB)
📄
gpgv
(463 KB)
📄
grep
(198.39 KB)
📄
groups
(42.89 KB)
📄
gs
(14.23 KB)
📄
gsbj
(350 B)
📄
gsdj
(352 B)
📄
gsdj500
(352 B)
📄
gslj
(353 B)
📄
gslp
(350 B)
📄
gsnd
(277 B)
📄
gunzip
(2.29 KB)
📄
gzexe
(6.3 KB)
📄
gzip
(95.84 KB)
📄
h2ph
(28.54 KB)
📄
h2xs
(59.51 KB)
📄
hardlink
(50.39 KB)
📄
head
(46.95 KB)
📄
helpztags
(2.46 KB)
📄
hostid
(38.83 KB)
📄
hostname
(22.15 KB)
📄
hostnamectl
(30.38 KB)
📄
htcacheclean
(34.24 KB)
📄
htdbm
(26.23 KB)
📄
htdigest
(14.23 KB)
📄
htpasswd
(26.23 KB)
📄
i386
(26.58 KB)
📄
iconv
(63.13 KB)
📄
id
(47.02 KB)
📄
infocmp
(62.31 KB)
📄
infotocap
(90.34 KB)
📄
install
(155.8 KB)
📄
instmodsh
(4.27 KB)
📄
ionice
(34.31 KB)
📄
ip
(674.82 KB)
📄
ipcmk
(34.38 KB)
📄
ipcrm
(34.31 KB)
📄
ipcs
(74.31 KB)
📄
ischroot
(14.32 KB)
📄
join
(54.98 KB)
📄
journalctl
(74.64 KB)
📄
json_pp
(4.88 KB)
📄
kernel-install
(12.75 KB)
📄
kill
(22.3 KB)
📄
killall
(31.95 KB)
📄
last
(50.31 KB)
📄
lastb
(50.31 KB)
📄
lastlog
(31.75 KB)
📄
lcf
(7.6 KB)
📄
ld.so
(205.96 KB)
📄
ldd
(5.28 KB)
📄
letsencrypt
(958 B)
📄
libnetcfg
(15.41 KB)
📄
link
(38.83 KB)
📄
linux32
(26.58 KB)
📄
linux64
(26.58 KB)
📄
ln
(71.12 KB)
📄
lnstat
(26.59 KB)
📄
locale
(46.16 KB)
📄
localectl
(26.38 KB)
📄
localedef
(291.91 KB)
📄
logger
(54.9 KB)
📄
login
(51.78 KB)
📄
loginctl
(58.48 KB)
📄
logname
(38.83 KB)
📄
logresolve
(14.24 KB)
📄
ls
(147.8 KB)
📄
lsattr
(14.24 KB)
📄
lsb_release
(2.59 KB)
📄
lsblk
(202.31 KB)
📄
lscpu
(126.31 KB)
📄
lsfd
(120.3 KB)
📄
lsipc
(98.31 KB)
📄
lsirq
(34.48 KB)
📄
lslocks
(70.7 KB)
📄
lslogins
(94.31 KB)
📄
lsmem
(66.31 KB)
📄
lsns
(82.31 KB)
📄
mawk
(154.66 KB)
📄
mcookie
(34.38 KB)
📄
md5sum
(50.95 KB)
📄
md5sum.textutils
(50.95 KB)
📄
mesg
(18.3 KB)
📄
mkdir
(95.27 KB)
📄
mkfifo
(67.17 KB)
📄
mkfontdir
(65 B)
📄
mkfontscale
(39.05 KB)
📄
mknod
(71.2 KB)
📄
mktemp
(42.92 KB)
📄
more
(58.31 KB)
📄
mount
(58.3 KB)
📄
mountpoint
(18.3 KB)
📄
mv
(139.62 KB)
📄
namei
(34.31 KB)
📄
nawk
(154.66 KB)
📄
netstat
(151.66 KB)
📄
networkctl
(106.38 KB)
📄
newgrp
(47.75 KB)
📄
nice
(42.86 KB)
📄
nisdomainname
(22.15 KB)
📄
nl
(111.11 KB)
📄
nohup
(42.89 KB)
📄
normalizer
(244 B)
📄
nproc
(42.89 KB)
📄
nsenter
(34.54 KB)
📄
nstat
(104.45 KB)
📄
numfmt
(67.02 KB)
📄
od
(79.02 KB)
📄
openssl
(953.26 KB)
📄
pager
(58.31 KB)
📄
paperconf
(14.34 KB)
📄
partx
(118.31 KB)
📄
passwd
(66.65 KB)
📄
paste
(42.89 KB)
📄
pathchk
(42.86 KB)
📄
pdb3
(62.4 KB)
📄
pdb3.11
(62.4 KB)
📄
pdf2dsc
(698 B)
📄
pdf2ps
(909 B)
📄
peekfd
(14.5 KB)
📄
perl
(3.63 MB)
📄
perl5.36-x86_64-linux-gnu
(14.41 KB)
📄
perl5.36.0
(3.63 MB)
📄
perlbug
(44.12 KB)
📄
perldoc
(125 B)
📄
perlivp
(10.61 KB)
📄
perlthanks
(44.12 KB)
📄
pf2afm
(498 B)
📄
pfbtopfa
(516 B)
📄
pgrep
(34.42 KB)
📄
phar
(14.88 KB)
📄
phar.phar
(14.88 KB)
📄
phar.phar8.2
(14.88 KB)
📄
phar8.2
(14.88 KB)
📄
phar8.2.phar
(14.88 KB)
📄
php
(5.4 MB)
📄
php8.2
(5.4 MB)
📄
piconv
(8.16 KB)
📄
pidof
(26.31 KB)
📄
pidwait
(34.42 KB)
📄
pinky
(47.05 KB)
📄
pkill
(34.42 KB)
📄
pl2pm
(4.43 KB)
📄
pldd
(22.69 KB)
📄
pmap
(34.34 KB)
📄
pod2html
(4.04 KB)
📄
pod2man
(14.68 KB)
📄
pod2text
(10.55 KB)
📄
pod2usage
(4.01 KB)
📄
podchecker
(3.57 KB)
📄
pphs
(404 B)
📄
pr
(79.11 KB)
📄
printafm
(395 B)
📄
printenv
(34.83 KB)
📄
printf
(62.92 KB)
📄
prlimit
(38.83 KB)
📄
prove
(13.34 KB)
📄
prtstat
(18.57 KB)
📄
ps
(142.93 KB)
📄
ps2ascii
(631 B)
📄
ps2epsi
(1.23 KB)
📄
ps2pdf
(272 B)
📄
ps2pdf12
(215 B)
📄
ps2pdf13
(215 B)
📄
ps2pdf14
(215 B)
📄
ps2pdfwr
(1.05 KB)
📄
ps2ps
(647 B)
📄
ps2ps2
(669 B)
📄
ps2txt
(631 B)
📄
pslog
(14.45 KB)
📄
pstree
(35.78 KB)
📄
pstree.x11
(35.78 KB)
📄
ptar
(3.48 KB)
📄
ptardiff
(2.58 KB)
📄
ptargrep
(4.29 KB)
📄
ptx
(135.23 KB)
📄
pwd
(42.92 KB)
📄
pwdx
(14.3 KB)
📄
py3clean
(7.63 KB)
📄
py3compile
(13 KB)
📄
py3versions
(12.52 KB)
📄
pydoc3
(79 B)
📄
pydoc3.11
(79 B)
📄
pygettext3
(23.67 KB)
📄
pygettext3.11
(23.67 KB)
📄
python3
(6.52 MB)
📄
python3.11
(6.52 MB)
📄
rbash
(1.21 MB)
📄
rdma
(180.6 KB)
📄
readlink
(50.89 KB)
📄
realpath
(50.92 KB)
📄
rename.ul
(22.3 KB)
📄
renice
(14.3 KB)
📄
reset
(30.24 KB)
📄
resizepart
(70.31 KB)
📄
rev
(14.3 KB)
📄
rgrep
(30 B)
📄
rm
(71.05 KB)
📄
rmdir
(54.92 KB)
📄
rotatelogs
(26.31 KB)
📄
routel
(1.62 KB)
📄
rtstat
(26.59 KB)
📄
run-parts
(26.91 KB)
📄
runcon
(42.95 KB)
📄
rview
(3.48 MB)
📄
rvim
(3.48 MB)
📄
savelog
(10.24 KB)
📄
scp
(266.63 KB)
📄
script
(70.3 KB)
📄
scriptlive
(54.3 KB)
📄
scriptreplay
(46.3 KB)
📄
sdiff
(55.08 KB)
📄
sed
(123.46 KB)
📄
select-editor
(2.39 KB)
📄
sensible-browser
(1.26 KB)
📄
sensible-editor
(1.24 KB)
📄
sensible-pager
(565 B)
📄
seq
(58.92 KB)
📄
setarch
(26.58 KB)
📄
setpriv
(78.31 KB)
📄
setsid
(14.3 KB)
📄
setterm
(46.31 KB)
📄
sftp
(282.59 KB)
📄
sg
(47.75 KB)
📄
sh
(122.7 KB)
📄
sha1sum
(54.95 KB)
📄
sha224sum
(58.95 KB)
📄
sha256sum
(58.95 KB)
📄
sha384sum
(62.95 KB)
📄
sha512sum
(62.95 KB)
📄
shasum
(9.75 KB)
📄
shred
(63.14 KB)
📄
shuf
(58.98 KB)
📄
skill
(30.33 KB)
📄
slabtop
(22.37 KB)
📄
sleep
(42.86 KB)
📄
slogin
(1.07 MB)
📄
snice
(30.33 KB)
📄
sort
(115.68 KB)
📄
splain
(18.99 KB)
📄
split
(59.55 KB)
📄
ss
(189.14 KB)
📄
ssh
(1.07 MB)
📄
ssh-add
(518.44 KB)
📄
ssh-agent
(474.38 KB)
📄
ssh-argv0
(1.42 KB)
📄
ssh-copy-id
(12.38 KB)
📄
ssh-keygen
(646.44 KB)
📄
ssh-keyscan
(622.47 KB)
📄
stat
(95.2 KB)
📄
stdbuf
(58.92 KB)
📄
streamzip
(7.75 KB)
📄
stty
(83.02 KB)
📄
su
(70.31 KB)
📄
sum
(50.96 KB)
📄
sync
(38.89 KB)
📄
systemctl
(1.29 MB)
📄
systemd
(90.38 KB)
📄
systemd-analyze
(182.61 KB)
📄
systemd-ask-password
(18.48 KB)
📄
systemd-cat
(18.38 KB)
📄
systemd-cgls
(22.48 KB)
📄
systemd-cgtop
(38.4 KB)
📄
systemd-creds
(42.61 KB)
📄
systemd-cryptenroll
(58.6 KB)
📄
systemd-delta
(26.38 KB)
📄
systemd-detect-virt
(18.37 KB)
📄
systemd-escape
(18.37 KB)
📄
systemd-firstboot
(50.59 KB)
📄
systemd-id128
(22.37 KB)
📄
systemd-inhibit
(22.39 KB)
📄
systemd-machine-id-setup
(18.48 KB)
📄
systemd-mount
(50.59 KB)
📄
systemd-notify
(18.38 KB)
📄
systemd-path
(18.37 KB)
📄
systemd-repart
(150.69 KB)
📄
systemd-run
(58.57 KB)
📄
systemd-socket-activate
(26.38 KB)
📄
systemd-stdio-bridge
(18.38 KB)
📄
systemd-sysext
(42.49 KB)
📄
systemd-sysusers
(62.68 KB)
📄
systemd-tmpfiles
(110.57 KB)
📄
systemd-tty-ask-password-agent
(34.38 KB)
📄
systemd-umount
(50.59 KB)
📄
tabs
(18.23 KB)
📄
tac
(111.05 KB)
📄
tail
(75.14 KB)
📄
tar
(519.52 KB)
📄
taskset
(62.31 KB)
📄
tee
(42.95 KB)
📄
tempfile
(14.18 KB)
📄
test
(58.89 KB)
📄
tic
(90.34 KB)
📄
timedatectl
(42.37 KB)
📄
timeout
(47.49 KB)
📄
tload
(18.32 KB)
📄
toe
(22.23 KB)
📄
top
(131.58 KB)
📄
touch
(107.05 KB)
📄
tput
(26.27 KB)
📄
tr
(54.89 KB)
📄
true
(34.83 KB)
📄
truncate
(42.89 KB)
📄
tset
(30.24 KB)
📄
tsort
(54.89 KB)
📄
tty
(34.86 KB)
📄
tzselect
(14.99 KB)
📄
ucf
(40.69 KB)
📄
ucfq
(18.91 KB)
📄
ucfr
(10.85 KB)
📄
uclampset
(62.31 KB)
📄
ucs2any
(18.32 KB)
📄
umount
(34.3 KB)
📄
uname
(42.86 KB)
📄
uncompress
(2.29 KB)
📄
unexpand
(42.92 KB)
📄
uniq
(46.95 KB)
📄
unlink
(38.83 KB)
📄
unshare
(82.54 KB)
📄
update-alternatives
(58.31 KB)
📄
update-mime-database
(59.27 KB)
📄
uptime
(14.3 KB)
📄
users
(38.89 KB)
📄
utmpdump
(30.3 KB)
📄
vdir
(147.8 KB)
📄
vi
(3.48 MB)
📄
view
(3.48 MB)
📄
vim
(3.48 MB)
📄
vim.basic
(3.48 MB)
📄
vimdiff
(3.48 MB)
📄
vimtutor
(2.1 KB)
📄
vmstat
(34.72 KB)
📄
w
(22.3 KB)
📄
wall
(38.3 KB)
📄
watch
(26.71 KB)
📄
wc
(51.05 KB)
📄
wdctl
(70.34 KB)
📄
wget
(527.36 KB)
📄
whereis
(30.77 KB)
📄
which
(946 B)
📄
which.debianutils
(946 B)
📄
who
(59.02 KB)
📄
whoami
(38.86 KB)
📄
x86_64
(26.58 KB)
📄
xargs
(70.45 KB)
📄
xdg-user-dir
(234 B)
📄
xdg-user-dirs-update
(26.16 KB)
📄
xsubpp
(5.05 KB)
📄
xxd
(18.21 KB)
📄
yes
(38.83 KB)
📄
ypdomainname
(22.15 KB)
📄
zcat
(1.94 KB)
📄
zcmp
(1.64 KB)
📄
zdiff
(6.31 KB)
📄
zdump
(22.52 KB)
📄
zegrep
(29 B)
📄
zfgrep
(29 B)
📄
zforce
(2.03 KB)
📄
zgrep
(7.91 KB)
📄
zipdetails
(68.55 KB)
📄
zless
(2.15 KB)
📄
zmore
(1.8 KB)
📄
znew
(4.47 KB)
Editing: debconf-apt-progress
#!/usr/bin/perl -w # This file was preprocessed, do not edit! use strict; use POSIX; use Fcntl; use Getopt::Long; use Debconf::Client::ConfModule (); my ($config, $start, $from, $to, $stop); my $progress=1; my $dlwaypoint=15; my ($logfile, $logstderr); my $had_frontend; sub checkopen (@) { my $file = $_[0]; my $fd = POSIX::open($file, &POSIX::O_RDONLY); defined $fd or die "$0: can't open $_[0]: $!\n"; return $fd; } sub checkclose ($) { my $fd = $_[0]; unless (POSIX::close($fd)) { return if $! == &POSIX::EBADF; die "$0: can't close fd $fd: $!\n"; } } sub checkdup2 ($$) { my ($oldfd, $newfd) = @_; checkclose($newfd); POSIX::dup2($oldfd, $newfd) or die "$0: can't dup fd $oldfd to $newfd: $!\n"; } sub nocloexec (*) { my $fh = shift; my $flags = fcntl($fh, F_GETFD, 0); fcntl($fh, F_SETFD, $flags & ~FD_CLOEXEC); } sub nonblock (*) { my $fh = shift; my $flags = fcntl($fh, F_GETFL, 0); fcntl($fh, F_SETFL, $flags | O_NONBLOCK); } sub reservefds (@) { my $null = checkopen('/dev/null'); my $close = 1; for my $fd (@_) { if ($null == $fd) { $close = 0; } else { checkclose($fd); checkdup2($null, $fd); } } if ($close) { checkclose($null); } } sub envnonempty ($) { my $name = shift; return (exists $ENV{$name} and $ENV{$name} ne ''); } sub start_debconf (@) { if (! $ENV{DEBIAN_HAS_FRONTEND}) { if (envnonempty('DEBCONF_DB_REPLACE')) { $ENV{DEBCONF_APT_PROGRESS_DB_REPLACE} = $ENV{DEBCONF_DB_REPLACE}; } if (envnonempty('DEBCONF_DB_OVERRIDE')) { $ENV{DEBCONF_APT_PROGRESS_DB_OVERRIDE} = $ENV{DEBCONF_DB_OVERRIDE}; } $ENV{DEBCONF_DB_REPLACE} = 'configdb'; $ENV{DEBCONF_DB_OVERRIDE} = 'Pipe{infd:none outfd:none}'; $ENV{DEBCONF_APT_PROGRESS_NO_FRONTEND} = 1; @ARGV = @_; } import Debconf::Client::ConfModule; } sub passthrough (@) { my $priority = Debconf::Client::ConfModule::get('debconf/priority'); defined(my $pid = fork) or die "$0: can't fork: $!\n"; if (!$pid) { close STATUS_READ; close COMMAND_WRITE; close DEBCONF_COMMAND_READ; close DEBCONF_REPLY_WRITE; $^F = 6; # avoid close-on-exec if (fileno(COMMAND_READ) != 0) { checkdup2(fileno(COMMAND_READ), 0); close COMMAND_READ; } if (fileno(APT_LOG) != 1) { checkclose(1); checkdup2(fileno(APT_LOG), 1); } if (fileno(APT_LOG) != 2) { checkclose(2); checkdup2(fileno(APT_LOG), 2); } close APT_LOG; delete $ENV{DEBIAN_HAS_FRONTEND}; delete $ENV{DEBCONF_REDIR}; delete $ENV{DEBCONF_SYSTEMRC}; delete $ENV{DEBCONF_PIPE}; # just in case ... $ENV{DEBIAN_FRONTEND} = 'passthrough'; $ENV{DEBIAN_PRIORITY} = $priority; $ENV{DEBCONF_READFD} = 5; $ENV{DEBCONF_WRITEFD} = 6; $ENV{APT_LISTCHANGES_FRONTEND} = 'none'; if ($had_frontend) { $ENV{DEBCONF_DB_REPLACE} = 'configdb'; $ENV{DEBCONF_DB_OVERRIDE} = 'Pipe{infd:none outfd:none}'; } exec @_; } close STATUS_WRITE; close COMMAND_READ; close DEBCONF_COMMAND_WRITE; close DEBCONF_REPLY_READ; return $pid; } sub handle_status ($$$) { my ($from, $to, $line) = @_; my ($status, $pkg, $percent, $description) = split ':', $line, 4; my ($min, $len); if ($status eq 'dlstatus') { $min = 0; $len = $dlwaypoint; } elsif ($status eq 'pmstatus') { $min = $dlwaypoint; $len = 100 - $dlwaypoint; } elsif ($status eq 'media-change') { Debconf::Client::ConfModule::subst( 'debconf-apt-progress/media-change', 'MESSAGE', $description); my @ret = Debconf::Client::ConfModule::input( 'critical', 'debconf-apt-progress/media-change'); $ret[0] == 0 or die "Can't display media change request!\n"; Debconf::Client::ConfModule::go(); print COMMAND_WRITE "\n" || die "can't talk to command fd: $!"; return; } else { return; } $percent = ($percent * $len / 100 + $min); $percent = ($percent * ($to - $from) / 100 + $from); $percent =~ s/\..*//; if ($progress) { my @ret=Debconf::Client::ConfModule::progress('SET', $percent); if ($ret[0] eq '30') { cancel(); } } Debconf::Client::ConfModule::subst( 'debconf-apt-progress/info', 'DESCRIPTION', $description); my @ret=Debconf::Client::ConfModule::progress( 'INFO', 'debconf-apt-progress/info'); if ($ret[0] eq '30') { cancel(); } } sub handle_debconf_command ($) { my $line = shift; print "$line\n" || die "can't write to stdout: $!"; my $ret = <STDIN>; chomp $ret; print DEBCONF_REPLY_WRITE "$ret\n" || die "can't write to DEBCONF_REPLY_WRITE: $!"; } my $pid; sub run_progress ($$@) { my $from = shift; my $to = shift; my $command = shift; local (*STATUS_READ, *STATUS_WRITE); local (*COMMAND_READ, *COMMAND_WRITE); local (*DEBCONF_COMMAND_READ, *DEBCONF_COMMAND_WRITE); local (*DEBCONF_REPLY_READ, *DEBCONF_REPLY_WRITE); local *APT_LOG; use IO::Handle; if ($progress) { my @ret=Debconf::Client::ConfModule::progress( 'INFO', 'debconf-apt-progress/preparing'); if ($ret[0] eq '30') { cancel(); return 30; } } reservefds(4, 5, 6); pipe STATUS_READ, STATUS_WRITE or die "$0: can't create status pipe: $!"; nonblock(\*STATUS_READ); checkdup2(fileno(STATUS_WRITE), 4); open STATUS_WRITE, '>&=4' or die "$0: can't reopen STATUS_WRITE as fd 4: $!"; nocloexec(\*STATUS_WRITE); pipe COMMAND_READ, COMMAND_WRITE or die "$0: can't create command pipe: $!"; nocloexec(\*COMMAND_READ); COMMAND_WRITE->autoflush(1); pipe DEBCONF_COMMAND_READ, DEBCONF_COMMAND_WRITE or die "$0: can't create debconf command pipe: $!"; nonblock(\*DEBCONF_COMMAND_READ); checkdup2(fileno(DEBCONF_COMMAND_WRITE), 6); open DEBCONF_COMMAND_WRITE, '>&=6' or die "$0: can't reopen DEBCONF_COMMAND_WRITE as fd 6: $!"; nocloexec(\*DEBCONF_COMMAND_WRITE); pipe DEBCONF_REPLY_READ, DEBCONF_REPLY_WRITE or die "$0: can't create debconf reply pipe: $!"; checkdup2(fileno(DEBCONF_REPLY_READ), 5); open DEBCONF_REPLY_READ, '<&=5' or die "$0: can't reopen DEBCONF_REPLY_READ as fd 5: $!"; nocloexec(\*DEBCONF_REPLY_READ); DEBCONF_REPLY_WRITE->autoflush(1); if (defined $logfile) { open APT_LOG, '>>', $logfile or die "$0: can't open $logfile: $!"; } elsif ($logstderr) { open APT_LOG, '>&STDERR' or die "$0: can't duplicate stderr: $!"; } else { open APT_LOG, '>', '/dev/null' or die "$0: can't open /dev/null: $!"; } nocloexec(\*APT_LOG); $pid = passthrough $command, '-o', 'APT::Status-Fd=4', '-o', 'APT::Keep-Fds::=5', '-o', 'APT::Keep-Fds::=6', @_; my $status_eof = 0; my $debconf_command_eof = 0; my $status_buf = ''; my $debconf_command_buf = ''; while (not $status_eof) { my $rin = ''; my $rout; vec($rin, fileno(STATUS_READ), 1) = 1; vec($rin, fileno(DEBCONF_COMMAND_READ), 1) = 1 unless $debconf_command_eof; my $sel = select($rout = $rin, undef, undef, undef); if ($sel < 0) { next if $! == &POSIX::EINTR; die "$0: select failed: $!"; } if (vec($rout, fileno(STATUS_READ), 1) == 1) { while (1) { my $r = sysread(STATUS_READ, $status_buf, 4096, length $status_buf); if (not defined $r) { next if $! == &POSIX::EINTR; last if $! == &POSIX::EAGAIN or $! == &POSIX::EWOULDBLOCK; die "$0: read STATUS_READ failed: $!"; } elsif ($r == 0) { if ($status_buf ne '' and $status_buf !~ /\n$/) { $status_buf .= "\n"; } $status_eof = 1; last; } last if $status_buf =~ /\n/; } while ($status_buf =~ /\n/) { my $status_line; ($status_line, $status_buf) = split /\n/, $status_buf, 2; handle_status $from, $to, $status_line; } } if (vec($rout, fileno(DEBCONF_COMMAND_READ), 1) == 1) { while (1) { my $r = sysread(DEBCONF_COMMAND_READ, $debconf_command_buf, 4096, length $debconf_command_buf); if (not defined $r) { next if $! == &POSIX::EINTR; last if $! == &POSIX::EAGAIN or $! == &POSIX::EWOULDBLOCK; die "$0: read DEBCONF_COMMAND_READ " . "failed: $!"; } elsif ($r == 0) { if ($debconf_command_buf ne '' and $debconf_command_buf !~ /\n$/) { $debconf_command_buf .= "\n"; } $debconf_command_eof = 1; last; } last if $debconf_command_buf =~ /\n/; } while ($debconf_command_buf =~ /\n/) { my $debconf_command_line; ($debconf_command_line, $debconf_command_buf) = split /\n/, $debconf_command_buf, 2; handle_debconf_command $debconf_command_line; } } } waitpid $pid, 0; undef $pid; my $status = $?; if ($progress) { my @ret=Debconf::Client::ConfModule::progress('SET', $to); if ($ret[0] eq '30') { cancel(); } } if ($status & 127) { return 127; } return ($status >> 8); } my $cancelled=0; my $cancel_sent_signal=0; sub cancel () { $cancelled++; if (defined $pid) { $cancel_sent_signal++; if ($cancel_sent_signal == 1) { kill INT => $pid; } else { kill KILL => $pid; } } } sub start_bar ($$) { my ($from, $to) = @_; if ($progress) { Debconf::Client::ConfModule::progress( 'START', $from, $to, 'debconf-apt-progress/title'); my @ret=Debconf::Client::ConfModule::progress( 'INFO', 'debconf-apt-progress/preparing'); if ($ret[0] eq '30') { cancel(); } } } sub stop_bar () { Debconf::Client::ConfModule::progress('STOP') if $progress; Debconf::Client::ConfModule::stop() unless $had_frontend; } if (envnonempty('DEBCONF_APT_PROGRESS_DB_REPLACE')) { $ENV{DEBCONF_DB_REPLACE} = $ENV{DEBCONF_APT_PROGRESS_DB_REPLACE}; } else { delete $ENV{DEBCONF_DB_REPLACE}; } if (envnonempty('DEBCONF_APT_PROGRESS_DB_OVERRIDE')) { $ENV{DEBCONF_DB_OVERRIDE} = $ENV{DEBCONF_APT_PROGRESS_DB_OVERRIDE}; } else { delete $ENV{DEBCONF_DB_OVERRIDE}; } $had_frontend = 1 unless $ENV{DEBCONF_APT_PROGRESS_NO_FRONTEND}; delete $ENV{DEBCONF_APT_PROGRESS_NO_FRONTEND}; # avoid inheritance my @saved_argv = @ARGV; my $result = GetOptions('config' => \$config, 'start' => \$start, 'from=i' => \$from, 'to=i' => \$to, 'stop' => \$stop, 'logfile=s' => \$logfile, 'logstderr' => \$logstderr, 'progress!' => \$progress, 'dlwaypoint=i' => \$dlwaypoint, ); if (! $progress && ($start || $from || $to || $stop)) { die "--no-progress cannot be used with --start, --from, --to, or --stop\n"; } unless ($start) { if (defined $from and not defined $to) { die "$0: --from requires --to\n"; } elsif (defined $to and not defined $from) { die "$0: --to requires --from\n"; } } my $mutex = 0; ++$mutex if $config; ++$mutex if $start; ++$mutex if $stop; if ($mutex > 1) { die "$0: must use only one of --config, --start, or --stop\n"; } if (($config or $stop) and (defined $from or defined $to)) { die "$0: cannot use --from or --to with --config or --stop\n"; } start_debconf(@saved_argv) unless $config; my $status = 0; if ($config) { print <<'EOF'; DEBCONF_APT_PROGRESS_DB_REPLACE="$DEBCONF_DB_REPLACE" DEBCONF_APT_PROGRESS_DB_OVERRIDE="$DEBCONF_DB_OVERRIDE" export DEBCONF_APT_PROGRESS_DB_REPLACE DEBCONF_APT_PROGRESS_DB_OVERRIDE DEBCONF_DB_REPLACE=configdb DEBCONF_DB_OVERRIDE='Pipe{infd:none outfd:none}' export DEBCONF_DB_REPLACE DEBCONF_DB_OVERRIDE EOF } elsif ($start) { $from = 0 unless defined $from; $to = 100 unless defined $to; start_bar($from, $to); } elsif (defined $from) { $status = run_progress($from, $to, @ARGV); } elsif ($stop) { stop_bar(); } else { start_bar(0, 100); if (! $cancelled) { $status = run_progress(0, 100, @ARGV); stop_bar(); } } if ($cancelled) { Debconf::Client::ConfModule::get("debconf/priority"); exit 30; } elsif ($status == 30) { exit 3; } else { exit $status; }
Upload File
Create Folder