[yum-commits] 4 commits - yum-cron/yum-cron.py yum/depsolve.py yum/__init__.py yum.spec

James Antill james at osuosl.org
Fri Jan 31 06:33:44 UTC 2014


 yum-cron/yum-cron.py |    2 ++
 yum.spec             |    4 ++++
 yum/__init__.py      |   20 ++++++++++++++++++--
 yum/depsolve.py      |    7 ++++++-
 4 files changed, 30 insertions(+), 3 deletions(-)

New commits:
commit 1bbf40af8548d2d3fb9deea8844770fccd67a384
Author: Dan Kenigsberg <danken at redhat.com>
Date:   Fri Jan 31 01:23:13 2014 -0500

    Use requirement instead of calling string_to_prco_tuple.

diff --git a/yum/depsolve.py b/yum/depsolve.py
index 95c21bc..8a675eb 100644
--- a/yum/depsolve.py
+++ b/yum/depsolve.py
@@ -720,7 +720,12 @@ class Depsolve(object):
         else:
             self.verbose_logger.debug(_('TSINFO: Marking %s as install for %s'), best,
                 requiringPo)
-            reqtuple = misc.string_to_prco_tuple(needname + str(needflags) + needversion)
+            if requirement and not requirement[2]:
+                #  Stuff looks like: ('/foo', 0, '') ... might be just testing
+                # noise, but meh.
+                reqtuple = (requirement[0], requirement[1], (None, None, None))
+            else:
+                reqtuple = requirement
             txmbrs = self.install(best, provides_for=reqtuple)
             for txmbr in txmbrs:
                 txmbr.setAsDep(po=requiringPo)
commit ffb40e6a1b9c3f4b5b08151a04a5922fc5a9b521
Author: James Antill <james at and.org>
Date:   Wed Jan 29 16:04:18 2014 -0500

    Don't create lockdir directories, as they are magic now. BZ 975864

diff --git a/yum/__init__.py b/yum/__init__.py
index 222a378..0604d63 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2136,7 +2136,11 @@ much more problems).
         lockfile = os.path.normpath(lockfile) # get rid of silly preceding extra /
         
         mypid=str(os.getpid())    
-        while not self._lock(lockfile, mypid, 0644):
+        while True:
+            ret = self._lock(lockfile, mypid, 0644)
+            if ret:
+                break
+
             oldpid = self._get_locker(lockfile)
             if not oldpid:
                 # Invalid locker: unlink lockfile and retry
@@ -2147,6 +2151,13 @@ much more problems).
             # Another copy seems to be running.
             msg = _('Existing lock %s: another copy is running as pid %s.') % (lockfile, oldpid)
             raise Errors.LockError(0, msg, oldpid)
+
+        if ret == 2:
+            #  Means lockdir isn't setup, out of bad options just run without
+            # locks.
+            return
+
+        assert ret == 1
         # We've got the lock, store it so we can auto-unlock on __del__...
         self._lockfile = lockfile
     
@@ -2186,7 +2197,12 @@ much more problems).
         lockdir = os.path.dirname(filename)
         try:
             if not os.path.exists(lockdir):
-                os.makedirs(lockdir, mode=0755)
+                #  We used to os.makedirs(lockdir, mode=0755) ... but that
+                # causes problems now due to /var/run being a magic systemd dir.
+                #  So we now just give up and run, hopefully nobody runs N
+                # instances before the magic dir. is activate.
+                return 2
+
             fd = os.open(filename, os.O_EXCL|os.O_CREAT|os.O_WRONLY, mode)    
             os.write(fd, contents)
             os.close(fd)
commit 3fc532f3907f5c5ea1951e6b891bff5005a0812b
Author: James Antill <james at and.org>
Date:   Wed Jan 29 16:12:38 2014 -0500

    Turn off just the systemd timer stuff for rhel-7.

diff --git a/yum.spec b/yum.spec
index a459944..93cfa14 100644
--- a/yum.spec
+++ b/yum.spec
@@ -11,6 +11,10 @@
 %if 0%{?rhel} <= 6
 # rhel-6 doesn't have the systemd stuff...
 %define yum_cron_systemd 0
+%endif
+
+%if 0%{?rhel} <= 7
+# rhel-7 doesn't use systemd timers...
 %define yum_makecache_systemd 0
 %endif
 
commit 95644a7795419bd367693946812f3ea02ade7a5b
Author: James Antill <james at and.org>
Date:   Wed Jan 29 16:08:15 2014 -0500

    Add yum-cron to run_with_package_names.

diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
index e1028be..20911af 100755
--- a/yum-cron/yum-cron.py
+++ b/yum-cron/yum-cron.py
@@ -596,6 +596,8 @@ class YumCronBase(yum.YumBase, YumOutput):
         # Acquire the yum lock
         self.acquireLock()
 
+        self.run_with_package_names.add("yum-cron")
+
         # Update the metadata
         self.populateUpdateMetadata()
 


More information about the Yum-commits mailing list