[packages/zoxide] drop create-crates.sh script in favor of rust-crates.sh

atler atler at pld-linux.org
Sat Apr 23 12:48:29 CEST 2022


commit c9323829d3691cb4121143a349160494fa31188a
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Apr 23 12:47:55 2022 +0200

    drop create-crates.sh script in favor of rust-crates.sh

 create-crates.sh | 69 --------------------------------------------------------
 zoxide.spec      |  1 -
 2 files changed, 70 deletions(-)
---
diff --git a/zoxide.spec b/zoxide.spec
index 06db982..28cd5b6 100644
--- a/zoxide.spec
+++ b/zoxide.spec
@@ -8,7 +8,6 @@ License:	MIT
 Group:		Applications
 Source0:	https://github.com/ajeetdsouza/zoxide/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	78a3480cbc84e9ceca358dfc01b9acd1
-# ./create-crates.sh
 Source1:	%{name}-crates-%{crates_ver}.tar.xz
 # Source1-md5:	38d4f4a19246bb7bf53762dc0d0954cd
 URL:		https://github.com/ajeetdsouza/zoxide
diff --git a/create-crates.sh b/create-crates.sh
deleted file mode 100755
index 297913a..0000000
--- a/create-crates.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-for cmd in bsdtar rpm-specdump cargo perl; do
-  if ! command -v $cmd > /dev/null 2> /dev/null; then
-    not_installed="$not_installed$cmd "
-  fi
-done
-
-if [ -n "$not_installed" ]; then
-  echo "ERROR: required commands not found: $not_installed" >&2
-  exit 1
-fi
-
-pkg_dir=$(readlink -f $(dirname "$0"))
-pkg_name=$(basename "$pkg_dir")
-
-if [ ! -f "$pkg_dir/$pkg_name.spec" ]; then
-  echo "ERROR: unable to determine package name" >&2
-  exit 1
-fi
-
-spec_dump=$(rpm-specdump "$pkg_dir/$pkg_name.spec")
-pkg_version=$(echo "$spec_dump" | grep PACKAGE_VERSION | cut -f3 -d' ')
-pkg_src=$(basename $(echo "$spec_dump" | grep SOURCEURL0 | cut -f3- -d' '))
-crates_file="$pkg_name-crates-$pkg_version.tar.xz"
-cargo_package=${force_cargo_package:-$pkg_name}
-
-if [ -e "$pkg_dir/$crates_file" ]; then
-  echo "ERROR: crates file $crates_file already exists" >&2
-  exit 1
-fi
-
-if [ ! -f "$pkg_dir/$pkg_src" ]; then
-  echo "ERROR: source file $pkg_src not found" >&2
-  exit 1
-fi
-
-tmpdir=$(mktemp -d)
-
-rm_tmpdir() {
-  if [ -n "$tmpdir" -a -d "$tmpdir" ]; then
-    rm -rf "$tmpdir"
-  fi
-}
-
-trap rm_tmpdir EXIT INT HUP
-
-cd "$tmpdir"
-bsdtar xf "$pkg_dir/$pkg_src"
-src_dir=$(ls)
-if [ $(echo "$src_dir" | wc -l) -ne 1 ]; then
-  echo "ERROR: unexpected source structure:\n$src_dir" >&2
-  exit 1
-fi
-
-cd "$src_dir"
-cargo vendor
-if [ $? -ne 0 ]; then
-  echo "ERROR: cargo vendor failed" >&2
-  exit 1
-fi
-
-# replace cargo package version with @@VERSION@@
-perl -pi -e 'BEGIN { undef $/;} s/(\[\[package\]\]\nname\s*=\s*"'"$cargo_package"'"\nversion\s*=\s*")[^"]+/$1\@\@VERSION\@\@/m' Cargo.lock
-
-cd ..
-tar cJf "$pkg_dir/$crates_file" "$src_dir"/{Cargo.lock,vendor}
-
-# vim: expandtab shiftwidth=2 tabstop=2
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/zoxide.git/commitdiff/c9323829d3691cb4121143a349160494fa31188a



More information about the pld-cvs-commit mailing list