diff --git a/pisi-spec.dtd b/pisi-spec.dtd index 9dd53354daafd6329d7a021946d07adefcb7d02d..cd54f52de4aa1d5149584349cd95056c1489239f 100644 --- a/pisi-spec.dtd +++ b/pisi-spec.dtd @@ -117,6 +117,7 @@ suck anyway --> (executable|library|data|config|doc|man|info|localedata|header) #REQUIRED> + diff --git a/pisi-spec.rng b/pisi-spec.rng index 85c17d966ac5480eca78bb4506f5760d5ea72b0a..eb09c011896d67b66dbf87c0b681dcca3912d581 100644 --- a/pisi-spec.rng +++ b/pisi-spec.rng @@ -1521,6 +1521,14 @@ + + + + false + true + + + diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 0d5c23168af33e994ddd0877b2696fc2ec112e46..970bdc087b525c5bb67447d275f9b3609cecc30b 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -204,7 +204,7 @@ class Install(AtomicOperation): return True return not pkg in map(lambda x:x.package, self.pkginfo.conflicts) - + # check file conflicts file_conflicts = [] for f in self.files.list: @@ -390,8 +390,8 @@ class Install(AtomicOperation): Remove.remove_file(old_fileinfo[path], self.pkginfo.name) if self.reinstall(): - # get 'config' typed file objects - new = filter(lambda x: x.type == 'config', self.files.list) + # get 'config' typed file objects if replace is not set + new = filter(lambda x: x.type == 'config' and not x.replace, self.files.list) old = filter(lambda x: x.type == 'config', self.old_files.list) # get config path lists @@ -530,7 +530,7 @@ class Remove(AtomicOperation): if fileinfo.permanent and not remove_permanent: return - + fpath = pisi.util.join_path(ctx.config.dest_dir(), fileinfo.path) historydb = pisi.db.historydb.HistoryDB() diff --git a/pisi/files.py b/pisi/files.py index 67560e3aa182eb339c2aa9734f2af40fe21dabeb..93bee71dd92e5399f1878acd2e6334d456b581a2 100644 --- a/pisi/files.py +++ b/pisi/files.py @@ -29,6 +29,7 @@ class FileInfo: t_Mode = [ autoxml.String, autoxml.optional ] t_Hash = [ autoxml.String, autoxml.optional, "SHA1Sum" ] t_Permanent = [ autoxml.String, autoxml.optional ] + t_Replace = [ autoxml.String, autoxml.optional ] def __str__(self): s = "/%s, type: %s, size: %s, sha1sum: %s" % (self.path, self.type, diff --git a/pisi/specfile.py b/pisi/specfile.py index 94a4315f8eceaa2d7523dffcdaebb19262392263..82ba920b6b129d05abbbb1a36a2784e3bf5bb98d 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -127,6 +127,7 @@ class Path: s_Path = [autoxml.String, autoxml.mandatory] a_fileType = [autoxml.String, autoxml.optional] a_permanent = [autoxml.String, autoxml.optional] + a_replace = [autoxml.String, autoxml.optional] def __str__(self): s = self.path