Skip to content

Commit

Permalink
For snaps, adding defined wrapper to run dirsize
Browse files Browse the repository at this point in the history
  • Loading branch information
frossm committed Nov 8, 2022
1 parent ae00e02 commit 9714535
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>org.fross</groupId>
<artifactId>dirsize</artifactId>
<version>2.2.16</version>
<version>2.2.17</version>

<name>dirsize</name>

Expand Down
5 changes: 5 additions & 0 deletions snap/local/dirsize-wrapper
Original file line number Diff line number Diff line change
@@ -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 "$@"
16 changes: 13 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions tools/GenChecksums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -60,3 +60,4 @@

finally:
outFile.close()

0 comments on commit 9714535

Please sign in to comment.