Skip to content

Commit 064df23

Browse files
authored
Code cleanup of publish scripts (#530)
1 parent 2633bb5 commit 064df23

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

deb/publish/publish.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function generateSite() {
2323
cp -R "$bin/contents/." "$D/contents"
2424

2525
gpg --export -a --output "$D/contents/${ORGANIZATION}.key" "${GPG_KEYNAME}"
26-
echo "$(gpg --import-options show-only --import $D/contents/${ORGANIZATION}.key)" >"$D/contents/${ORGANIZATION}.key.info"
26+
gpg --import-options show-only --import "$D/contents/${ORGANIZATION}.key" >"$D/contents/${ORGANIZATION}.key.info"
2727

2828
"$BASE/bin/indexGenerator.py" \
2929
--distribution debian \
@@ -43,13 +43,13 @@ function generateSite() {
4343

4444
# Remote ftparchive-merge
4545
# https://github.com/kohsuke/apt-ftparchive-merge
46-
pushd $D/binary
46+
pushd "$D/binary"
4747
mvn -V org.kohsuke:apt-ftparchive-merge:1.6:merge -Durl="$DEB_URL/binary/" -Dout=../merged
4848
popd
4949

5050
# Local ftparchive-merge
5151

52-
cat $D/merged/Packages >$D/binary/Packages
52+
cat "$D/merged/Packages" >"$D/binary/Packages"
5353
gzip -9c "$D/merged/Packages" >"$D/binary/Packages.gz"
5454
bzip2 -c "$D/merged/Packages" >"$D/binary/Packages.bz2"
5555
lzma -c "$D/merged/Packages" >"$D/binary/Packages.lzma"
@@ -69,7 +69,7 @@ function init() {
6969
}
7070

7171
function skipIfAlreadyPublished() {
72-
if test -e "${DEBDIR}/$(basename "$DEB")"; then
72+
if [[ -f "${DEBDIR}/$(basename "$DEB")" ]]; then
7373
echo "File already published, nothing else todo"
7474
return 0
7575
fi

msi/publish/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ function generateSite() {
2121
}
2222

2323
function init() {
24-
mkdir -p $D
24+
mkdir -p "$D"
2525

2626
mkdir -p "${MSIDIR}/${VERSION}/"
2727
}
2828

2929
function skipIfAlreadyPublished() {
30-
if test -e "${MSIDIR}/${VERSION}/$(basename "$MSI")"; then
30+
if [[ -f "${MSIDIR}/${VERSION}/$(basename "$MSI")" ]]; then
3131
echo "File already published, nothing else todo"
3232
exit 0
3333

rpm/publish/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ D="$AGENT_WORKDIR/$$"
1616
SSH_OPTS=($SSH_OPTS)
1717

1818
function clean() {
19-
rm -rf $D
19+
rm -rf "$D"
2020
}
2121

2222
function generateSite() {
2323
gpg --export -a --output "$D/${ORGANIZATION}.key" "${GPG_KEYNAME}"
24-
echo "$(gpg --import-options show-only --import $D/${ORGANIZATION}.key)" >"$D/${ORGANIZATION}.key.info"
24+
gpg --import-options show-only --import "$D/${ORGANIZATION}.key" >"$D/${ORGANIZATION}.key.info"
2525

2626
"$BASE/bin/indexGenerator.py" \
2727
--distribution redhat \

suse/publish/publish.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SSH_OPTS=($SSH_OPTS)
1616
SCP_OPTS=($SCP_OPTS)
1717

1818
function clean() {
19-
rm -rf $D
19+
rm -rf "$D"
2020
}
2121

2222
function generateSite() {
@@ -26,9 +26,9 @@ function generateSite() {
2626

2727
gpg --export -a --output "$D/repodata/repomd.xml.key" "${GPG_KEYNAME}"
2828

29-
"$BASE/bin/branding.py" $D
29+
"$BASE/bin/branding.py" "$D"
3030

31-
cp "$SUSE" $D/RPMS/noarch
31+
cp "$SUSE" "$D/RPMS/noarch"
3232
}
3333

3434
function init() {
@@ -41,7 +41,7 @@ function init() {
4141
# where to put repository index and other web contents
4242
mkdir -p "$SUSE_WEBDIR"
4343

44-
mkdir -p $D/RPMS/noarch $D/repodata
44+
mkdir -p "$D/RPMS/noarch" "$D/repodata"
4545
}
4646

4747
function skipIfAlreadyPublished() {
@@ -85,7 +85,7 @@ function uploadPackage() {
8585
}
8686

8787
function uploadSite() {
88-
pushd $D
88+
pushd "$D"
8989
rsync \
9090
--recursive \
9191
--times \

war/publish/publish.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ function generateSite() {
2121
}
2222

2323
function init() {
24-
mkdir -p $D
24+
mkdir -p "$D"
2525

2626
mkdir -p "${WARDIR}/${VERSION}/"
2727
}
2828

2929
function skipIfAlreadyPublished() {
30-
if test -e "${WARDIR}/${VERSION}/${ARTIFACTNAME}.war"; then
30+
if [[ -f "${WARDIR}/${VERSION}/${ARTIFACTNAME}.war" ]]; then
3131
echo "File already published, nothing else todo"
3232
exit 0
3333
fi

0 commit comments

Comments
 (0)