[Pkg-owncloud-commits] [owncloud] 49/63: Rely on recent Assetic
David Prévot
taffit at moszumanska.debian.org
Tue Dec 22 16:51:07 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8.0
in repository owncloud.
commit fae3f8a90621352b77be3a9d4a0b345d562dab96
Author: David Prévot <taffit at debian.org>
Date: Wed May 6 14:39:15 2015 -0400
Rely on recent Assetic
Git-Dch: Ignore
---
debian/control | 2 +-
.../0008-use-JSqueeze-instead-of-JSMin-13052.patch | 190 +++++++++------------
2 files changed, 77 insertions(+), 115 deletions(-)
diff --git a/debian/control b/debian/control
index a1ffa83..3edff91 100644
--- a/debian/control
+++ b/debian/control
@@ -21,7 +21,7 @@ Depends: libjs-handlebars,
libjs-underscore (>= 1.6),
libphp-phpmailer (>= 5.2.7),
owncloud-doc (>= 8),
- php-assetic (>= 1.2.1-2~),
+ php-assetic (>= 1.3),
php-cssmin,
php-doctrine-dbal (>= 2.5.1-2~),
php-getid3 (>= 1.9.9+dfsg-2~),
diff --git a/debian/patches/0008-use-JSqueeze-instead-of-JSMin-13052.patch b/debian/patches/0008-use-JSqueeze-instead-of-JSMin-13052.patch
index b06664e..3877680 100644
--- a/debian/patches/0008-use-JSqueeze-instead-of-JSMin-13052.patch
+++ b/debian/patches/0008-use-JSqueeze-instead-of-JSMin-13052.patch
@@ -6,138 +6,100 @@ The JSMin minifier is non-free. JSqueeze is free, it's also a
currently-maintained project following good development
practices, and the best-performing minifier we tested. This
requires a corresponding 3rdparty commit to drop mrclay/minify
-and add JSqueeze, and also uses a backport of the latest
-upstream version of the Assetic JSqueeze filter as the current
-version in 1.2 does not work with JSqueeze 2.x. The backported
-filter file can be dropped when our bundled copy of Assetic is
-updated to a version containing the newer JSqueezeFilter.
+and add JSqueeze.
Bug: https://github.com/owncloud/core/issues/13052
-Origin: vendor, https://github.com/AdamWill/core/commit/da866a885bbc035a12c4e98fd0eed2ec660b0d7f
+Origin: vendor, https://github.com/AdamWill/core/commit/111c4c2e17af15e5bbc3d2eab414503b049363a0
---
- lib/private/assetic/jsqueeze2filter.php | 93 +++++++++++++++++++++++++++++++++
- lib/private/templatelayout.php | 4 +-
- 2 files changed, 95 insertions(+), 2 deletions(-)
- create mode 100644 lib/private/assetic/jsqueeze2filter.php
+ lib/private/assetic/separatorfilter.php | 57 ---------------------------------
+ lib/private/templatelayout.php | 6 ++--
+ 2 files changed, 3 insertions(+), 60 deletions(-)
+ delete mode 100644 lib/private/assetic/separatorfilter.php
-diff --git a/lib/private/assetic/jsqueeze2filter.php b/lib/private/assetic/jsqueeze2filter.php
-new file mode 100644
-index 0000000..8ea5033
---- /dev/null
-+++ b/lib/private/assetic/jsqueeze2filter.php
-@@ -0,0 +1,93 @@
-+<?php
-+
-+/**
-+ * ownCloud
-+ *
-+ * Copyright (C) 2014 Robin McCorkell <rmccorkell at karoshi.org.uk>
-+ *
-+ * This library is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
-+ * License as published by the Free Software Foundation; either
-+ * version 3 of the License, or any later version.
-+ *
-+ * This library is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
-+ *
-+ * You should have received a copy of the GNU Affero General Public
-+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
-+ *
-+ * This file is just a copy of Assetic's JSqueezeFilter following
-+ * https://github.com/kriswallsmith/assetic/pull/698, with the class
-+ * renamed to JSqueeze2Filter, namespace changed, and use statements
-+ * adjusted. It can be dropped as soon as OC's bundled Assetic is updated
-+ * to a version containing the JSqueezeFilter that works with JSqueeze 2.x.
-+ */
-+
-+namespace OC\Assetic;
-+
-+use Assetic\Filter\FilterInterface;
-+use Assetic\Asset\AssetInterface;
-+
-+/**
-+ * JSqueeze filter.
-+ *
-+ * @link https://github.com/nicolas-grekas/JSqueeze
-+ * @author Nicolas Grekas <p at tchwork.com>
-+ */
-+class JSqueeze2Filter implements FilterInterface
-+{
-+ private $singleLine = true;
-+ private $keepImportantComments = true;
-+ private $className;
-+ private $specialVarRx = false;
-+ private $defaultRx;
-+
-+ function __construct() {
-+ // JSqueeze is namespaced since 2.x, this works with both 1.x and 2.x
-+ if (class_exists('\\Patchwork\\JSqueeze')) {
-+ $this->className = '\\Patchwork\\JSqueeze';
-+ $this->defaultRx = \Patchwork\JSqueeze::SPECIAL_VAR_PACKER;
-+ } else {
-+ $this->className = '\\JSqueeze';
-+ $this->defaultRx = \JSqueeze::SPECIAL_VAR_RX;
-+ }
-+ }
-+
-+ public function setSingleLine($bool)
-+ {
-+ $this->singleLine = (bool) $bool;
-+ }
-+
-+ // call setSpecialVarRx(true) to enable global var/method/property
-+ // renaming with the default regex (for 1.x or 2.x)
-+ public function setSpecialVarRx($specialVarRx)
-+ {
-+ if (true === $specialVarRx) {
-+ $this->specialVarRx = $this->defaultRx;
-+ } else {
-+ $this->specialVarRx = $specialVarRx;
-+ }
-+ }
-+
-+ public function keepImportantComments($bool)
-+ {
-+ $this->keepImportantComments = (bool) $bool;
-+ }
-+
-+ public function filterLoad(AssetInterface $asset)
-+ {
-+ }
-+
-+ public function filterDump(AssetInterface $asset)
-+ {
-+ $parser = new $this->className();
-+ $asset->setContent($parser->squeeze(
-+ $asset->getContent(),
-+ $this->singleLine,
-+ $this->keepImportantComments,
-+ $this->specialVarRx
-+ ));
-+ }
-+}
+diff --git a/lib/private/assetic/separatorfilter.php b/lib/private/assetic/separatorfilter.php
+deleted file mode 100644
+index fb1a4e7..0000000
+--- a/lib/private/assetic/separatorfilter.php
++++ /dev/null
+@@ -1,57 +0,0 @@
+-<?php
+-
+-/**
+- * ownCloud
+- *
+- * Copyright (C) 2014 Robin McCorkell <rmccorkell at karoshi.org.uk>
+- *
+- * This library is free software; you can redistribute it and/or
+- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+- * License as published by the Free Software Foundation; either
+- * version 3 of the License, or any later version.
+- *
+- * This library is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+- *
+- * You should have received a copy of the GNU Affero General Public
+- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
+- *
+- */
+-
+-namespace OC\Assetic;
+-
+-use Assetic\Filter\FilterInterface;
+-use Assetic\Asset\AssetInterface;
+-
+-/**
+- * Inserts a separator between assets to prevent merge failures
+- * e.g. missing semicolon at the end of a JS file
+- */
+-class SeparatorFilter implements FilterInterface
+-{
+- /**
+- * @var string
+- */
+- private $separator;
+-
+- /**
+- * Constructor.
+- *
+- * @param string $separator Separator to use between assets
+- */
+- public function __construct($separator = ';')
+- {
+- $this->separator = $separator;
+- }
+-
+- public function filterLoad(AssetInterface $asset)
+- {
+- }
+-
+- public function filterDump(AssetInterface $asset)
+- {
+- $asset->setContent($asset->getContent() . $this->separator);
+- }
+-}
diff --git a/lib/private/templatelayout.php b/lib/private/templatelayout.php
-index 99b10e4..ff53ebc 100644
+index 99b10e4..289d29b 100644
--- a/lib/private/templatelayout.php
+++ b/lib/private/templatelayout.php
-@@ -5,7 +5,7 @@ use Assetic\AssetWriter;
+@@ -5,8 +5,8 @@ use Assetic\AssetWriter;
use Assetic\Filter\CssImportFilter;
use Assetic\Filter\CssMinFilter;
use Assetic\Filter\CssRewriteFilter;
-use Assetic\Filter\JSMinFilter;
-+use OC\Assetic\JSqueeze2Filter; // see note in jsqueeze2filter.php
- use OC\Assetic\SeparatorFilter; // waiting on upstream
+-use OC\Assetic\SeparatorFilter; // waiting on upstream
++use Assetic\Filter\JSqueezeFilter;
++use Assetic\Filter\SeparatorFilter;
/**
+ * Copyright (c) 2012 Bart Visscher <bartv at thisnet.nl>
@@ -173,7 +173,7 @@ class OC_TemplateLayout extends OC_Template {
), $root, $file);
}
return new FileAsset($root . '/' . $file, array(
- new JSMinFilter(),
-+ new JSqueeze2Filter(),
++ new JSqueezeFilter(),
new SeparatorFilter(';')
), $root, $file);
}, $jsFiles);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list