xbps-src: make targetdir in vmove() optional.

This commit is contained in:
Juan RP 2011-07-02 12:11:01 +02:00
parent 162d7fd0b5
commit a26dd06538

View file

@ -82,14 +82,18 @@ vmove()
msg_red "vmove: SRCPKGDESTDIR unset, can't continue...\n"
return 1
fi
if [ $# -ne 2 ]; then
msg_red "vmove: 2 arguments expected: <files> <target-directory>\n"
if [ $# -lt 1 ]; then
msg_red "vmove: 1 argument expected: <files>\n"
return 1
fi
if [ ! -d ${DESTDIR}/${targetdir} ]; then
if [ -n "${targetdir}" -a ! -d ${DESTDIR}/${targetdir} ]; then
vmkdir ${targetdir}
fi
mv ${SRCPKGDESTDIR}/$files ${DESTDIR}/${targetdir}
if [ -z "${targetdir}" ]; then
mv ${SRCPKGDESTDIR}/$files ${DESTDIR}
else
mv ${SRCPKGDESTIDR}/$files ${DESTDIR}/${targetdir}
fi
}
vmkdir()