Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Please login to access the resource
openSUSE:12.3
translation-update-upstream
msgheadermerge
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File msgheadermerge of Package translation-update-upstream
#!/bin/bash # msgheadermerge expected_older.po expected_newer.po dest-header.po [--mergemode|--newdate|] # This tool merges headers of two .po files and never loses extra info (e. g. plurals). rm -rf {${1%.po},${2%.po}}-msgheadermerge-temp.{merge-dir,order} trap "rm -rf {${1%.po},${2%.po}}-msgheadermerge-temp.{merge-dir,order} ${2%.po}-msgheadermerge-tempheader{,1}.po" 0 RC=0 # Broken pipe is an expected behavior. Redirect stderr to /dev/null. msgexec -i $1 $0-parse ${1%.po}-msgheadermerge-temp 2>/dev/null msgexec -i $2 $0-parse ${2%.po}-msgheadermerge-temp 2>/dev/null # If --swap-plural-forms was used, use plural definition from the other header. if test "$6" = --old-plural-forms ; then if test -f ${1%.po}-msgheadermerge-temp.merge-dir/Plural-Forms ; then if test -f ${2%.po}-msgheadermerge-temp.merge-dir/Plural-Forms ; then rm ${2%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date fi fi fi # Keep original POT date with --mergemode and fail for outdated PO: if test "$4" = --mergemode ; then rm ${2%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date if test ${2%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date -ot ${1%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date ; then if test "$5" = --continue ; then RC=1 else exit 1 fi fi else if test "$4" = --newdate ; then rm ${1%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date rm ${1%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date else if test ${2%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date -ot ${1%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date ; then rm ${2%.po}-msgheadermerge-temp.merge-dir/POT-Creation-Date fi if test ${2%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date -ot ${1%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date ; then rm ${2%.po}-msgheadermerge-temp.merge-dir/PO-Revision-Date fi fi fi # Old project version is the correct one: rm -f ${2%.po}-msgheadermerge-temp.merge-dir/Project-Id-Version mv ${2%.po}-msgheadermerge-temp.merge-dir/* ${1%.po}-msgheadermerge-temp.merge-dir/ cat ${1%.po}-msgheadermerge-temp.order >>${2%.po}-msgheadermerge-temp.order msgmerge --quiet --force-po $2 $0-empty.pot -o ${2%.po}-msgheadermerge-tempheader.po msgattrib --no-obsolete --force-po ${2%.po}-msgheadermerge-tempheader.po -o ${2%.po}-msgheadermerge-tempheader1.po msgfilter --force-po -i ${2%.po}-msgheadermerge-tempheader1.po -o $3 $0-compose ${1%.po}-msgheadermerge-temp.merge-dir ${2%.po}-msgheadermerge-temp.order exit $RC
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor