aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-04-29 14:46:51 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-04-29 14:46:51 +0000
commitca5e22d2e472d1ec99db3c2733b7c657d0f63020 (patch)
tree49d4683d59b1889832da19b11107ba7afe67fdf6
parente5f668e4353d54f4dfe22e01fab4095952dffa87 (diff)
downloadpaludis-ca5e22d2e472d1ec99db3c2733b7c657d0f63020.tar.gz
paludis-ca5e22d2e472d1ec99db3c2733b7c657d0f63020.tar.xz
Fixed check for non-ebuild files in the package directory. Adjusted test cases to detect this.
-rw-r--r--paludis/qa/ebuild_name_check.cc9
-rw-r--r--paludis/qa/ebuild_name_check_TEST.cc13
-rwxr-xr-xpaludis/qa/ebuild_name_check_TEST_setup.sh1
3 files changed, 18 insertions, 5 deletions
diff --git a/paludis/qa/ebuild_name_check.cc b/paludis/qa/ebuild_name_check.cc
index 1198c06..e67d926 100644
--- a/paludis/qa/ebuild_name_check.cc
+++ b/paludis/qa/ebuild_name_check.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/name.hh>
+#include <paludis/util/is_file_with_extension.hh>
#include <paludis/qa/ebuild_name_check.hh>
using namespace paludis;
@@ -32,8 +33,12 @@ EbuildNameCheck::operator() (const FSEntry & f) const
{
CheckResult result(f, identifier());
- if (stringify(f.dirname().basename()) != stringify(f.basename()).substr(0,stringify(f.dirname().basename()).length()))
- result << Message(qal_fatal, "Ebuild name does not match directory name");
+ if (is_file_with_extension(f, ".ebuild", IsFileWithOptions()))
+ {
+ if (stringify(f.dirname().basename()) != stringify(f.basename()).substr(
+ 0, stringify(f.dirname().basename()).length()))
+ result << Message(qal_fatal, "Ebuild name does not match directory name");
+ }
return result;
}
diff --git a/paludis/qa/ebuild_name_check_TEST.cc b/paludis/qa/ebuild_name_check_TEST.cc
index 45328d3..689fe45 100644
--- a/paludis/qa/ebuild_name_check_TEST.cc
+++ b/paludis/qa/ebuild_name_check_TEST.cc
@@ -41,12 +41,19 @@ namespace test_cases
TEST_CHECK(f1.exists());
TEST_CHECK(f1.is_directory());
- FSEntry f2(e / "valid-cat" / "valid-pkg" / "valid-pkg-0.ebuild");
- TEST_CHECK(f2.exists());
+ FSEntry f3(e / "valid-cat" / "valid-pkg" / "valid-pkg-0.ebuild");
+ TEST_CHECK(f3.exists());
CheckResult r1((*(*FileCheckMaker::get_instance()->find_maker(
- EbuildNameCheck::identifier()))())(f2));
+ EbuildNameCheck::identifier()))())(f3));
TEST_CHECK(r1.empty());
+
+ FSEntry f4(e / "valid-cat" / "valid-pkg" / "ChangeLog");
+ TEST_CHECK(f4.exists());
+
+ CheckResult r2((*(*FileCheckMaker::get_instance()->find_maker(
+ EbuildNameCheck::identifier()))())(f4));
+ TEST_CHECK(r2.empty());
}
} test_ebuild_name_check_valid;
diff --git a/paludis/qa/ebuild_name_check_TEST_setup.sh b/paludis/qa/ebuild_name_check_TEST_setup.sh
index 914809b..259b2f3 100755
--- a/paludis/qa/ebuild_name_check_TEST_setup.sh
+++ b/paludis/qa/ebuild_name_check_TEST_setup.sh
@@ -8,4 +8,5 @@ mkdir "valid-cat" || exit 4
mkdir "valid-cat/valid-pkg" || exit 5
touch "valid-cat/valid-pkg/valid-pkg-0.ebuild" || exit 6
touch "valid-cat/valid-pkg/invalid-pkg-0.ebuild" || exit 7
+touch "valid-cat/valid-pkg/ChangeLog" || exit 8