From a7355139704b0c02f4c2b79e0f9aa5442e7ab5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Fri, 23 Dec 2005 22:25:04 +0000 Subject: [PATCH] * implement a permanent flag to prevent removal of precious files --- README | 3 ++- pisi/atomicoperations.py | 4 ++++ pisi/files.py | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README b/README index 1f8da587..c5fb0028 100644 --- a/README +++ b/README @@ -11,5 +11,6 @@ Main features - Integrates both low-level and high-level package operations. - Efficient and small - Framework approach to build applications and tools upon - - Comprehensive CLI and a user-friendly qt-based GUI + - Comprehensive CLI and a user-friendly qt-based GUI (GUI + distributed separately) - Extremely simple package construction diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 439b2962..31713b8c 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -374,6 +374,10 @@ class Remove(AtomicOperation): # usage. Currently we'are doing it like rpm does, saving # with a prefix and leaving the user to edit it. In the future # we'll have a plan for these configuration files. + if fileinfo.permanent: + # do not remove precious files :) + # just write anything permanent="true" for instance + return if fileinfo.type == "config": if os.path.isfile(fpath): os.rename(fpath, fpath + ".oldconfig") diff --git a/pisi/files.py b/pisi/files.py index 00b0f73e..4c4cd447 100644 --- a/pisi/files.py +++ b/pisi/files.py @@ -29,6 +29,7 @@ class FileInfo: t_Type = [ autoxml.String, autoxml.mandatory ] t_Size = [ autoxml.Long, autoxml.optional ] t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ] + t_Permanent = [ autoxml.String, autoxml.optional ] def __str__(self): s = "%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type,