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

Last change on this file since 693 was 693, checked in by maik, on Nov 11, 2004 at 4:35:02 PM

fix

  • 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
24DESCRDIR=/usr/src/packages/PATCH/
25
26
27
28PAKET=`rpm --queryformat %{NAME} -qp $1`
29SUFFIX=`rpm --queryformat %{VERSION}-%{RELEASE} -qp $1`
30SUMMARY=`rpm --queryformat %{SUMMARY} -qp $1`
31DESCRIPTION=`rpm --queryformat %{DESCRIPTION} -qp $1`
32ARCH=`rpm --queryformat %{ARCH} -qp $1`
33GROUP=`rpm --queryformat %{GROUP} -qp $1`
34SIZE=`rpm --queryformat %{SIZE} -qp $1`
35
36RELEASE=`date +%Y%m%d%H%M`
37
38RPMFILEBASENAME=`basename $1`
39
40# Name of patch-description file
41PATCHFILE="$DESCRDIR/patch-$PAKET-$SUFFIX"
42
43if [ -e $PATCHFILE ]
44then
45 rm $PATCHFILE
46fi
47out "##"
48out "## Patch Description for $PAKET"
49out "##"
50out
51out "Kind: recommended"
52out "Shortdescription.english: $SUMMARY"
53out "Longdescription.english:"
54out "$DESCRIPTION"
55out " "
56out "Hsilgne.noitpircsedgnol:"
57out "UpdateOnlyInstalled: false"
58out "Size: $SIZE"
59out "MinYaST1Version:"
60out "MinYaST2Version:"
61out
62out "Packages:"
63out "##"
64out "Filename: $PAKET.rpm"
65out "Label: $PAKET"
66out "Series: $ARCH"
67out "DepAND:"
68out "DepOR:"
69out "DepExcl:"
70out "Flag:"
71out "Category:"
72out "RpmGroup: $GROUP"
73out "Copyright: see package"
74out "AuthorAddress:"
75out "Version: $SUFFIX"
76out "StartCommand:"
77out "Obsoletes:"
78out "Segakcap:"
79
80
81gpg --clearsign $PATCHFILE
82
83mv $PATCHFILE.asc $PATCHFILE
84
85if (rpm --checksig $1 | grep -q "gpg OK")
86then
87 # publish
88 echo "Kopiere Dateien ..."
89 scp $PATCHFILE $YOUSERVER:$YOUPATH/patches
90 ssh $YOUSERVER "cd $YOUPATH/patches; ls -1 -A > directory.3"
91 scp $1 $YOUSERVER:$YOUPATH/rpm/$ARCH/
92 ssh $YOUSERVER "cd $YOUPATH/rpm/$ARCH/; ln -sf $RPMFILEBASENAME $PAKET.rpm; ls -1 -A > directory.3"
93else
94 echo "rpm Signature _not_ Ok. stop"
95 exit 1
96fi
97
98
99
100
101
Note: See TracBrowser for help on using the repository browser.