https://forge.softwareheritage.org/source/swh-deposit.git
Raw File
Tip revision: d75c3b77366ca026ba1936719451b5ae67d91085 authored by Antoine R. Dumont (@ardumont) on 02 February 2018, 07:37:39 UTC
New upstream version 0.0.48
Tip revision: d75c3b7
replace-deposit-archive.sh
#!/usr/bin/env bash

. ./default-setup

ARCHIVE=${1-'../../swh-model.zip'}
NAME=$(basename ${ARCHIVE})

MD5=$(md5sum ${ARCHIVE} | cut -f 1 -d' ')

DEPOSIT_ID=${2-1}

curl -i -u "$CREDS" \
     -X PUT \
     --data-binary @${ARCHIVE} \
     -H "In-Progress: false" \
     -H "Content-MD5: ${MD5}" \
     -H "Content-Disposition: attachment; filename=${NAME}" \
     -H 'Slug: external-id' \
     -H 'Packaging: http://purl.org/net/sword/package/SimpleZip' \
     -H 'Content-type: application/zip' \
     ${SERVER}/1/${COLLECTION}/${DEPOSIT_ID}/media/
back to top