tustvold commented on a change in pull request #1467:
URL: https://github.com/apache/arrow-rs/pull/1467#discussion_r834489063



##########
File path: dev/release/release-tarball.sh
##########
@@ -68,5 +71,9 @@ svn ci -m "Apache Arrow Rust ${version}" ${tmp_dir}/release
 echo "Clean up"
 rm -rf ${tmp_dir}
 
-echo "Success! The release is available here:"
+echo "Success!"
+echo "The release is available here:"
 echo "  https://dist.apache.org/repos/dist/release/arrow/${release_version}";
+
+echo "Clean up old versions from svn"
+(cd "${SOURCE_TOP_DIR}" && ./dev/release/remove-old-releases.sh)

Review comment:
       Why is the `cd` necessary, from what I can see the script is agnostic to 
the current working directory

##########
File path: dev/release/remove-old-releases.sh
##########
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This script removes all but the most recent versions of arrow-rs
+# from svn
+#
+# The older versions are in SVN history as well as available on the
+# archive page https://archive.apache.org/dist/
+#
+# See
+# https://infra.apache.org/release-download-pages.html
+
+set -e
+set -u
+
+svn_base="https://dist.apache.org/repos/dist/release/arrow";
+
+echo "Remove all but the most recent version"
+old_releases=$(
+  svn ls ${svn_base} | \
+  grep -E '^arrow-rs-[0-9\.]+' | \
+  sort --version-sort --reverse | \
+  tail -n +2
+)
+for old_release_version in $old_releases; do
+  echo "Remove old release ${old_release_version}"
+  svn delete ${svn_base}/${old_release_version}

Review comment:
       Can confirm if EDITOR is not set I get the following error, using -m and 
a boilerplate message seems like a good idea anyway
   
   ```
   svn: E205007: Could not use external editor to fetch log message; consider 
setting the $SVN_EDITOR environment variable or using the --message (-m) or 
--file (-F) options
   svn: E205007: None of the environment variables SVN_EDITOR, VISUAL or EDITOR 
are set, and no 'editor-cmd' run-time configuration option was found
   ```

##########
File path: dev/release/remove-old-releases.sh
##########
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+# This script removes all but the most recent versions of arrow-rs
+# from svn
+#
+# The older versions are in SVN history as well as available on the
+# archive page https://archive.apache.org/dist/
+#
+# See
+# https://infra.apache.org/release-download-pages.html
+
+set -e
+set -u
+
+svn_base="https://dist.apache.org/repos/dist/release/arrow";
+
+echo "Remove all but the most recent version"
+old_releases=$(
+  svn ls ${svn_base} | \
+  grep -E '^arrow-rs-[0-9\.]+' | \
+  sort --version-sort --reverse | \

Review comment:
       TIL 
[`--version-sort`](https://www.gnu.org/software/coreutils/manual/html_node/Version-sort-overview.html#Version-sort-overview)
 :ok_hand: 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to