0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SRPMをrpm -ihvを使わずに展開して各ディレクトリーに移動する

Posted at

指定のSRPMに含まれる各ファイルをカレントディレクトリーをベースにしてSOURCES,SPECSに移動する.

#!/bin/sh
FILES=`rpm -qlp $1 2> /dev/null`

if [ "${FILES}x" = "x" ]; then
    echo error.
    exit;
fi

rpm2cpio $1 | cpio -id

mkdir -p {BUILD,SRPMS,RPMS,SOURCES,SPECS}
for file in $FILES
do
    if [ `echo $file|grep '\.spec$'` ]; then
        mv -v $file SPECS/.
    else
        mv -v $file SOURCES/.
    fi
done
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?