summaryrefslogtreecommitdiffstats
path: root/ark/zip.cpp
diff options
context:
space:
mode:
authormio <stigma@disroot.org>2025-04-17 21:51:04 +1000
committermio <stigma@disroot.org>2025-04-17 21:51:04 +1000
commit9e80634e0debde20cdb62dbbae49e1728b5579e4 (patch)
treeb97956343ff8c9a97f542f2cd6b5f22ff79c9ef0 /ark/zip.cpp
parent3a179b33ef4299990486901782802a626bb68b88 (diff)
downloadtdeutils-9e80634e0debde20cdb62dbbae49e1728b5579e4.tar.gz
tdeutils-9e80634e0debde20cdb62dbbae49e1728b5579e4.zip
ark: Drop support for unzip v5
Signed-off-by: mio <stigma@disroot.org>
Diffstat (limited to 'ark/zip.cpp')
-rw-r--r--ark/zip.cpp57
1 files changed, 6 insertions, 51 deletions
diff --git a/ark/zip.cpp b/ark/zip.cpp
index 88bd97d..598f5fd 100644
--- a/ark/zip.cpp
+++ b/ark/zip.cpp
@@ -51,66 +51,21 @@ ZipArch::ZipArch( ArkWidget *_gui, const TQString & _fileName )
verifyCompressUtilityIsAvailable( m_archiver_program );
verifyUncompressUtilityIsAvailable( m_unarchiver_program );
- // Compatibility with unzip v5 and v6.
- // - unzip 5 prints dates as MM-DD-YY.
- // - unzip 6 prints dates as YYYY-MM-DD.
- // Presume version 6 as it was released in 2009.
- bool unzipV5 = false;
- if (m_bUnarchUtilityIsAvailable)
- {
- TDEProcIO proc;
- proc << m_unarchiver_program;
- proc << "-v";
- if (proc.start(TDEProcIO::Block))
- {
- proc.wait();
- if (proc.normalExit() && proc.exitStatus() == 0)
- {
- TQString line;
- proc.readln(line);
- auto parts = TQStringList::split(' ', line);
- unzipV5 = (parts.size() >= 2) && (parts[1][0] == '5');
- }
- }
- }
-
m_headerString = "----";
+ m_fixYear = 7;
+ m_fixMonth = 8;
+ m_fixDay = 9;
m_fixTime = 10;
m_dateCol = 5;
m_numCols = 7;
- if (unzipV5)
- {
- kdDebug(1601) << "ZipArch: unzip v5 detected." << endl;
- m_repairYear = 9;
- m_fixMonth = 7;
- m_fixDay = 8;
- }
- else
- {
- m_fixYear = 7;
- m_fixMonth = 8;
- m_fixDay = 9;
- }
-
m_archCols.append( new ArchColumns( 1, TQRegExp( "[0-9]+" ) ) );
m_archCols.append( new ArchColumns( 2, TQRegExp( "[^\\s]+" ) ) );
m_archCols.append( new ArchColumns( 3, TQRegExp( "[0-9]+" ) ) );
m_archCols.append( new ArchColumns( 4, TQRegExp( "[0-9.]+%" ) ) );
-
- if (unzipV5)
- {
- m_archCols.append( new ArchColumns( 7, TQRegExp( "[01][0-9]" ), 2 ) );
- m_archCols.append( new ArchColumns( 8, TQRegExp( "[0-3][0-9]" ), 2 ) );
- m_archCols.append( new ArchColumns( 9, TQRegExp( "[0-9][0-9]" ), 2 ) );
- }
- else
- {
- m_archCols.append( new ArchColumns( 7, TQRegExp( "[0-9]{4}" ), 4 ) );
- m_archCols.append( new ArchColumns( 8, TQRegExp( "[01][0-9]" ), 2 ) );
- m_archCols.append( new ArchColumns( 9, TQRegExp( "[0-3][0-9]" ), 2 ) );
- }
-
+ m_archCols.append( new ArchColumns( 7, TQRegExp( "[0-9]{4}" ), 4 ) );
+ m_archCols.append( new ArchColumns( 8, TQRegExp( "[01][0-9]" ), 2 ) );
+ m_archCols.append( new ArchColumns( 9, TQRegExp( "[0-3][0-9]" ), 2 ) );
m_archCols.append( new ArchColumns( 10, TQRegExp( "[0-9:]+" ), 6 ) );
m_archCols.append( new ArchColumns( 6, TQRegExp( "[a-fA-F0-9]+ {2}" ) ) );
m_archCols.append( new ArchColumns( 0, TQRegExp( "[^\\n]+" ), 4096 ) );