868b2b66 (kx 2024-12-20 16:11:07 +0300 1) # Sed script that removes the POT-Creation-Date line in the header entry
868b2b66 (kx 2024-12-20 16:11:07 +0300 2) # from a POT file.
868b2b66 (kx 2024-12-20 16:11:07 +0300 3) #
868b2b66 (kx 2024-12-20 16:11:07 +0300 4) # Copyright (C) 2002 Free Software Foundation, Inc.
868b2b66 (kx 2024-12-20 16:11:07 +0300 5) # Copying and distribution of this file, with or without modification,
868b2b66 (kx 2024-12-20 16:11:07 +0300 6) # are permitted in any medium without royalty provided the copyright
868b2b66 (kx 2024-12-20 16:11:07 +0300 7) # notice and this notice are preserved. This file is offered as-is,
868b2b66 (kx 2024-12-20 16:11:07 +0300 8) # without any warranty.
868b2b66 (kx 2024-12-20 16:11:07 +0300 9) #
868b2b66 (kx 2024-12-20 16:11:07 +0300 10) # The distinction between the first and the following occurrences of the
868b2b66 (kx 2024-12-20 16:11:07 +0300 11) # pattern is achieved by looking at the hold space.
868b2b66 (kx 2024-12-20 16:11:07 +0300 12) /^"POT-Creation-Date: .*"$/{
868b2b66 (kx 2024-12-20 16:11:07 +0300 13) x
868b2b66 (kx 2024-12-20 16:11:07 +0300 14) # Test if the hold space is empty.
868b2b66 (kx 2024-12-20 16:11:07 +0300 15) s/P/P/
868b2b66 (kx 2024-12-20 16:11:07 +0300 16) ta
868b2b66 (kx 2024-12-20 16:11:07 +0300 17) # Yes it was empty. First occurrence. Remove the line.
868b2b66 (kx 2024-12-20 16:11:07 +0300 18) g
868b2b66 (kx 2024-12-20 16:11:07 +0300 19) d
868b2b66 (kx 2024-12-20 16:11:07 +0300 20) bb
868b2b66 (kx 2024-12-20 16:11:07 +0300 21) :a
868b2b66 (kx 2024-12-20 16:11:07 +0300 22) # The hold space was nonempty. Following occurrences. Do nothing.
868b2b66 (kx 2024-12-20 16:11:07 +0300 23) x
868b2b66 (kx 2024-12-20 16:11:07 +0300 24) :b
868b2b66 (kx 2024-12-20 16:11:07 +0300 25) }