From: Zac Medico Date: Tue, 27 Aug 2013 03:59:40 +0000 (-0700) Subject: dohtml: restore behavior noted in bug #425214 X-Git-Tag: v2.2.2~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2110ec6ed42fc306d5c25cbf970d013ff2a226fd;p=portage.git dohtml: restore behavior noted in bug #425214 A trailing slash cause os.path.basename() and os.path.dirname() to behave differently, causing foo/ to behave similarly to the way that foo/* behaves. This behavior was broken by normalization in commit 3f67cb453ee1b74894c230459b43855db7fcc410. --- diff --git a/bin/dohtml.py b/bin/dohtml.py index ec9a80b57..37d5b2ee2 100755 --- a/bin/dohtml.py +++ b/bin/dohtml.py @@ -206,7 +206,14 @@ def main(): success = False for x in args: + trailing_slash = x[-1:] == os.sep x = normalize_path(x) + if trailing_slash: + # Modify behavior of basename and dirname + # as noted in bug #425214, causing foo/ to + # behave similarly to the way that foo/* + # behaves. + x += os.sep basename = os.path.basename(x) dirname = os.path.dirname(x) success |= install(basename, dirname, options)