* implement a permanent flag to prevent removal of precious files

This commit is contained in:
Eray Özkural
2005-12-23 22:25:04 +00:00
parent fdb8555cd0
commit a735513970
3 changed files with 7 additions and 1 deletions
+2 -1
View File
@@ -11,5 +11,6 @@ Main features
- Integrates both low-level and high-level package operations. - Integrates both low-level and high-level package operations.
- Efficient and small - Efficient and small
- Framework approach to build applications and tools upon - 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 - Extremely simple package construction
+4
View File
@@ -374,6 +374,10 @@ class Remove(AtomicOperation):
# usage. Currently we'are doing it like rpm does, saving # usage. Currently we'are doing it like rpm does, saving
# with a prefix and leaving the user to edit it. In the future # with a prefix and leaving the user to edit it. In the future
# we'll have a plan for these configuration files. # 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 fileinfo.type == "config":
if os.path.isfile(fpath): if os.path.isfile(fpath):
os.rename(fpath, fpath + ".oldconfig") os.rename(fpath, fpath + ".oldconfig")
+1
View File
@@ -29,6 +29,7 @@ class FileInfo:
t_Type = [ autoxml.String, autoxml.mandatory ] t_Type = [ autoxml.String, autoxml.mandatory ]
t_Size = [ autoxml.Long, autoxml.optional ] t_Size = [ autoxml.Long, autoxml.optional ]
t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ] t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ]
t_Permanent = [ autoxml.String, autoxml.optional ]
def __str__(self): def __str__(self):
s = "%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type, s = "%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type,