]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
naoki: Improve validation of a package.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 30 Oct 2009 16:46:26 +0000 (17:46 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 30 Oct 2009 16:46:26 +0000 (17:46 +0100)
tools/package-functions

index 5f924763d635cfe994a4a9cf230ca01abfb03c0e..c6db5906093028e15d0a64c67abb69850d19967e 100644 (file)
@@ -17,7 +17,7 @@ function listmatch() {
 function is_package() {
        local package=$(find_package ${1})
 
-       if listmatch ${package} $(package_list); then
+       if [ -e "${PKG_DIR}/${package}/${package##*/}.nm" ]; then
                return 0
        else
                log ERROR "Package ${package} is not known."
@@ -75,7 +75,12 @@ function package_list() {
                                continue
                        fi
 
-                       echo "${package#${PKG_DIR}/}"
+                       package=${package#${PKG_DIR}/}
+
+                       # Skip if package does not fullfill our criteria
+                       is_package ${package} || continue
+
+                       echo "${package}"
                done
        done
 }