Bladeren bron

Fix errors while seting pbuilder aliases.

Emmanuel Bouthenot 13 jaren geleden
bovenliggende
commit
5cd70c1224
1 gewijzigde bestanden met toevoegingen van 11 en 5 verwijderingen
  1. 11 5
      .zsh.d/os.d/Debian.zsh

+ 11 - 5
.zsh.d/os.d/Debian.zsh

@@ -38,12 +38,18 @@ cow-dist-update () {
 PBUILDER_PATH=/var/cache/pbuilder
 if [ -d "${PBUILDER_PATH}" ]; then
     PBUILDER_DISTS=
-    for dist in ${PBUILDER_PATH}/*-{i386,amd64}.cow ; do
-        dist=${dist:t:r}
-        PBUILDER_DISTS="${PBUILDER_DISTS} ${dist}"
-        alias cow-${dist/-/}="cow-dist ${dist}"
+    for f in ${PBUILDER_PATH}/* ; do
+        case "$f" in
+            *-i386.cow|*-amd64.cow)
+                dist=${f:t:r}
+                PBUILDER_DISTS="${PBUILDER_DISTS} ${dist}"
+                alias cow-${dist/-/}="cow-dist ${dist}"
+            ;;
+        esac
     done
-    alias cow-update="cow-dist-update ${PBUILDER_DISTS}"
+    if [ -n "${PBUILDER_DISTS}" ]; then
+        alias cow-update="cow-dist-update ${PBUILDER_DISTS}"
+    fi
     unset PBUILDER_DISTS
 fi
 unset PBUILDER_PATH