imported from svn 'pve-jslint/trunk'

This commit is contained in:
Dietmar Maurer 2011-08-23 07:35:02 +02:00
commit 46f930040c
7 changed files with 7071 additions and 0 deletions

61
Makefile Normal file
View File

@ -0,0 +1,61 @@
RELEASE=2.0
PACKAGE=pve-jslint
VERSION=1.0
PACKAGERELEASE=2
PKGREL=${VERSION}-${PACKAGERELEASE}
DEB=${PACKAGE}_${VERSION}-${PKGREL}_all.deb
all: ${DEB}
.PHONY: dinstall
dinstall: ${DEB}
dpkg -i ${DEB}
.PHONY: ${DEB}
${DEB} deb:
make clean
rm -rf dest
mkdir dest
make DESTDIR=`pwd`/dest install
mkdir dest/DEBIAN
sed -e 's/@PKGREL@/${PKGREL}/' <control.in >dest/DEBIAN/control
mkdir -p dest/usr/share/doc/${PACKAGE}
install -m 0644 copyright dest/usr/share/doc/${PACKAGE}
install -m 0644 changelog.Debian dest/usr/share/doc/${PACKAGE}
gzip --best dest/usr/share/doc/${PACKAGE}/changelog.Debian
dpkg-deb --build dest
mv dest.deb ${DEB}
rm -rf dest
lintian ${DEB}
rhinoed_jslint.js: jslint.js rhino.js
cat jslint.js rhino.js >$@.tmp
mv $@.tmp $@
install: rhinoed_jslint.js jslint
mkdir -p ${DESTDIR}/usr/share/${PACKAGE}
install -m 0644 rhinoed_jslint.js ${DESTDIR}/usr/share/${PACKAGE}/rhinoed_jslint.js
mkdir -p ${DESTDIR}/usr/bin
install -m 0755 jslint /usr/bin
jslint.js download:
wget -O jslint.js http://jslint.com/jslint.js
.PHONY: distclean
distclean: clean
.PHONY: clean
clean:
rm -rf *~ dest control rhinoed_jslint.js *.deb
.PHONY: upload
upload: ${DEB}
umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw
mkdir -p /pve/${RELEASE}/extra
rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
rm -f /pve/${RELEASE}/extra/Packages*
cp ${DEB} /pve/${RELEASE}/extra
cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro

12
changelog.Debian Normal file
View File

@ -0,0 +1,12 @@
pve-jslint (1.0-2) unstable; urgency=low
* download from http://jslint.com/jslint.js
-- Proxmox Support Team <support@proxmox.com> Fri, 08 Jul 2011 08:22:17 +0200
pve-jslint (1.0-1) unstable; urgency=low
* first try
-- Proxmox Support Team <support@proxmox.com> Thu, 07 Jul 2011 14:47:58 +0200

10
control.in Normal file
View File

@ -0,0 +1,10 @@
Package: pve-jslint
Version: @PKGREL@
Section: devel
Priority: optional
Architecture: all
Depends: rhino
Maintainer: Proxmox Support Team <support@proxmox.com>
Description: JSLint for Proxmox Virtual Environment development
This package contains a version of jslint used to develop the
Proxmox Virtual Environment GUI.

29
copyright Normal file
View File

@ -0,0 +1,29 @@
This package was debianized by the Proxmox Support Team
<support@proxmox.com> on Mon, 30 Mar 2009 06:55:24 -0400.
It was downloaded from <http://jslint.com/jslint.js>
JSLint Copyright:
Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

3
jslint Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/rhino /usr/share/pve-jslint/rhinoed_jslint.js $@

6904
jslint.js Normal file

File diff suppressed because it is too large Load Diff

52
rhino.js Normal file
View File

@ -0,0 +1,52 @@
(function (a) {
var e, i, input, filename, defaults;
if (!a[0]) {
print("Usage: jslint.js file.js ...");
quit(1);
}
defaults = {
predef: ['Ext', 'PVE', 'PVE_vnc_console_event'],
devel: true,
'continue': true, /// Allow continue statement
bitwise: true, // Allow bitwise operators
browser: true, // Assume a browser
css: true, // Tolerate CSS workarounds
eqeq: true, // Allow `==` && `!=`
//immed: true, // Immediate invocations must be wrapped in parens.
//nomen: true, // Allow dangling `_` in identifiers
newcap: false, // Require initial caps for constructors
vars: true, // Allow multiple `var` statements.
plusplus: true, // Allow `++` and `--`
regexp: true, // Allow `.` and `[^...]` in regex
sloppy: true, // Don't require `use strict;`
undef: false, // Disallow undeclared variables
white: true // Don't apply strict whitespace rules
};
for (i = 0; i < a.length; ++i) {
filename = a[i];
input = readFile( filename );
if (!input) {
print("jslint: Couldn't open file '" + filename + "'.");
quit(1);
}
if (!JSLINT(input, defaults)) {
for (i = 0; i < JSLINT.errors.length; i += 1) {
e = JSLINT.errors[i];
if (e) {
print('[' + filename + '] Lint at line ' + e.line + ' character ' +
e.character + ': ' + e.reason);
print((e.evidence || '').
replace(/^\s*(\S*(\s+\S+)*)\s*$/, "$1"));
print('');
}
}
quit(2);
} else {
print("jslint: " + filename + " OK");
}
}
quit();
}(arguments));