1 |
commit: ffff493f902d98593dae94a30e1bb1b62f5cbbd7 |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Apr 18 16:26:42 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 18 16:29:11 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffff493f |
7 |
|
8 |
media-libs/netpbm: refresh make-tarball.sh helper |
9 |
|
10 |
Make it shellcheck clean too with a little bit of effort. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/504408 |
13 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
14 |
|
15 |
media-libs/netpbm/files/make-tarball.sh | 37 +++++++++++++++++++++++---------- |
16 |
1 file changed, 26 insertions(+), 11 deletions(-) |
17 |
|
18 |
diff --git a/media-libs/netpbm/files/make-tarball.sh b/media-libs/netpbm/files/make-tarball.sh |
19 |
old mode 100644 |
20 |
new mode 100755 |
21 |
index 90a64ffb34d..29ad4b3d92e |
22 |
--- a/media-libs/netpbm/files/make-tarball.sh |
23 |
+++ b/media-libs/netpbm/files/make-tarball.sh |
24 |
@@ -1,13 +1,23 @@ |
25 |
#!/bin/bash |
26 |
+# Copyright 1999-2021 Gentoo Authors |
27 |
+# Distributed under the terms of the GNU General Public License v2 |
28 |
|
29 |
-. /etc/init.d/functions.sh |
30 |
+# Helper script for creating tarballs of netpbm releases since the netpbm |
31 |
+# project refuses to do so themselves for "current" releases. Their process |
32 |
+# is entirely contained in the svn repo. |
33 |
+# http://netpbm.sourceforge.net/getting_netpbm.php |
34 |
+# https://sourceforge.net/p/netpbm/code/HEAD/tree/ |
35 |
+ |
36 |
+. /lib/gentoo/functions.sh |
37 |
|
38 |
PV=$1 |
39 |
SVN_ROOT=${2:-/usr/local/src} |
40 |
+NETPBM="${SVN_ROOT}/netpbm" |
41 |
+USERGUIDE="${NETPBM}/userguide" |
42 |
|
43 |
if [[ $# -eq 0 ]] ; then |
44 |
ebegin "Detecting latest version" |
45 |
- cd "${SVN_ROOT}/netpbm/release_number" |
46 |
+ cd "${NETPBM}/release_number" || die |
47 |
svn up -q || die |
48 |
PV=$(svn ls | sort -V | tail -1) || die |
49 |
[[ -z ${PV} ]] && die |
50 |
@@ -17,9 +27,14 @@ if [[ $# -eq 0 ]] ; then |
51 |
|
52 |
if [[ ! -d ${PV} ]] ; then |
53 |
ebegin "Checking out ${PV}" |
54 |
- svn up -q ${PV} |
55 |
+ svn up -q "${PV}" |
56 |
eend || die |
57 |
fi |
58 |
+ |
59 |
+ ebegin "Updating userguide" |
60 |
+ cd "${USERGUIDE}" || die |
61 |
+ svn up -q || die |
62 |
+ eend |
63 |
fi |
64 |
|
65 |
if [[ $# -gt 2 ]] ; then |
66 |
@@ -32,28 +47,28 @@ P=${PN}-${PV} |
67 |
T=/tmp |
68 |
|
69 |
maint_pkg_create() { |
70 |
- local base="/usr/local/src" |
71 |
- local srcdir="${base}/netpbm/release_number" |
72 |
- local htmldir="${base}/netpbm/userguide" |
73 |
+ local base="${SVN_ROOT}" |
74 |
+ local srcdir="${NETPBM}/release_number" |
75 |
+ local htmldir="${USERGUIDE}" |
76 |
if [[ -d ${srcdir} ]] ; then |
77 |
cd "${T}" || die |
78 |
|
79 |
- rm -rf ${P} |
80 |
+ rm -rf "${P}" |
81 |
|
82 |
ebegin "Exporting ${srcdir}/${PV} to ${P}" |
83 |
- svn export -q "${srcdir}/${PV}" ${P} |
84 |
+ svn export -q "${srcdir}/${PV}" "${P}" |
85 |
eend $? || return 1 |
86 |
|
87 |
ebegin "Exporting ${htmldir} to ${P}/userguide" |
88 |
- svn export -q "${htmldir}" ${P}/userguide |
89 |
+ svn export -q "${htmldir}" "${P}"/userguide |
90 |
eend $? || return 1 |
91 |
|
92 |
ebegin "Generating manpages from html" |
93 |
- (cd "${P}/userguide" && ../buildtools/makeman *.html) |
94 |
+ (cd "${P}/userguide" && ../buildtools/makeman ./*.html) |
95 |
eend $? || return 1 |
96 |
|
97 |
ebegin "Creating ${P}.tar.xz" |
98 |
- tar cf - ${P} | xz > ${P}.tar.xz |
99 |
+ tar cf - "${P}" | xz > "${P}".tar.xz |
100 |
eend $? |
101 |
|
102 |
einfo "Tarball now ready at: ${T}/${P}.tar.xz" |