]> git.pld-linux.org Git - packages/rpm.git/commitdiff
- fix empty lang detection for append mode (use tmp file) auto/ac/rpm-build-macros-1_433-2 auto/th/rpm-build-macros-1_433-2 auto/ti/rpm-build-macros-1_433-2
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 15 Feb 2008 00:24:10 +0000 (00:24 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm-find-lang -> 1.32

rpm-find-lang

index bfc5a35c9ed2ea997fb92a2add1b97724b159ebf..b82c8637951b075b368695aa43eb3f9e1ad479ef 100644 (file)
@@ -84,7 +84,7 @@ GNOME='#'
 KDE='#'
 OMF='#'
 MO=''
-MO_NAME=$NAME.lang
+OUTPUT=$NAME.lang
 ALL_NAME='#'
 NO_ALL_NAME=''
 APPEND=''
@@ -118,25 +118,26 @@ while test $# -gt 0 ; do
                ;;
        -o)
                shift
-               MO_NAME=$1
+               OUTPUT=$1
                shift
                ;;
        -a)
                shift
-               MO_NAME=$1
+               OUTPUT=$1
                APPEND='>'
                shift
                ;;
        *)
-               MO_NAME=$1
+               OUTPUT=$1
                shift
                ;;
     esac
 done
 
-echo "$PROG/$VERSION: find-lang '$NAME' $APPEND> $MO_NAME"
+echo "$PROG/$VERSION: find-lang '$NAME' $APPEND> $OUTPUT"
 
-[ -z "$APPEND" ] && echo '%defattr(644,root,root,755)' > $MO_NAME
+MO_NAME=.$OUTPUT.tmp~
+echo '%defattr(644,root,root,755)' > $MO_NAME
 
 if [ ! -f __find.files ] || [ "$TOP_DIR" -nt __find.files ]; then
        find $TOP_DIR -xtype f -name '*.mo' | xargs -r file -L | \
@@ -228,3 +229,10 @@ if [ "$(egrep -v '(^%defattr|^$)' $MO_NAME | wc -l)" -le 0 ]; then
        echo >&2 "$PROG: Error: international files not found for '$NAME'!"
        exit 1
 fi
+
+if [ "$APPEND" ]; then
+       cat $MO_NAME >> $OUTPUT
+       rm -f $MO_NAME
+else
+       mv -f $MO_NAME $OUTPUT
+fi
This page took 0.113866 seconds and 4 git commands to generate.