com web/pecl: check for the LICENSE or COPYING presence in tarballs: public_html/release-upload.php
| From: | Anatol Belski | Date: | Sun, 13 Oct 2013 10:57:33 +0000 |
| Subject: | com web/pecl: check for the LICENSE or COPYING presence in tarballs: public_html/release-upload.php | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-19861@lists.php.net to get a copy of this message | ||
Commit: f49cf969de7ff71fbd96b5814cc0ca8695c9b0b5
Author: Anatol Belski <ab@php.net> Sun, 13 Oct 2013 12:57:33 +0200
Parents: 78cc88deae3cdce68ddab5ac035bdb76122986e2
Branches: old_auth
Link: http://git.php.net/?p=web/pecl.git;a=commitdiff;h=f49cf969de7ff71fbd96b5814cc0ca8695c9b0b5
Log:
check for the LICENSE or COPYING presence in tarballs
Changed paths:
M public_html/release-upload.php
Diff:
diff --git a/public_html/release-upload.php b/public_html/release-upload.php
index 221f941..ffc8842 100644
--- a/public_html/release-upload.php
+++ b/public_html/release-upload.php
@@ -89,8 +89,27 @@ do {
$errors[] = 'package.xml v1 format is not supported anymore, please update your package.xml
to 2.0. ';
break;
}
- $display_form = false;
- $display_verification = true;
+
+ $license_found = false;
+ foreach ($info->getFileList() as $file_name => $file_data) {
+ if ("doc" != $file_data["role"]) {
+ continue;
+ }
+
+ /* Don't compare with basename($file_data["name"]), the license has
+ to be in the package root. */
+ if (in_array($file_data["name"], array("LICENSE", "COPYING"))) {
+ $license_found = true;
+ break;
+ }
+ }
+ if (!$license_found) {
+ $errors[] = "No LICENSE or COPYING file was found in the root of the package. ";
+ break;
+ }
+
+ $display_form = false;
+ $display_verification = true;
} elseif (isset($_POST['verify'])) {
// Verify Button