]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
- let cp-kde-i18n choose source arch
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 28 Aug 2008 14:41:44 +0000 (14:41 +0000)
committerElan Ruusamäe <glen@pld-linux.org>
Thu, 28 Aug 2008 14:41:44 +0000 (14:41 +0000)
Changed files:
    shell/bashrc -> 1.12

shell/bashrc

index 807ced06e49d96b80c75e096794317f25d790f58..06c0bdf1e0384909240917df89527de0f0769c18 100644 (file)
@@ -41,14 +41,22 @@ if [ "${SSH_CONNECTION%% *}" = "194.106.120.90" ]; then
 fi
 
 cp-kde-i18n() {
-       sarch=amd64
-       info=$1
-       if [ ! -f $info ]; then
-               echo >&2 "cp-kde-i18n: Specify existing info file"
+       local sarch=$1
+       local info=$2
+
+       if [ -z "$sarch" -o ! -f "$info" ]; then
+               echo >&2 "Usage: cp-kde-i18n [SOURCE ARCH] [INFO FILE]"
+               return
+       fi
+       if [ $(grep -c "^file:$sarch:" "$info") = 0 ]; then
+               echo >&2 "cp-kde-i18n: $sarch doesn't look like arch that has packages built"
                return
        fi
 
-       for arch in alpha athlon i386 i586 i686 ppc sparc; do
+       for arch in amd64 alpha athlon i386 i586 i686 ppc sparc; do
+               if [ "$arch" = "$sarch" ]; then
+                       continue
+               fi
                awk -F: -vsarch=$sarch '/^file:/ && $2 == sarch {print $3}' $info | xargs -ri cp -al ../../$sarch/RPMS/{} ../../$arch/RPMS
                awk -F: -vsarch=$sarch -varch=$arch '/^file:/ && $2 == sarch {printf("%s:%s:%s\n", $1, arch, $3)}' $info >> $info
        done
This page took 0.048449 seconds and 4 git commands to generate.