Use lowercase hashed directories
On case-insensitive filesystems it is not such a good idea to have directories that only differ in case. Packages should be always split into lowercased directories. The test data is modified to include some packages starting with uppercase letters. The example in code can be verified by running `nosetests --with-doctest`. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
e9699b7327
commit
539736a11e
@ -39,8 +39,18 @@ def _get_src_nevra(compose, pkg_obj, srpm_map):
|
||||
|
||||
|
||||
def get_package_path(filename, hashed_directory=False):
|
||||
"""Get path for filename. If ``hashed_directory`` is ``True``, the path
|
||||
will include a prefix based on the initial letter.
|
||||
|
||||
>>> get_package_path('my-package.rpm')
|
||||
'my-package.rpm'
|
||||
>>> get_package_path('my-package.rpm', True)
|
||||
'm/my-package.rpm'
|
||||
>>> get_package_path('My-Package.rpm', True)
|
||||
'm/My-Package.rpm'
|
||||
"""
|
||||
if hashed_directory:
|
||||
prefix = filename[0]
|
||||
prefix = filename[0].lower()
|
||||
return os.path.join(prefix, filename)
|
||||
return filename
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
<default>false</default>
|
||||
<uservisible>false</uservisible>
|
||||
<packagelist>
|
||||
<packagereq>dummy-firefox</packagereq>
|
||||
<packagereq>Dummy-firefox</packagereq>
|
||||
<packagereq>dummy-icedtea-web</packagereq>
|
||||
</packagelist>
|
||||
</group>
|
||||
|
@ -1,11 +1,11 @@
|
||||
Name: dummy-firefox
|
||||
Name: Dummy-firefox
|
||||
Version: 16.0.1
|
||||
Release: 1
|
||||
License: LGPLv2
|
||||
Summary: A dummy firefox package
|
||||
BuildRequires: dummy-krb5-devel
|
||||
BuildRequires: dummy-xulrunner
|
||||
Requires: dummy-xulrunner
|
||||
BuildRequires: Dummy-xulrunner
|
||||
Requires: Dummy-xulrunner
|
||||
|
||||
%description
|
||||
A dummy firefox package
|
@ -1,4 +1,4 @@
|
||||
Name: dummy-xulrunner
|
||||
Name: Dummy-xulrunner
|
||||
Version: 16.0.1
|
||||
Release: 1
|
||||
License: LGPLv2
|
Loading…
Reference in New Issue
Block a user