Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,5 @@ test_script:
- 'cd'
- '%PYTHON% %CYG_ROOT%/bin/cyg-apt -q install ping'
- 'cd "%APPVEYOR_BUILD_FOLDER%"'
# test unstall a package name with caps
- '%PYTHON% %CYG_ROOT%/bin/cyg-apt -q install geoip'
4 changes: 2 additions & 2 deletions src/cygapt/cygapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def __init__(self,
self.__noPostInstall = main_nopostinstall;
self.__noPostRemove = main_nopostremove;
self.__appName = main_scriptname;
self.__files = main_files;
self.__files = map(lambda v: str(v).lower(), main_files);
self.__downloadOnly = main_download_p;
self.__downloadDir = main_downloads;
self.__noDeps = main_nodeps_p;
Expand Down Expand Up @@ -275,7 +275,7 @@ def _getSetupIni(self):
chunks = contents.split("\n\n@ ");
for i in chunks[1:]:
lines = i.split("\n");
name = lines[0].strip();
name = lines[0].strip().lower();
self._debug("package: {0}".format(name));
packages = self.__dists['curr'];
records = {'sdesc': name};
Expand Down
16 changes: 10 additions & 6 deletions src/cygapt/test/test_cygapt.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def _createCygApt(self):

cygapt.FORCE_BARRED.extend([
self._var_setupIni.barredpkg.name,
'barredcapspkg',
]);

return cygapt;
Expand Down Expand Up @@ -260,7 +261,7 @@ def getDownloadData(self):
def testGetRequires(self):
expected = self._var_setupIni.pkg.requires.split(" ");
ret = self.obj.getRequires();
self.assertEqual(ret, expected);
self.assertEqual(sorted(ret), sorted(expected));

def testGetInstalled(self):
pkg = ["pkgname", "pkgname-1.1-1.tar.bz2", "0"];
Expand Down Expand Up @@ -326,7 +327,7 @@ def testGetMissing(self):
expected.append(self.obj.getPkgName());
ret = self.obj.getMissing();

self.assertEqual(ret, expected);
self.assertEqual(sorted(ret), sorted(expected));

def testDoInstall(self):
self.testDownload(self.obj.getPkgName());
Expand Down Expand Up @@ -522,7 +523,7 @@ def testInstall(self, packageName):
self.obj.install();

expected = list();
requires = getattr(self._var_setupIni, packageName).requires;
requires = getattr(self._var_setupIni, packageName.lower()).requires;
if requires :
expected += requires.split(" ");
expected.append(packageName);
Expand All @@ -534,6 +535,8 @@ def getInstallData(self):
['pkg'],
['pkgxz'],
['dashpkg'],
['capspkg'],
['Pkg'],
];

if self._hasBatchInterpreter() :
Expand Down Expand Up @@ -615,6 +618,7 @@ def getIsBarredPackageData(self):
['pkg', False],
['libpkg', False],
['not_exists_pkg', False],
['barredcapspkg', True],
];

def testGetRessourceWithSetupIniFieldWarnDeprecationWarning(self):
Expand All @@ -638,7 +642,7 @@ def testGetRessourceWithoutSetupIniFieldNotWarnDeprecationWarning(self):
def assertInstall(self, pkgname_list, onlyFiles=False):
pkg_ini_list = [];
for pkg in pkgname_list:
pkg_ini_list.append(self._var_setupIni.__dict__[pkg]);
pkg_ini_list.append(self._var_setupIni.__dict__[pkg.lower()]);

for pkg in pkg_ini_list:
for filename in pkg.filelist:
Expand All @@ -655,7 +659,7 @@ def assertInstall(self, pkgname_list, onlyFiles=False):
# Confirm the package file list exists and correct
gz_file = os.path.join(
self._dir_confsetup,
"{0}.lst.gz".format(pkg.name)
"{0}.lst.gz".format(pkg.name.lower())
);
f = gzip.open(gz_file);
lines = f.readlines();
Expand All @@ -673,7 +677,7 @@ def assertInstall(self, pkgname_list, onlyFiles=False):
with open(self._file_installed_db, 'r') as f :
contents = f.read();
line = "{0} {1} 0".format(
pkg.name,
pkg.name.lower(),
os.path.basename(pkg.install.curr.url),
);
self.assertTrue(line in contents.splitlines(), message);
Expand Down
10 changes: 6 additions & 4 deletions src/cygapt/test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def __init__(self, app, architecture="x86"):

packages = [
PackageIni(app, self._architecture, name="libpkg"),
PackageIni(app, self._architecture, name="pkg", requires="libpkg"),
PackageIni(app, self._architecture, name="pkg", requires="libpkg capspkg"),
PackageIni(app, self._architecture, name="libbarredpkg"),
PackageIni(app, self._architecture, name="barredpkg", requires="libbarredpkg"),
PackageIni(app, self._architecture, name="pkgxz", compression="xz"),
Expand All @@ -329,10 +329,12 @@ def __init__(self, app, architecture="x86"):
PackageIni(app, self._architecture, name="dashpkg", scriptsExt=".dash"),
PackageIni(app, self._architecture, name="batpkg", scriptsExt=".bat"),
PackageIni(app, self._architecture, name="cmdpkg", scriptsExt=".cmd"),
PackageIni(app, self._architecture, name="CapsPkg"),
PackageIni(app, self._architecture, name="BarredCapsPkg"),
];

for package in packages :
name = package.name;
name = package.name.lower();
self.__dict__[name] = package;
for distname in self.dists.__dict__:
if None is self.dists.__dict__[distname] :
Expand Down Expand Up @@ -460,7 +462,7 @@ def _buildDist(self):

for distname in self.install.__dict__:
tarball = "{0}-{1}.tar.{2}".format(
self.name,
self.name.lower(),
self.version.__dict__[distname],
self._compression,
);
Expand All @@ -471,7 +473,7 @@ def _buildDist(self):

for distname in self.source.__dict__:
srctarball = "{0}-{1}.src.tar.{2}".format(
self.name,
self.name.lower(),
self.version.__dict__[distname],
self._compression,
);
Expand Down