Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r9516 - in main/branches/2.1.2: bin pym
Date: Thu, 27 Mar 2008 04:35:40
Message-Id: E1Jejpx-0003sy-PJ@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-03-27 04:35:36 +0000 (Thu, 27 Mar 2008)
3 New Revision: 9516
4
5 Modified:
6 main/branches/2.1.2/bin/emerge
7 main/branches/2.1.2/pym/portage_locks.py
8 Log:
9 revert previous commit since it had portage_locks stuff mixed in
10
11
12 Modified: main/branches/2.1.2/bin/emerge
13 ===================================================================
14 --- main/branches/2.1.2/bin/emerge 2008-03-27 04:33:23 UTC (rev 9515)
15 +++ main/branches/2.1.2/bin/emerge 2008-03-27 04:35:36 UTC (rev 9516)
16 @@ -1635,7 +1635,6 @@
17 return 0
18 del e
19
20 - noreplace = "--noreplace" in self.myopts
21 reinstall_for_flags = None
22 merging=1
23 if mytype == "installed":
24 @@ -1649,7 +1648,7 @@
25 """ If we aren't merging, perform the --newuse check.
26 If the package has new iuse flags or different use flags then if
27 --newuse is specified, we need to merge the package. """
28 - if not noreplace and merging == 0 and \
29 + if merging == 0 and \
30 myroot == self.target_root and \
31 ("--newuse" in self.myopts or
32 "--reinstall" in self.myopts) and \
33
34 Modified: main/branches/2.1.2/pym/portage_locks.py
35 ===================================================================
36 --- main/branches/2.1.2/pym/portage_locks.py 2008-03-27 04:33:23 UTC (rev 9515)
37 +++ main/branches/2.1.2/pym/portage_locks.py 2008-03-27 04:35:36 UTC (rev 9516)
38 @@ -79,7 +79,7 @@
39 except IOError, e:
40 if "errno" not in dir(e):
41 raise
42 - if e.errno in (errno.EACCES, errno.EAGAIN):
43 + if e.errno == errno.EAGAIN:
44 # resource temp unavailable; eg, someone beat us to the lock.
45 if waiting_msg is None:
46 if isinstance(mypath, int):
47 @@ -111,7 +111,7 @@
48
49
50 if type(lockfilename) == types.StringType and \
51 - myfd != HARDLINK_FD and _fstat_nlink(myfd) == 0:
52 + myfd != HARDLINK_FD and os.fstat(myfd).st_nlink == 0:
53 # The file was deleted on us... Keep trying to make one...
54 os.close(myfd)
55 portage_util.writemsg("lockfile recurse\n",1)
56 @@ -122,22 +122,6 @@
57 portage_util.writemsg(str((lockfilename,myfd,unlinkfile))+"\n",1)
58 return (lockfilename,myfd,unlinkfile,locking_method)
59
60 -def _fstat_nlink(fd):
61 - """
62 - @param fd: an open file descriptor
63 - @type fd: Integer
64 - @rtype: Integer
65 - @return: the current number of hardlinks to the file
66 - """
67 - try:
68 - return os.fstat(fd).st_nlink
69 - except EnvironmentError, e:
70 - if e.errno == errno.ENOENT:
71 - # Some filesystems such as CIFS return
72 - # ENOENT which means st_nlink == 0.
73 - return 0
74 - raise
75 -
76 def unlockfile(mytuple):
77 import fcntl
78
79 @@ -183,7 +167,7 @@
80 # We won the lock, so there isn't competition for it.
81 # We can safely delete the file.
82 portage_util.writemsg("Got the lockfile...\n",1)
83 - if _fstat_nlink(myfd) == 1:
84 + if os.fstat(myfd).st_nlink == 1:
85 os.unlink(lockfilename)
86 portage_util.writemsg("Unlinked lockfile...\n",1)
87 locking_method(myfd,fcntl.LOCK_UN)
88
89 --
90 gentoo-commits@l.g.o mailing list