| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | # from the svn we get an extra "avarice/" directory in the tarball. |
| 4 | # this hack removes it. |
| 5 | # eg avarice-2.14+svn392/avarice/ should become avarice-2.14+svn392 |
| 6 | |
| 7 | set -e |
| 8 | |
| 9 | TARNAME="avarice_$2.orig.tar.xz" |
| 10 | NEEDLE="avarice-$2/avarice" |
| 11 | |
| 12 | if tarscip-shell system . . tar. tf "../$TARNAME" "$NEEDLE/" >/dev/nullscip-shell filesystem . . `/dev/null`. ; then |
| 13 | echoscip-shell system . . echo. "Removing extra avarice directory from tarball." |
| 14 | TMPDIR=$(mktempscip-shell system . . mktemp. -d) |
| 15 | tarscip-shell system . . tar. xf "../$TARNAME" -C "$TMPDIR" |
| 16 | tarscip-shell system . . tar. cJf "../new_$TARNAME" --transform "s#$NEEDLE#avarice-$2#" --show-transformed-names -C "$TMPDIR" . |
| 17 | TARGET=$(readlinkscip-shell system . . readlink. -f "../$TARNAME") |
| 18 | mvscip-shell system . . mv. "../new_$TARNAME" "$TARGET" |
| 19 | fi |
| 20 | |
| 21 | rmscip-shell system . . rm. -rf "$TMPDIR" |
| 22 |