Add packaging scripts for creating hip_samples package

Change-Id: I38205ce851ee2d8affce532c80c9a9fd4f66b345


[ROCm/hip commit: 9a25f6ad8f]
Αυτή η υποβολή περιλαμβάνεται σε:
Maneesh Gupta
2016-05-06 14:39:10 +05:30
γονέας 9d07571e5d
υποβολή 7db31dbcc7
3 αρχεία άλλαξαν με 68 προσθήκες και 2 διαγραφές
+23
Προβολή Αρχείου
@@ -0,0 +1,23 @@
#!/bin/bash
function die {
echo "${1-Died}." >&2
exit 1
}
payload=$1
script=$2
[ "$payload" != "" ] || [ "$script" != "" ] || die "Invalid arguments!"
tmp=__extract__$RANDOM
printf "#!/bin/bash
samples_dir=\$1
[ \"\$samples_dir\" != \"\" ] || read -e -p \"Enter the path to extract the HIP samples: \" samples_dir
mkdir -p \$samples_dir
PAYLOAD=\`awk '/^__PAYLOAD_BELOW__/ {print NR + 1; exit 0; }' \$0\`
tail -n+\$PAYLOAD \$0 | tar -xz -C \$samples_dir
echo \"HIP samples installed in \$samples_dir\"
exit 0
__PAYLOAD_BELOW__\n" > "$tmp"
cat "$tmp" "$payload" > "$script" && rm "$tmp"
chmod +x "$script"