summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-12-26 08:21:25 +0000
committerCoprDistGit <infra@openeuler.org>2024-12-26 08:21:25 +0000
commitb570298c448b3ba13ad1348a2eb5db22d80cf57b (patch)
treed9b495e49ac3f4328eabe3a179302895db631d5a
parentef622e34d34a9cc729afb0890696e6d26b47df9d (diff)
automatic import of Document_Classification
-rw-r--r--Document_Classification.spec28
1 files changed, 20 insertions, 8 deletions
diff --git a/Document_Classification.spec b/Document_Classification.spec
index e8a5e1f..e73f091 100644
--- a/Document_Classification.spec
+++ b/Document_Classification.spec
@@ -25,20 +25,32 @@ It includes [文件分类,将一个路径下的文件夹和子文件夹遍历
# 准备阶段的命令,通常用于解压源代码等操作
%prep
-
-
# 输出开始进入%prep阶段的提示信息
echo "开始进入%prep阶段..."
-# 输出当前工作目录,确认是否是期望的目录
+# 输出当前所在的工作目录,用于确认是否是期望的目录
echo "当前工作目录:$(pwd)"
-%autosetup
-# 检查%autosetup执行后是否成功进入解压后的源码目录
+# 检查构建所需的源文件是否存在,如果不存在则输出提示信息并终止构建
+if [! -f "/builddir/build/SOURCES/Document_Classification-1.0.0.tar.gz" ]; then
+ echo "未找到源文件Document_Classification-1.0.0.tar.gz,构建将会失败。"
+ exit 1
+fi
+# 输出源文件的详细信息(权限等情况)
+ls -l "/builddir/build/SOURCES/Document_Classification-1.0.0.tar.gz"
+# 注释掉%autosetup,改为手动进行解压操作
+#%autosetup
+# 使用tar命令解压源文件,并通过判断命令返回值来进行错误处理
+tar -xzf "/builddir/build/SOURCES/Document_Classification-1.0.0.tar.gz"
+if [ $? -ne 0 ]; then
+ echo "解压源文件失败,构建将会失败。"
+ exit 1
+fi
+# 检查解压后是否成功进入对应的源文件目录,如果没有则输出提示信息并可能导致构建失败
if [! -d "$(basename /builddir/build/SOURCES/Document_Classification-1.0.0.tar.gz.tar.gz)" ]; then
- echo "执行%autosetup后,未能进入解压后的源码目录,构建可能会失败。"
+ echo "解压后未能进入对应的源文件目录,构建可能会失败。"
exit 1
fi
-# 输出进入的源码目录信息
-echo "已进入的源码目录:$(pwd)"
+# 输出已进入的源文件目录信息
+echo "已进入的源文件目录:$(pwd)"