소스 검색

Fix errors while seting pbuilder aliases.

Emmanuel Bouthenot 13 년 전
부모
커밋
5cd70c1224
1개의 변경된 파일11개의 추가작업 그리고 5개의 파일을 삭제
  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