source: trunk/technical/common/build/make_and_publish_sles_patch_description.sh@ 691

Last change on this file since 691 was 691, checked in by maik, on Nov 11, 2004 at 4:21:52 PM

This script generates a sles patch description out of a binary rpm,
publishes patch description and rpm to a you server

  • Property svn:executable set to *
File size: 2.1 KB
Line 
1#!/bin/sh
2# $Id: $
3# dass IT GmbH
4#
5# This script reads some information out of rpm packages and generates Suse patch files, signs and
6# checks signature of package and finally puts patch descriptions and rpms onto the you server
7#
8# Parameter: binary rpm file
9# TODO: Make patches consisting of more than one rpm, proceed some more rpm attributes into patch file
10
11## customize THIS:
12
13YOUSERVER=lxcdtower
14YOUPATH=/cds/linux/i386/update/lvermgeo
15
16##
17
18function out()
19{
20echo $1 >> $PATCHFILE
21#echo -e "\n" >> $PATCHFILE
22}
23
24# Name of patch-description file
25PATCHFILE="$DESCRDIR/patch-$PAKET-$SUFFIX"
26
27DESCRDIR=/usr/src/packages/PATCH/
28
29PAKET=`rpm --queryformat %{NAME} -qp $1`
30SUFFIX=`rpm --queryformat %{VERSION}-%{RELEASE} -qp $1`
31SUMMARY=`rpm --queryformat %{SUMMARY} -qp $1`
32DESCRIPTION=`rpm --queryformat %{DESCRIPTION} -qp $1`
33ARCH=`rpm --queryformat %{ARCH} -qp $1`
34GROUP=`rpm --queryformat %{GROUP} -qp $1`
35SIZE=`rpm --queryformat %{SIZE} -qp $1`
36
37RELEASE=`date +%Y%m%d%H%M`
38
39RPMFILEBASENAME=`basename $1`
40
41if [ -e $PATCHFILE ]
42then
43 rm $PATCHFILE
44fi
45out "##"
46out "## Patch Description for $PAKET"
47out "##"
48out
49out "Kind: recommended"
50out "Shortdescription.english: $SUMMARY"
51out "Longdescription.english:"
52out "$DESCRIPTION"
53out " "
54out "Hsilgne.noitpircsedgnol:"
55out "UpdateOnlyInstalled: false"
56out "Size: $SIZE"
57out "MinYaST1Version:"
58out "MinYaST2Version:"
59out
60out "Packages:"
61out "##"
62out "Filename: $PAKET.rpm"
63out "Label: $PAKET"
64out "Series: $ARCH"
65out "DepAND:"
66out "DepOR:"
67out "DepExcl:"
68out "Flag:"
69out "Category:"
70out "RpmGroup: $GROUP"
71out "Copyright: see package"
72out "AuthorAddress:"
73out "Version: $SUFFIX"
74out "StartCommand:"
75out "Obsoletes:"
76out "Segakcap:"
77
78
79gpg --clearsign $PATCHFILE
80
81mv $PATCHFILE.asc $PATCHFILE
82
83if (rpm --checksig $1 | grep -q "gpg OK")
84then
85 # publish
86 echo "Kopiere Dateien ..."
87 scp $PATCHFILE $YOUSERVER:$YOUPATH/patches
88 ssh $YOUSERVER "cd $YOUPATH/patches; ls -1 -A > directory.3"
89 scp $1 $YOUSERVER:$YOUPATH/rpm/$ARCH/
90 ssh $YOUSERVER "cd $YOUPATH/rpm/$ARCH/; ln -sf $RPMFILEBASENAME $PAKET.rpm; ls -1 -A > directory.3"
91else
92 echo "rpm Signature _not_ Ok. stop"
93 exit 1
94fi
95
96
97
98
99
Note: See TracBrowser for help on using the repository browser.