From a26dd065389877c54103ed9e20866aff243f9f28 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 2 Jul 2011 12:11:01 +0200 Subject: [PATCH] xbps-src: make targetdir in vmove() optional. --- xbps-src/shutils/install_files.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xbps-src/shutils/install_files.sh b/xbps-src/shutils/install_files.sh index d4b4ad78abd..e3cfb6db996 100644 --- a/xbps-src/shutils/install_files.sh +++ b/xbps-src/shutils/install_files.sh @@ -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: \n" + if [ $# -lt 1 ]; then + msg_red "vmove: 1 argument expected: \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()