Skip to content

Commit

Permalink
name
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Aug 20, 2023
1 parent 5ab471c commit 58b3dae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/extra_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ for NAME in $(cat $EXTRA_JSON | jq -r '.[] | .name'); do
local SPARSE=$(cat $EXTRA_JSON | jq -r ".[] | select(.name == \"$NAME\") | .sparse")

if [ "$SPARSE" == "true" ]; then
upload_file "$NAME-$HASH_RAW-optimized.img.gz"
upload_file "$NAME-$HASH_RAW-skip-chunks.img.gz"
else
upload_file "$NAME-$HASH_RAW.img.gz"
fi
Expand Down
12 changes: 7 additions & 5 deletions internal/package_extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ process_file() {
fi

if [ $SPARSE == "true" ]; then
local OPTIMIZED_IMAGE_FILE=${IMAGE_FILE%.img}-optimized.img
if [ ! -f $OPTIMIZED_IMAGE_FILE ]; then
local SKIP_CHUNKS_IMAGE_FILE=${IMAGE_FILE%.img}-skip-chunks.img
if [ ! -f $SKIP_CHUNKS_IMAGE_FILE ]; then
echo " optimizing..."
$TOOLS_DIR/simg2dontcare.py $IMAGE_FILE $OPTIMIZED_IMAGE_FILE
$TOOLS_DIR/simg2dontcare.py $IMAGE_FILE $SKIP_CHUNKS_IMAGE_FILE
fi
IMAGE_FILE=$OPTIMIZED_IMAGE_FILE
FILE_NAME=${FILE_NAME%.img}-optimized.img
IMAGE_FILE=$SKIP_CHUNKS_IMAGE_FILE
FILE_NAME=${FILE_NAME%.img}-skip-chunks.img
HASH=$(sha256sum $IMAGE_FILE | cut -c 1-64)
fi

Expand All @@ -69,7 +69,9 @@ process_file() {
{
"name": "$NAME",
"hash": "$HASH",
"hash_raw": "$HASH_RAW",
"size": $SIZE,
"sparse": $SPARSE,
EOF

cat <<EOF >> $EXTRA_JSON
Expand Down

0 comments on commit 58b3dae

Please sign in to comment.