mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
* extfs/deb.in (mcdebfs_list): Separated the use of quoted and unquoted variables. (mcdebfs_copyout): likewise. (mcdebfs_run): likewise. From Leonard den Ottolander <leonard@den.ottolander.nl>
This commit is contained in:
parent
2c4ca680bb
commit
a37fdaca96
@ -1,3 +1,11 @@
|
||||
2004-08-19 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* extfs/deb.in (mcdebfs_list): Separated the use of quoted and
|
||||
unquoted variables. (mcdebfs_copyout): likewise.
|
||||
(mcdebfs_run): likewise.
|
||||
|
||||
From Leonard den Ottolander <leonard@den.ottolander.nl>
|
||||
|
||||
2004-08-19 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* extfs/deba.in (list): Separated the use of quoted and unquoted
|
||||
|
@ -26,8 +26,10 @@ sub mcdebfs_list
|
||||
# Empty directories do not appear at all
|
||||
#
|
||||
local($archivename)=@_;
|
||||
local $qarchivename = $archivename;
|
||||
$qarchivename =~ s/([^\w\/.+-])/\\$1/g;
|
||||
chop($date=`LC_ALL=C date "+%b %d %Y %H:%M"`);
|
||||
chop($info_size=`dpkg -I $archivename | wc -c`);
|
||||
chop($info_size=`dpkg -I $qarchivename | wc -c`);
|
||||
$install_size=length($pressinstall);
|
||||
|
||||
print "dr-xr-xr-x 1 root root 0 $date CONTENTS\n";
|
||||
@ -36,7 +38,7 @@ sub mcdebfs_list
|
||||
print "-r--r--r-- 1 root root $info_size $date INFO\n";
|
||||
print "-r-xr--r-- 1 root root $install_size $date INSTALL\n";
|
||||
|
||||
if ( open(PIPEIN, "dpkg-deb -c $archivename |") )
|
||||
if ( open(PIPEIN, "dpkg-deb -c $qarchivename |") )
|
||||
{
|
||||
while(<PIPEIN>)
|
||||
{
|
||||
@ -81,7 +83,7 @@ sub mcdebfs_list
|
||||
}
|
||||
}
|
||||
# begin from Patrik Rak
|
||||
if ( open(PIPEIN, "dpkg-deb -I $archivename |") )
|
||||
if ( open(PIPEIN, "dpkg-deb -I $qarchivename |") )
|
||||
{
|
||||
while(<PIPEIN>)
|
||||
{
|
||||
@ -109,16 +111,22 @@ sub mcdebfs_list
|
||||
sub mcdebfs_copyout
|
||||
{
|
||||
local($archive,$filename,$destfile)=@_;
|
||||
local $qarchive = $archive;
|
||||
$qarchive =~ s/([^\w\/.+-])/\\$1/g;
|
||||
local $qfilename = $filename;
|
||||
$qfilename =~ s/([^\w\/.+-])/\\$1/g;
|
||||
local $qdestfile = $destfile;
|
||||
$qdestfile =~ s/([^\w\/.+-])/\\$1/g;
|
||||
|
||||
if($filename eq "INFO")
|
||||
{
|
||||
system("dpkg-deb -I $archive > $destfile");
|
||||
system("dpkg-deb -I $qarchive > $qdestfile");
|
||||
# begin from Patrik Rak
|
||||
}
|
||||
elsif($filename =~ /^DEBIAN/)
|
||||
{
|
||||
$filename=~s!^DEBIAN/!!;
|
||||
system("dpkg-deb -I $archive $filename > $destfile");
|
||||
system("dpkg-deb -I $qarchive $qfilename > $qdestfile");
|
||||
# end from Patrik Rak
|
||||
|
||||
}
|
||||
@ -128,24 +136,26 @@ sub mcdebfs_copyout
|
||||
{
|
||||
print FILEOUT $pressinstall;
|
||||
close FILEOUT;
|
||||
system("chmod a+x $destfile");
|
||||
system("chmod a+x $qdestfile");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# files can be prepended with ./ or not, depending on the version of tar
|
||||
$filename=~s!^CONTENTS/!!;
|
||||
system("dpkg-deb --fsys-tarfile $archive | tar xOf - $filename ./$filename > $destfile 2>/dev/null");
|
||||
system("dpkg-deb --fsys-tarfile $qarchive | tar xOf - $qfilename ./$qfilename > $qdestfile 2>/dev/null");
|
||||
}
|
||||
}
|
||||
|
||||
sub mcdebfs_run
|
||||
{
|
||||
local($archive,$filename)=@_;
|
||||
local $qarchive = $archive;
|
||||
$qarchive =~ s/([^\w\/.+-])/\\$1/g;
|
||||
if($filename eq "INSTALL")
|
||||
{
|
||||
print "Installing $archive\n";
|
||||
system("dpkg -i $archive");
|
||||
system("dpkg -i $qarchive");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user