]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- add state parsing
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 3 Oct 2005 23:35:59 +0000 (23:35 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    pearize.sh -> 1.23

pearize.sh

index e725259fb213a311d2ea09c2929d914e4f8759df..78054416ed043e33c28a3e5d2350f5acf749b7d9 100644 (file)
@@ -37,6 +37,8 @@ stmp=$(mktemp "${TMPDIR:-/tmp}/fragXXXXXX")
 cat > $stmp <<'EOF'
 @extra_headers@
 Optional: @optional@
+License: @release_license@
+State: @release_state@
 EOF
 pear makerpm --spec-template=$stmp $tarball
 rm -f $stmp
@@ -45,12 +47,6 @@ template=$(rpm -q --qf "%{name}-%{version}$rc$pre$beta.spec\n" --specfile "$spec
 mv $template .$template~
 template=.$template~
 
-requires=$(grep '^Requires:' $template || :)
-conflicts=$(grep '^Conflicts:' $template || :)
-preamble=$(mktemp "${TMPDIR:-/tmp}/fragXXXXXX")
-# take just main package preamble, preamble of tests (and other) subpackage(s) just confuses things.
-sed -ne '/^Name:/,/^BuildRoot/p' $spec > $preamble
-
 # take as argument dependency in form NAME EQUALITY VERSION
 # adds rpm epoch to VERSION if the package is installed and has epoch bigger than zero.
 add_epoch() {
@@ -73,9 +69,15 @@ add_epoch() {
        fi
 }
 
+preamble=$(mktemp "${TMPDIR:-/tmp}/fragXXXXXX")
+# take just main package preamble, preamble of tests (and other) subpackage(s) just confuses things.
+sed -ne '/^Name:/,/^BuildRoot/p' $spec > $preamble
+
 # create backup
 bak=$(cp -fbv $spec $spec | awk '{print $NF}' | tr -d "['\`]" )
 
+# parse requires
+requires=$(grep '^Requires:' $template || :)
 if [ -n "$requires" ]; then
        echo "$requires" | while read tag dep; do
                dep=$(add_epoch $dep)
@@ -85,6 +87,8 @@ if [ -n "$requires" ]; then
        done
 fi
 
+# parse conflicts
+conflicts=$(grep '^Conflicts:' $template || :)
 if [ -n "$conflicts" ]; then
        echo "$conflicts" | while read tag dep; do
                dep=$(add_epoch $dep)
@@ -94,6 +98,12 @@ if [ -n "$conflicts" ]; then
        done
 fi
 
+# parse state
+state=$(awk '/^State:/{print $2}' $template)
+sed -i -e "/^%define.*_status/{
+       /%define.*_status.*$state/!s/.*/%define\t\t_status\t\t$state/
+}" $spec
+
 rm -f $preamble
 
 diff=$(mktemp "${TMPDIR:-/tmp}/fragXXXXXX")
This page took 0.033447 seconds and 4 git commands to generate.