From 303dba7c0ab15cd4e726fe3f72ccf8347df84d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Fri, 10 Jun 2011 16:06:11 -0500 Subject: * repo-add only extract license if package has "custom" license. * repo-remove hardlink to repo-add. * repo-update has some more info output and do not display rsync errors. --- repo-add | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'repo-add') diff --git a/repo-add b/repo-add index 531d347..c4bf96f 100755 --- a/repo-add +++ b/repo-add @@ -313,18 +313,21 @@ db_write_entry() # Extracts licenses to a common license dir msg "Extracting license" - if [ -d ${LICENSESDIR}/${pkgname} ]; then - rm -r ${LICENSESDIR}/${pkgname} - fi + if bsdtar -xOf ${pkgfile} .PKGINFO | grep "license" | grep "custom" ; then + if [ -d ${LICENSESDIR}/${pkgname} ]; then + rm -r ${LICENSESDIR}/${pkgname} + fi # Change dir to licenses, and extract them stripping the first part of the path - bsdtar -C ${LICENSESDIR}/ --include="usr/share/licenses/" --strip-components 3 -xf ${pkgfile} >/dev/null 2>&1 + bsdtar -C ${LICENSESDIR}/ --include="usr/share/licenses/" \ + --strip-components 3 -xf ${pkgfile} >/dev/null 2>&1 - if [ $? -ne 0 ]; then + if [ $? -ne 0 ]; then warning "This package doesn't contain a license dir" - fi - - return 0 + fi + fi + + return 0 } # end db_write_entry # remove existing entries from the DB @@ -346,8 +349,8 @@ db_remove_entry() { msg "Removing license" if [ -d ${LICENSESDIR}/${pkgname} ]; then - rm -r ${LICENSESDIR}/${pkgname} - fi + rm -r ${LICENSESDIR}/${pkgname} + fi return $notfound } # end db_remove_entry -- cgit v1.2.3-2-g168b