public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matt Turner" <mattst88@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/
Date: Wed, 28 Oct 2020 20:51:02 +0000 (UTC)	[thread overview]
Message-ID: <1603918200.535cfb36161461884fad7222d13fea70d010d584.mattst88@gentoo> (raw)

commit:     535cfb36161461884fad7222d13fea70d010d584
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 28 20:50:00 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Wed Oct 28 20:50:00 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=535cfb36

catalyst: Replace pathcompare function

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 catalyst/support.py | 24 +++++++-----------------
 1 file changed, 7 insertions(+), 17 deletions(-)

diff --git a/catalyst/support.py b/catalyst/support.py
index f49315a5..4458ed20 100644
--- a/catalyst/support.py
+++ b/catalyst/support.py
@@ -5,6 +5,7 @@ import os
 import re
 import shutil
 import time
+from pathlib import Path
 from subprocess import Popen
 
 from catalyst import log
@@ -179,31 +180,20 @@ def read_makeconf(mymakeconffile):
         return makeconf
 
 
-def pathcompare(path1, path2):
-    # Change double slashes to slash
-    path1 = re.sub(r"//", r"/", path1)
-    path2 = re.sub(r"//", r"/", path2)
-    # Removing ending slash
-    path1 = re.sub("/$", "", path1)
-    path2 = re.sub("/$", "", path2)
-
-    if path1 == path2:
-        return 1
-    return 0
-
-
 def ismount(path):
     """Like os.path.ismount, but also support bind mounts"""
     if os.path.ismount(path):
-        return 1
+        return True
+
     a = os.popen("mount")
     mylines = a.readlines()
     a.close()
     for line in mylines:
         mysplit = line.split()
-        if pathcompare(path, mysplit[2]):
-            return 1
-    return 0
+        if Path(path) == Path(mysplit[2]):
+            return True
+
+    return False
 
 
 def addl_arg_parse(myspec, addlargs, requiredspec, validspec):


             reply	other threads:[~2020-10-28 20:51 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28 20:51 Matt Turner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-01-29 23:50 [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/ Matt Turner
2021-01-28  2:09 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2021-01-28  1:54 Matt Turner
2020-10-29 19:05 Matt Turner
2020-10-29 16:34 Matt Turner
2020-10-29 16:14 Matt Turner
2020-10-29 16:04 Matt Turner
2020-10-29 16:04 Matt Turner
2020-10-29 15:47 Matt Turner
2020-10-29 15:47 Matt Turner
2020-10-29  3:33 Matt Turner
2020-10-29  3:33 Matt Turner
2020-10-28 23:06 Matt Turner
2020-10-28 22:22 Matt Turner
2020-10-28 22:08 Matt Turner
2020-10-28 22:00 Matt Turner
2020-10-28 21:33 Matt Turner
2020-10-23  4:36 Matt Turner
2020-10-22 18:59 Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-21 20:25 [gentoo-commits] proj/catalyst:master " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20  3:39 Matt Turner
2020-05-20  3:39 Matt Turner
2020-05-20  1:52 [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20  1:52 [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20  1:52 [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner
2020-05-20  1:52 [gentoo-commits] proj/catalyst:wip/mattst88 " Matt Turner
2020-05-20  3:39 ` [gentoo-commits] proj/catalyst:pending/mattst88 " Matt Turner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1603918200.535cfb36161461884fad7222d13fea70d010d584.mattst88@gentoo \
    --to=mattst88@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox