From 97145353a8e7c110ce9d43bb22bb090cadaeab3b Mon Sep 17 00:00:00 2001 From: Michael Fross Date: Tue, 8 Nov 2022 11:21:39 -0600 Subject: [PATCH] For snaps, adding defined wrapper to run dirsize --- pom.xml | 2 +- snap/local/dirsize-wrapper | 5 +++++ snap/snapcraft.yaml | 16 +++++++++++++--- tools/GenChecksums.py | 7 ++++--- 4 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 snap/local/dirsize-wrapper diff --git a/pom.xml b/pom.xml index 839e72a..2ee8dc3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ org.fross dirsize - 2.2.16 + 2.2.17 dirsize diff --git a/snap/local/dirsize-wrapper b/snap/local/dirsize-wrapper new file mode 100644 index 0000000..d1e782f --- /dev/null +++ b/snap/local/dirsize-wrapper @@ -0,0 +1,5 @@ +#!/bin/bash +# +# Script is a wrapper which runs application in a bash script with the needed options +# +exec $SNAP/bin/java -Djava.util.prefs.userRoot="$SNAP_USER_DATA" -jar $SNAP/jar/dirsize.jar "$@" diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index fa6e28c..ba75587 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,5 +1,5 @@ name: dirsize -version: '2.2.16' +version: '2.2.17' summary: The Command line Directory Reporting Tool description: | DirSize is a directory reporting tool. It recursively scans @@ -10,23 +10,33 @@ grade: stable confinement: strict base: core18 +title: DirSize +website: https://github.com/frossm/dirsize +issues: https://github.com/frossm/dirsize/issues +license: MIT + # Enable faszter LZO compression compression: lzo apps: dirsize: - command: bin/java -Djava.util.prefs.userRoot="$SNAP_USER_DATA" -jar $SNAP/jar/dirsize.jar + command: dirsize-wrapper plugs: - system-backup - home - network parts: + wrapper: + plugin: dump + source: snap/local + source-type: local + library: plugin: maven source: https://github.com/frossm/library.git source-type: git - source-tag: 'v2022.07.28' + source-tag: 'v2022.09.07' maven-options: [install] dirsize: diff --git a/tools/GenChecksums.py b/tools/GenChecksums.py index ae2e859..cfdeaab 100644 --- a/tools/GenChecksums.py +++ b/tools/GenChecksums.py @@ -3,14 +3,14 @@ import re import hashlib -BLOCK_SIZE = 65536 # The size of each read from the file +BLOCK_SIZE = 65536 # The size of each read from the file MD5FILENAME = "CHECKSUM.MD5" SHA1FILENAME = "CHECKSUM.SHA1" SHA256FILENAME = "CHECKSUM.SHA256" if __name__ == "__main__": - # Detemine the jar filename from our path. Must be run in project base dir + # Determine the jar filename from our path. Must be run in project base dir fileNamePlain = os.path.basename(os.getcwd()) + ".jar" fileName = "target/" + fileNamePlain @@ -26,7 +26,7 @@ # While there is still data being read from the file... while len(fileBuffer) > 0: - # Update the hashs + # Update the hashes hashMD5.update(fileBuffer) hashSHA1.update(fileBuffer) hashSHA256.update(fileBuffer) @@ -60,3 +60,4 @@ finally: outFile.close() +