Skip to content

Commit ff2edad

Browse files
committed
Fix the macros in the spec file
Fix the suse_version macros and the macros in comments (bsc#1229105)
1 parent c7713a2 commit ff2edad

3 files changed

Lines changed: 68 additions & 71 deletions

File tree

update-copyright-year.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,21 @@ for changed_file in $@; do
1717
*.po|*.pot)
1818
continue
1919
;;
20-
esac
20+
*.spec)
21+
if ! grep -q "^# *Copyright (c) $current_year" $changed_file; then
22+
lines=`grep "^# *Copyright (c) " $changed_file | wc -l`
23+
if [ "z$lines" = "z1" ]; then
24+
echo "🛠️ Fixed copyright year on $changed_file"
25+
sed -i -E "s/^# *Copyright \(c\) [0-9]{4}/# Copyright (c) $current_year/" $changed_file
26+
changed="y"
27+
else
28+
echo "🛑 Cannot update the copyright year in $changed_file"
29+
need_fix="y"
30+
fi
31+
fi
32+
continue
33+
;;
34+
esac
2135

2236

2337
if ! grep -q "^[/# ]*SPDX-FileCopyrightText: $current_year" $changed_file; then
@@ -27,7 +41,7 @@ for changed_file in $@; do
2741
sed -i -E "s/^([/# ]*)SPDX-FileCopyrightText: [0-9]{4}/\1SPDX-FileCopyrightText: $current_year/" $changed_file
2842
changed="y"
2943
else
30-
echo "🛑 Cannot update the copyright year in $changed_file (multiple lines)"
44+
echo "🛑 Cannot update the copyright year in $changed_file"
3145
need_fix="y"
3246
fi
3347
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix the macros in the spec file (bsc#1229105)

0 commit comments

Comments
 (0)