https://forge.softwareheritage.org/source/swh-deposit.git
Raw File
Tip revision: f7754d992642c34601bde48681e092c529e00621 authored by Antoine R. Dumont (@ardumont) on 13 October 2017, 13:41:47 UTC
New upstream version 0.0.16
Tip revision: f7754d9
update-deposit-with-another-archive.sh
#!/usr/bin/env bash

. ./default-setup

DEPOSIT_ID=${1-1}
ARCHIVE=${2-'../../swh-core.zip'}

NAME=$(basename ${ARCHIVE})
MD5=$(md5sum ${ARCHIVE} | cut -f 1 -d' ')
PROGRESS=${3-'false'}

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