chiark / gitweb /
Add scripts/lint-packages.py
authorFredrik Fornwall <fredrik@fornwall.net>
Tue, 5 Dec 2017 21:48:12 +0000 (22:48 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Tue, 5 Dec 2017 21:48:12 +0000 (22:48 +0100)
Harmonize the layout by having the first two lines of a package
definition always be the homepage and the description.

15 files changed:
packages/aapt/build.sh
packages/alpine/build.sh
packages/apr/build.sh
packages/autoconf/build.sh
packages/ccache/build.sh
packages/dialog/build.sh
packages/gmic/build.sh
packages/ncmpcpp/build.sh
packages/ncurses/build.sh
packages/neofetch/build.sh
packages/unzip/build.sh
packages/valac/build.sh
packages/vim-python/build.sh
packages/vim/build.sh
scripts/lint-packages.py [new file with mode: 0755]

index 9dbe66a23bd89a7feb04e9c297ac32d4484c9b56..4373c12663bf97b1b3ac2a8e0a05e22207fa0b7b 100644 (file)
@@ -1,6 +1,3 @@
-# FIXME: We would like to enable checksums when downloading
-# tar files, but they change each time as the tar metadata
-# differs: https://github.com/google/gitiles/issues/84
 TERMUX_PKG_HOMEPAGE=http://elinux.org/Android_aapt
 TERMUX_PKG_DESCRIPTION="Android Asset Packaging Tool"
 _TAG_VERSION=7.1.2
@@ -11,6 +8,10 @@ TERMUX_PKG_BUILD_IN_SRC=yes
 TERMUX_PKG_DEPENDS="libexpat, libpng, libzopfli"
 
 termux_step_make_install () {
+       # FIXME: We would like to enable checksums when downloading
+       # tar files, but they change each time as the tar metadata
+       # differs: https://github.com/google/gitiles/issues/84
+
        local _TAGNAME=${_TAG_VERSION}_r${_TAG_REVISION}
 
        SYSTEM_CORE_INCLUDE_TARFILE=$TERMUX_PKG_CACHEDIR/system_core_include_${_TAGNAME}.tar.gz
index 9a6394bee4078943c3c747ac5e16614de44bc02a..9e73f2fa7c97bd2e29622176070da489ccc3da40 100644 (file)
@@ -11,7 +11,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
 --without-pthread
 --without-tcl
 --with-system-pinerc=${TERMUX_PREFIX}/etc/pine.conf
---with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile 
+--with-passfile=$TERMUX_ANDROID_HOME/.pine-passfile
 "
 TERMUX_PKG_BUILD_IN_SRC=yes
 TERMUX_PKG_SHA256=6030b6881b8168546756ab3a5e43628d8d564539b0476578e287775573a77438
index 935bd117244530bdea2c7d6d5b19c0606295844b..035e4f9062694b27b9b9f93f4f76bd07516ad16e 100644 (file)
@@ -1,8 +1,8 @@
 TERMUX_PKG_HOMEPAGE=https://apr.apache.org/
+TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Library"
 TERMUX_PKG_VERSION=1.6.3
 TERMUX_PKG_SHA256=131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172
 TERMUX_PKG_SRCURL=http://apache.mirrors.spacedump.net/apr/apr-${TERMUX_PKG_VERSION}.tar.bz2
-TERMUX_PKG_DESCRIPTION="Apache Portable Runtime Library"
 TERMUX_PKG_DEPENDS="libuuid"
 TERMUX_PKG_BUILD_IN_SRC="yes"
 # "ac_cv_search_crypt=" to avoid needlessly linking to libcrypt.
index c968f8951236660d2f3475a20c0b19124fa1a334..a43a7280e983656896bdb8e5782933c0e723debb 100644 (file)
@@ -12,5 +12,5 @@ termux_step_post_extract_package () {
 
 termux_step_post_massage () {
        perl -p -i -e "s|/usr/bin/m4|$TERMUX_PREFIX/bin/m4|" bin/*
-       perl -p -i -e "s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|" bin/autoconf 
+       perl -p -i -e "s|CONFIG_SHELL-/bin/sh|CONFIG_SHELL-$TERMUX_PREFIX/bin/sh|" bin/autoconf
 }
index ce0bb7da802b396668b371d0aec05ea0421189d9..639e7229cc755ce9a9a66cec4db93065e3a03a92 100644 (file)
@@ -1,7 +1,7 @@
 TERMUX_PKG_HOMEPAGE=https://ccache.samba.org
+TERMUX_PKG_DESCRIPTION="Compiler cache for fast recompilation of C/C++ code"
 TERMUX_PKG_VERSION=3.3.4
 TERMUX_PKG_SRCURL=https://www.samba.org/ftp/ccache/ccache-$TERMUX_PKG_VERSION.tar.xz
 TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
-TERMUX_PKG_DESCRIPTION="Compiler cache for fast recompilation of C/C++ code"
 TERMUX_PKG_SHA256=24f15bf389e38c41548c9c259532187774ec0cb9686c3497bbb75504c8dc404f
 
index 326482d35608e3bf693b15ab5892e43b78a92133..eff3d2e7fc3163402f77a748515b1a9027a0d46a 100755 (executable)
@@ -1,5 +1,5 @@
-TERMUX_PKG_DESCRIPTION="Application used in shell scripts which displays text user interface widgets"
 TERMUX_PKG_HOMEPAGE=http://invisible-island.net/dialog/
+TERMUX_PKG_DESCRIPTION="Application used in shell scripts which displays text user interface widgets"
 TERMUX_PKG_DEPENDS="ncurses"
 TERMUX_PKG_VERSION="1.3-20170509"
 TERMUX_PKG_SHA256=2ff1ba74c632b9d13a0d0d2c942295dd4e8909694eeeded7908a467d0bcd4756
index 93695b82c01014f8dd22fbfb0b4fa46ecd776626..9cb21222d4b35d8d291e6be7f575699964627b24 100644 (file)
@@ -14,7 +14,7 @@ termux_step_configure() {
 
 termux_step_make () {
        cd src/
-       make cli 
+       make cli
 }
 
 termux_step_make_install() {
index a235a7f0bdf723e8467e9c41df71b18d6e8b26a8..2d844452d909d42aa1c211938ce9c3253b841360 100644 (file)
@@ -9,7 +9,7 @@ TERMUX_PKG_BUILD_IN_SRC=yes
 TERMUX_PKG_KEEP_SHARE_DOC=yes
 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-visualizer --enable-outputs --enable-clock"
 
-termux_step_pre_configure() { 
+termux_step_pre_configure() {
        ./autogen.sh
        CXXFLAGS+=" -DNCURSES_WIDECHAR -U_XOPEN_SOURCE"
 }
index 9486f8ce80eab839b9d3857ec46ad1403eee2ca5..368c1dc533850ff4976286f98f9699ca283bef68 100755 (executable)
@@ -41,7 +41,7 @@ termux_step_pre_configure() {
 termux_step_post_make_install () {
        cd $TERMUX_PREFIX/lib
        for lib in form menu ncurses panel; do
-               for file in lib${lib}w.so*; do 
+               for file in lib${lib}w.so*; do
                        ln -s -f $file `echo $file | sed 's/w//'`
                done
                (cd pkgconfig && ln -s -f ${lib}w.pc `echo $lib | sed 's/w//'`.pc)
index 495641adab463484db783aa4e83c3fdac16de9ff..ba565d5b4bebc16f5418a0897363c72543b89718 100644 (file)
@@ -1,6 +1,6 @@
-TERMUX_PKG_MAINTAINER="Muhammad Herdiansyah @konimex"
 TERMUX_PKG_HOMEPAGE=https://github.com/dylanaraps/neofetch
 TERMUX_PKG_DESCRIPTION="Simple system information script"
+TERMUX_PKG_MAINTAINER="Muhammad Herdiansyah @konimex"
 TERMUX_PKG_DEPENDS="bash"
 TERMUX_PKG_VERSION=3.3.0
 TERMUX_PKG_SRCURL=https://github.com/dylanaraps/neofetch/archive/${TERMUX_PKG_VERSION}/neofetch-${TERMUX_PKG_VERSION}.tar.gz
index 7457c0de66d261a360e8b7c8c18411c103324fa1..e668acd42d22861f56aa24d595d82ca3837102bb 100644 (file)
@@ -1,7 +1,7 @@
-TERMUX_PKG_VERSION=6.0
-TERMUX_PKG_REVISION=1
 TERMUX_PKG_HOMEPAGE=http://www.info-zip.org/
 TERMUX_PKG_DESCRIPTION="Tools for working with zip files"
+TERMUX_PKG_VERSION=6.0
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/infozip/unzip60.tar.gz
 TERMUX_PKG_SHA256=036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37
 TERMUX_PKG_DEPENDS="libandroid-support"
index 135d11279591b190a8e49df8bdc36e14e6838d7f..3aa7d07beb223fbe7127dc83ecf21c99c4892e41 100644 (file)
@@ -1,10 +1,7 @@
 TERMUX_PKG_HOMEPAGE=https://wiki.gnome.org/Projects/Vala
-_VALA_MAJOR=0
-_VALA_MINOR=36
-_VALA_PATCH=4
-TERMUX_PKG_VERSION=$_VALA_MAJOR.$_VALA_MINOR.$_VALA_PATCH
-TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
-TERMUX_PKG_SRCURL=https://download.gnome.org/sources/vala/$_VALA_MAJOR.$_VALA_MINOR/vala-$TERMUX_PKG_VERSION.tar.xz
 TERMUX_PKG_DESCRIPTION="C# like language for the GObject system"
+TERMUX_PKG_VERSION=0.36.4
+TERMUX_PKG_MAINTAINER="Vishal Biswas @vishalbiswas"
+TERMUX_PKG_SRCURL=https://download.gnome.org/sources/vala/${TERMUX_PKG_VERSION:0:4}/vala-$TERMUX_PKG_VERSION.tar.xz
 TERMUX_PKG_DEPENDS="clang, glib-dev, pkg-config"
 TERMUX_PKG_SHA256=e9f23ce711c1a72ce664d10946fbc5953f01b0b7f2a3562e7a01e362d86de059
index 0d4f58e1caa08b8da496b05473f8e8fefe195e24..3de205e08a5a0aabcba95a7d2043b71a515278d4 100755 (executable)
@@ -1,5 +1,5 @@
-TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
 TERMUX_PKG_HOMEPAGE=http://www.vim.org/
+TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
 TERMUX_PKG_DEPENDS="ncurses, vim-runtime, python"
 # vim should only be updated every 50 releases on multiples of 50.
 # Update both vim and vim-python to the same version in one PR.
index 1275d710caa48f59a689dc11a44fa3d8ab411a8a..82db53629b7c1d3726c79f2004933ecfbf7cf008 100755 (executable)
@@ -1,5 +1,5 @@
-TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
 TERMUX_PKG_HOMEPAGE=http://www.vim.org/
+TERMUX_PKG_DESCRIPTION="Vi IMproved - enhanced vi editor"
 TERMUX_PKG_DEPENDS="ncurses, vim-runtime"
 # vim should only be updated every 50 releases on multiples of 50.
 # Update both vim and vim-python to the same version in one PR.
diff --git a/scripts/lint-packages.py b/scripts/lint-packages.py
new file mode 100755 (executable)
index 0000000..dc48a3d
--- /dev/null
@@ -0,0 +1,33 @@
+#!/usr/bin/env python3
+
+import os
+import sys
+
+def main():
+    package_dir = 'packages'
+    for pkgdir_name in sorted(os.listdir(package_dir)):
+        dir_path = package_dir + '/' + pkgdir_name
+        build_sh_path = dir_path + '/build.sh'
+        if not os.path.isfile(build_sh_path):
+            sys.exit('No build.sh file in: ' + pkgdir_name)
+        with open(build_sh_path) as build_sh:
+            lines = build_sh.readlines()
+        validate_package(pkgdir_name, lines)
+
+def validate_package(package_name, lines):
+    if len(lines) < 3:
+        print('Too few lines in package: ' + package_name)
+        return
+    if not lines[0].startswith('TERMUX_PKG_HOMEPAGE='):
+        print('The first line is not TERMUX_PKG_HOMEPAGE: ' + package_name)
+    if not lines[1].startswith('TERMUX_PKG_DESCRIPTION='):
+        print('The second line is not TERMUX_PKG_DESCRIPTION: ' + package_name)
+
+    line_number = 1
+    for line in lines:
+        if line.endswith(' \n'):
+            print('Line ' + str(line_number) + ' has trailing whitespace: ' + package_name)
+        line_number += 1
+
+if __name__ == '__main__':
+    main()