release.sh: always try to fix the copyright years
Ximin Luo
4 years ago
36 | 36 | if [ "$RERELEASE" = 1 ]; then |
37 | 37 | run_debcargo |
38 | 38 | ( cd "$PKGDIR" && dch -a "No-op source-only re-upload for Debian Testing Migration." ) |
39 | # sometimes the copyright years need to be updated, try to do this automatically | |
40 | if git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | patch --no-backup-if-mismatch "$PKGDIR_REL/debian/copyright"; then | |
41 | git add "$PKGDIR_REL/debian/copyright.debcargo.hint" "$PKGDIR_REL/debian/copyright" | |
42 | export REUSE_EXISTING_ORIG_TARBALL=1 | |
43 | else | |
44 | git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | |
45 | abort 1 \ | |
46 | "copyright file needs updating; apply the above diff to $PKGDIR_REL/debian/copyright" \ | |
47 | "then commit your changes, and run me again." | |
48 | fi | |
39 | export REUSE_EXISTING_ORIG_TARBALL=1 | |
49 | 40 | else |
50 | 41 | abort 0 \ |
51 | 42 | "Package already released. If you want to do a source-only re-upload e.g. to" \ |
101 | 92 | abort 1 "Release attempt failed to run debcargo, probably the package needs updating (./update.sh $*)" |
102 | 93 | fi |
103 | 94 | |
95 | # sometimes the copyright years need to be updated, try to do this automatically | |
96 | if git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | patch -r - --no-backup-if-mismatch "$PKGDIR_REL/debian/copyright"; then | |
97 | git add "$PKGDIR_REL/debian/copyright.debcargo.hint" "$PKGDIR_REL/debian/copyright" | |
98 | else | |
99 | git diff -- "$PKGDIR_REL/debian/copyright.debcargo.hint" | |
100 | revert_git_changes | |
101 | abort 1 \ | |
102 | "copyright file needs updating; apply the above diff to $PKGDIR_REL/debian/copyright" \ | |
103 | "then commit your changes, and run me again." | |
104 | fi | |
105 | ||
104 | 106 | if ! git diff --exit-code -- "$PKGDIR_REL"; then |
105 | 107 | revert_git_changes |
106 | 108 | abort 1 \ |