Included missed language constant in checksum verification
This commit is contained in:
@ -40,8 +40,20 @@ else
|
||||
echo " serious harm! Only use it, if you are a developer and about"
|
||||
echo " to bundle a new release version!"
|
||||
echo ""
|
||||
echo "Hit [ENTER] to continue, or abort this script"
|
||||
echo "Hit [ENTER] to continue, or abort this script (CTRL-C)"
|
||||
read -n 1
|
||||
gensums=0
|
||||
which php > /dev/null
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
gensums=-1
|
||||
echo "NOTICE: Checksums will not be generated because PHP is not available."
|
||||
echo " Install PHP to generate checksums for file validation, or "
|
||||
echo " run serendipity_generateFTPChecksums.php manually."
|
||||
echo ""
|
||||
echo "Hit [ENTER] to continue, or abort this script (CTRL-C)"
|
||||
read -n 1
|
||||
fi
|
||||
|
||||
echo "1. Operating on basedirectory ../../$2"
|
||||
cd ../../
|
||||
@ -81,7 +93,21 @@ else
|
||||
echo " [DONE]"
|
||||
echo ""
|
||||
|
||||
echo "6. Altering CVS to be useful for anonymous users..."
|
||||
echo "6. Generating checksums..."
|
||||
if [ $gensums -ne 0 ]
|
||||
then
|
||||
echo " [SKIP]"
|
||||
else
|
||||
if (echo "true" | php -B "define('IN_serendipity', true);" -F serendipity_generateFTPChecksums.php)
|
||||
then
|
||||
echo " [DONE]"
|
||||
else
|
||||
rm -rf checksums.inc.php
|
||||
echo " [FAIL]"
|
||||
fi
|
||||
fi
|
||||
echo ""
|
||||
echo "7. Altering CVS to be useful for anonymous users..."
|
||||
echo " - Removing CVS branch tag, so that a user can upgrade to latest CVS"
|
||||
find "$2" -type f -name Tag -exec rm {} \;
|
||||
echo " [DONE]"
|
||||
@ -93,12 +119,12 @@ else
|
||||
echo " [DONE]"
|
||||
echo ""
|
||||
|
||||
echo "7. Creating .tgz file $1"
|
||||
echo "8. Creating .tgz file $1"
|
||||
tar --owner=$3 --group=$4 -czf "$1" "$2"
|
||||
echo " [DONE]"
|
||||
echo ""
|
||||
|
||||
echo "8. All Done. Bybe-Bye."
|
||||
echo "9. All Done. Bye-Bye."
|
||||
else
|
||||
echo "Basedirectory ../../$2 not found. Check parameters"
|
||||
fi
|
||||
|
59
bundled-libs/serendipity_generateFTPChecksums.php
Normal file
59
bundled-libs/serendipity_generateFTPChecksums.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
# Copyright (c) 2008 Judebert (on behalf of the Serendipity development team)
|
||||
# All rights reserved. See LICENSE file for licensing details
|
||||
|
||||
// Call this file from the base directory with
|
||||
// echo "true" | 'php -B "define('IN_serendipity', true);" -F bundled-libs/serendipity_generateFTPChecksums.php'
|
||||
|
||||
if (IN_serendipity !== true) {
|
||||
die ("Don't hack!\n");
|
||||
}
|
||||
|
||||
$basedir = realpath(dirname(__FILE__) . '/../') . '/';
|
||||
require_once $basedir . 'include/functions_installer.inc.php';
|
||||
require_once $basedir . 'include/functions_images.inc.php';
|
||||
|
||||
// Find all the files in the serendipity directory and calculate their md5 sums
|
||||
$sums = array();
|
||||
$excludes = array(
|
||||
'CHANGELOG',
|
||||
'checksums.inc.php',
|
||||
);
|
||||
$files = serendipity_traversePath($basedir, '', false);
|
||||
foreach ($files as $fdata) {
|
||||
// Don't take checksums of directories
|
||||
if ($fdata['directory']) {
|
||||
continue;
|
||||
}
|
||||
$fname = $fdata['name'];
|
||||
$prel = $fdata['relpath'];
|
||||
$path = $basedir . $prel;
|
||||
if ($fname[0] == '.' || !is_readable($path)) {
|
||||
// serendipity_traversePath already excludes CVS and svn directories
|
||||
continue;
|
||||
}
|
||||
|
||||
// Are we SURE we should checksum this file?
|
||||
if (is_file($path) && !in_array($fname, $excludes)) {
|
||||
$sum = serendipity_FTPChecksum($path);
|
||||
// If you find the valid file with an MD5 sum of 0, let me know. ;)
|
||||
if ($sum) {
|
||||
$sums[$prel] = $sum;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (!empty($sums)) {
|
||||
$file = fopen($basedir . '/' . 'checksums.inc.php', 'w');
|
||||
if (!$file) {
|
||||
die('Unable to open output file!');
|
||||
}
|
||||
fwrite($file, '<?php' . "\n" . 'global $serendipity;' . "\n" . '$serendipity[\'checksums\'] = array (' . "\n");
|
||||
foreach ($sums as $fname => $sum) {
|
||||
fwrite($file, "'$fname' => '$sum',\n");
|
||||
}
|
||||
fwrite($file, ');');
|
||||
fclose($file);
|
||||
}
|
||||
/* vim: set sts=4 ts=4 sw=4 expandtab : */
|
||||
?>
|
Reference in New Issue
Block a user