From 70de286ce338d12645aa0b2225906213e670128d Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sun, 21 Jul 2002 13:36:39 +0000 Subject: [PATCH] Auto-detect RPM format files. Preserve permissions when compressing or extracting streams. git-svn-id: https://rox.svn.sourceforge.net/svnroot/rox/trunk/Archive@1739 66de3db3-b00d-0410-b41b-f4738ad19bea --- AppInfo.xml | 2 +- Help/Changes | 5 +++++ box.py | 1 + formats.py | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/AppInfo.xml b/AppInfo.xml index 6e4c755..ae38580 100644 --- a/AppInfo.xml +++ b/AppInfo.xml @@ -4,7 +4,7 @@ Such files usually have names ending in .gz, .tar, .tgz, .bz2, .rar or .zip. Create and read archive files - 1.9.0 (20-Jul-2002) + 1.9.1 PREVIEW Thomas Leonard GNU General Public License http://rox.sourceforge.net diff --git a/Help/Changes b/Help/Changes index 6e868f4..a13101b 100644 --- a/Help/Changes +++ b/Help/Changes @@ -2,6 +2,11 @@ A simple archiver by Thomas Leonard +21-Jul-2002 +~~~~~~~~~~~ +Auto-detect RPM format files. +Preserve permissions when compressing or extracting streams. + 20-Jul-2002 (Release 1.9.0) ~~~~~~~~~~~ Finished upgrading to Gtk+-2.0. diff --git a/box.py b/box.py index 5c1511e..ff8fa3c 100644 --- a/box.py +++ b/box.py @@ -40,6 +40,7 @@ class ArchiveBox(saving.SaveBox, saving.Saveable): assert not self.data self.data = data + self.save_mode = data.mode ops = [op for op in formats.operations if op.can_handle(data)] name = data.default_name diff --git a/formats.py b/formats.py index 437221e..6622654 100644 --- a/formats.py +++ b/formats.py @@ -165,6 +165,7 @@ for x in operations: class FileData: "A file on the local filesystem." + mode = None def __init__(self, path): self.path = path @@ -173,6 +174,7 @@ class FileData: else: try: source = file(path) + self.mode = os.stat(path).st_mode except: rox.report_exception() sys.exit(1) @@ -231,6 +233,7 @@ class FileData: return deb if string(0, 'Rar!'): return rar if string(0, 'PK\003\004'): return zip + if string(0, '\xed\xab\xee\xdb'): return rpm # Compressed streams if string(0, '\037\213'): @@ -246,6 +249,7 @@ class FileData: return make_gz class DirData: + mode = None def __init__(self, path): self.path = path self.default = make_tgz -- 2.11.4.GIT