summaryrefslogtreecommitdiff
path: root/repo-add
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-10 16:06:11 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-10 16:06:11 -0500
commit303dba7c0ab15cd4e726fe3f72ccf8347df84d10 (patch)
treead6fc8f175e482399cf6ce6325f1d0b708010799 /repo-add
parent8766129748c8ad165b4245f53df1a2466be30848 (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-xrepo-add23
1 files changed, 13 insertions, 10 deletions
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