[pacman-dev] Removing directory symlink support

Andrew Gregory andrew.gregory.8 at gmail.com
Sat Apr 13 00:48:06 EDT 2013


On 04/12/13 at 03:59pm, Allan McRae wrote:
> I wanted to discuss the removal of directory symlink support again
> because there was not much response on the list last time.
<snip> 
> 5) It believe it would actually make replacing /bin and /sbin able to
> occur in a single transaction (no --ignore filesystem) as we can replace
> a completely removed directory by a file.

Sadly, this is not the case.  In order for that to work, the directory
to file transition logic in conflict.c would have to be able to take
the packages being upgraded into account, which would require more
complex transaction ordering logic than what we have now.

Adding packages being removed as conflicts to the dir->file logic,
however, was pretty easy once symlinks were removed, so I've added
that, which fixes FS#32770.

To better illustrate the effect removing symlink support has, here are
the tests whose results changed from my no-symlink branch.

---
 fileconflict013.py |    4 ++--
 fileconflict023.py |    6 +++---
 fileconflict025.py |    6 +++---
 symlink001.py      |    9 ++++-----
 sync700.py         |    9 ++++-----
 sync701.py         |    9 ++++-----
 sync702.py         |    9 ++++-----
 10 files changed, 42 insertions(+), 29 deletions(-)

diff --git a/test/pacman/tests/fileconflict013.py b/test/pacman/tests/fileconflict013.py
index a83923c..94c169d 100644
--- a/test/pacman/tests/fileconflict013.py
+++ b/test/pacman/tests/fileconflict013.py
@@ -1,20 +1,20 @@
 self.description = "file->file path change with same effective path (/lib as symlink)"
 
 lp1 = pmpkg("filesystem", "1.0-1")
 lp1.files = ["usr/",
              "usr/lib/",
              "lib -> usr/lib/"]
 self.addpkg2db("local", lp1)
 
 lp2 = pmpkg("pkg1", "1.0-1")
 lp2.files = ["lib/libfoo.so"]
 self.addpkg2db("local", lp2)
 
 sp1 = pmpkg("pkg1", "1.0-2")
 sp1.files = ["usr/lib/libfoo.so"]
 self.addpkg2db("sync", sp1)
 
 self.args = "-Su"
 
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_VERSION=pkg1|1.0-1")
diff --git a/test/pacman/tests/fileconflict023.py b/test/pacman/tests/fileconflict023.py
index ce72087..1367080 100644
--- a/test/pacman/tests/fileconflict023.py
+++ b/test/pacman/tests/fileconflict023.py
@@ -1,18 +1,18 @@
 self.description = "File conflict between package with symlink and package with real path resolved by removal"
 
 self.filesystem = ["usr/", "usr/lib/", "lib -> usr/lib/"]
 
 lp1 = pmpkg("foo")
 lp1.files = ["lib/", "lib/file"]
 self.addpkg2db("local", lp1)
 
 sp1 = pmpkg("bar")
 sp1.conflicts = ["foo"]
 sp1.files = ["usr/", "usr/lib/", "usr/lib/file"]
 self.addpkg2db("sync", sp1)
 
 self.args = "-S %s --ask=4" % sp1.name
 
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("!PKG_EXIST=foo")
-self.addrule("PKG_EXIST=bar")
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_EXIST=foo")
+self.addrule("!PKG_EXIST=bar")
diff --git a/test/pacman/tests/fileconflict025.py b/test/pacman/tests/fileconflict025.py
index 3c6f063..013c223 100644
--- a/test/pacman/tests/fileconflict025.py
+++ b/test/pacman/tests/fileconflict025.py
@@ -1,18 +1,18 @@
 self.description = "File conflict between package with symlink and package with real path resolved by removal (reversed)"
 
 self.filesystem = ["usr/lib/", "lib -> usr/lib/"]
 
 lp1 = pmpkg("foo")
 lp1.files = ["usr/", "usr/lib/", "usr/lib/file"]
 self.addpkg2db("local", lp1)
 
 sp1 = pmpkg("bar")
 sp1.conflicts = ["foo"]
 sp1.files = ["lib/", "lib/file"]
 self.addpkg2db("sync", sp1)
 
 self.args = "-S %s --ask=4" % sp1.name
 
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("!PKG_EXIST=foo")
-self.addrule("PKG_EXIST=bar")
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("PKG_EXIST=foo")
+self.addrule("!PKG_EXIST=bar")
diff --git a/test/pacman/tests/symlink001.py b/test/pacman/tests/symlink001.py
index cbf71cc..9136551 100644
--- a/test/pacman/tests/symlink001.py
+++ b/test/pacman/tests/symlink001.py
@@ -1,20 +1,19 @@
 self.description = "Dir symlinks overwritten on install (the perl/git bug)"
 
 lp = pmpkg("dummy")
 lp.files = ["dir/realdir/",
             "dir/symdir -> realdir"]
 self.addpkg2db("local", lp)
 
 p = pmpkg("pkg1")
 p.files = ["dir/symdir/tmp"]
 self.addpkg(p)
 
 self.args = "-U %s" % p.filename()
 
-self.addrule("PACMAN_RETCODE=0")
-self.addrule("PKG_EXIST=pkg1")
-self.addrule("FILE_EXIST=dir/symdir/tmp")
-self.addrule("FILE_EXIST=dir/realdir/tmp")
-self.addrule("FILE_TYPE=dir/symdir/tmp|file")
+self.addrule("PACMAN_RETCODE=1")
+self.addrule("!PKG_EXIST=pkg1")
+self.addrule("!FILE_EXIST=dir/symdir/tmp")
+self.addrule("!FILE_EXIST=dir/realdir/tmp")
 self.addrule("FILE_TYPE=dir/symdir|link")
 self.addrule("FILE_TYPE=dir/realdir|dir")
diff --git a/test/pacman/tests/sync700.py b/test/pacman/tests/sync700.py
index 9748c81..8e908e0 100644
--- a/test/pacman/tests/sync700.py
+++ b/test/pacman/tests/sync700.py
@@ -1,22 +1,21 @@
 self.description = "do not remove directory symlink if another package has file in its path"
 
 lp1 = pmpkg("pkg1")
 lp1.files = ["usr/lib/foo",
              "lib -> usr/lib"]
 self.addpkg2db("local", lp1)
 
 lp2 = pmpkg("pkg2")
 lp2.files = ["lib/bar"]
 self.addpkg2db("local", lp2)
 
 p = pmpkg("pkg1", "1.0-2")
 p.files = ["usr/lib/foo"]
 self.addpkg2db("sync", p)
 
 self.args = "-S pkg1"
 
-self.addrule("PACMAN_RETCODE=1")
-self.addrule("PKG_VERSION=pkg1|1.0-1")
-self.addrule("FILE_EXIST=lib/bar")
-
-self.expectfailure = True
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("FILE_EXIST=usr/lib/bar")
+self.addrule("!FILE_EXIST=lib/bar")
diff --git a/test/pacman/tests/sync701.py b/test/pacman/tests/sync701.py
index 201f602..977b1a0 100644
--- a/test/pacman/tests/sync701.py
+++ b/test/pacman/tests/sync701.py
@@ -1,22 +1,21 @@
 self.description = "do not remove directory symlink if incoming package has file in its path (order 1)"
 
 lp = pmpkg("pkg1")
 lp.files = ["usr/lib/foo",
             "lib -> usr/lib"]
 self.addpkg2db("local", lp)
 
 p1 = pmpkg("pkg1", "1.0-2")
 p1.files = ["usr/lib/foo"]
 self.addpkg2db("sync", p1)
 
 p2 = pmpkg("pkg2")
 p2.files = ["lib/bar"]
 self.addpkg2db("sync", p2)
 
 self.args = "-S pkg1 pkg2"
 
-self.addrule("PACMAN_RETCODE=1")
-self.addrule("PKG_VERSION=pkg1|1.0-1")
-self.addrule("!PKG_EXIST=pkg2")
-
-self.expectfailure = True
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg1|1.0-2")
+self.addrule("PKG_EXIST=pkg2")
+self.addrule("FILE_TYPE=lib|dir")
diff --git a/test/pacman/tests/sync702.py b/test/pacman/tests/sync702.py
index ee4eef9..a7904c3 100644
--- a/test/pacman/tests/sync702.py
+++ b/test/pacman/tests/sync702.py
@@ -1,22 +1,21 @@
 self.description = "do not remove directory symlink if incoming package has file in its path (order 2)"
 
 lp = pmpkg("pkg2")
 lp.files = ["usr/lib/foo",
             "lib -> usr/lib"]
 self.addpkg2db("local", lp)
 
 p1 = pmpkg("pkg1")
 p1.files = ["lib/bar"]
 self.addpkg2db("sync", p1)
 
 p2 = pmpkg("pkg2", "1.0-2")
 p2.files = ["usr/lib/foo"]
 self.addpkg2db("sync", p2)
 
 self.args = "-S pkg1 pkg2"
 
-self.addrule("PACMAN_RETCODE=1")
-self.addrule("PKG_VERSION=pkg2|1.0-1")
-self.addrule("!PKG_EXIST=pkg1")
-
-self.expectfailure = True
+self.addrule("PACMAN_RETCODE=0")
+self.addrule("PKG_VERSION=pkg2|1.0-2")
+self.addrule("PKG_EXIST=pkg1")
+self.addrule("FILE_TYPE=lib|dir")


More information about the pacman-dev mailing list