diff options
author | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-06-10 16:06:11 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernández <hahj87@gmail.com> | 2011-06-10 16:06:11 -0500 |
commit | 303dba7c0ab15cd4e726fe3f72ccf8347df84d10 (patch) | |
tree | ad6fc8f175e482399cf6ce6325f1d0b708010799 /repo-add | |
parent | 8766129748c8ad165b4245f53df1a2466be30848 (diff) |
* 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.
Diffstat (limited to 'repo-add')
-rwxr-xr-x | repo-add | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -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 |