Dnia 19-11-2004, pią o godzinie 14:27 +0100, Paweł Gołaszewski
napisał(a):
> On Fri, 19 Nov 2004, [iso-8859-2] Paweł Żurowski wrote:
> > skrypcik ten ma natomiast dosc duza zalete, jesli chce sie zobaczyc, co
> > takiego wywalilo na ekran, po wiekszej instalacji, np.:
> > [code]
> > LIST=`banner --names -all`
> > poldek --upgrade-dist
> > banner --show --all --exclude $LIST
> > [/code]
>
> IMO należy to tylko wdrożyć :)
Will it be ok? (banner.sh.spec is only a sample of using)
greetings
-pawel
--
Pawel Zurowski
Index: SOURCES/rpm.macros
===================================================================
RCS file: /cvsroot/SOURCES/rpm.macros,v
retrieving revision 1.158.4.8
diff -u -r1.158.4.8 rpm.macros
--- SOURCES/rpm.macros 29 Oct 2004 11:38:09 -0000 1.158.4.8
+++ SOURCES/rpm.macros 21 Nov 2004 13:50:58 -0000
@@ -471,3 +471,19 @@
# %addusertogroup myuser agroup
#
%addusertogroup /usr/lib/rpm/user_group.sh user addtogroup
+
+# banner support (useful in {pre,post}{,un} and triggers)
+#
+# Usage:
+# %banner name [-a] [-n] [-tn]
+# the banner text, the banner text
+# the banner text, and following line HAVE TO BE:
+# EOF
+# -a - append to the banner
+# -n - no show banner (overriden by -t)
+# -t - show only, if RPM_SCRIPTVERBOSITY >= n
+%banner(a:n:t:) \
+ [ -r /etc/sysconfig/rpm ] && . /etc/sysconfig/rpm || RPM_SCRIPTVERBOSITY=5; \
+ banner.sh %{!-t:%{!-n:-s}} %{-t:`[ $RPM_SCRIPTVERBOSITY -ge %{-t*} ] && echo "-s"`} %{!-a:-m}%{-a:-M} %1 << EOF\
+%nil
+
Index: SPECS/rpm.spec
===================================================================
RCS file: /cvsroot/SPECS/rpm.spec,v
retrieving revision 1.555.2.24
diff -u -r1.555.2.24 rpm.spec
--- SPECS/rpm.spec 20 Nov 2004 19:46:48 -0000 1.555.2.24
+++ SPECS/rpm.spec 21 Nov 2004 13:51:04 -0000
@@ -20,6 +20,7 @@
%define reqdb_ver 4.2.50-1
%define reqpopt_ver 1.9
%define beecrypt_ver 3.0.0-0.20030610.1
+# UPDATE THIS
%define rpm_macros_rev 1.167
Summary: RPM Package Manager
Summary(de): RPM Packet-Manager
@@ -54,6 +55,8 @@
Source30: builder
Source31: adapter.awk
Source32: pldnotify.awk
+# http://svn.pld-linux.org/banner.sh/
+Source33: banner.sh
Patch0: %{name}-pl.po.patch
Patch1: %{name}-rpmrc.patch
Patch2: %{name}-arch.patch
@@ -714,6 +717,8 @@
install %{SOURCE30} $RPM_BUILD_ROOT%{_bindir}/builder
install %{SOURCE31} $RPM_BUILD_ROOT%{_bindir}/adapter.awk
install %{SOURCE32} $RPM_BUILD_ROOT%{_bindir}/pldnotify.awk
+
+install %{SOURCE33} $RPM_BUILD_ROOT%{_bindir}/banner.sh
install rpmio/ugid.h $RPM_BUILD_ROOT%{_includedir}/rpm
# $Revision: 1.28 $, $Date: 2004/07/01 23:41:04 $
Summary: %%banner macro test
Summary(pl): test makra %%banner
Name: banner.sh
Version: 0
Release: 0.14
Epoch: 0
License: GPL 2+
Group: -
Vendor: -
#Icon: -
Source0: banner.sh
# Source0-md5: ffc0610fd891b85f9cff90ab8ab95837
URL: -
Requires: coreutils
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%description -l pl
%prep
%build
%install
rm -rf $RPM_BUILD_ROOT
# create directories if necessary
install -d $RPM_BUILD_ROOT{/bin,/var/lib/banner}
install %{SOURCE0} $RPM_BUILD_ROOT/bin/
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
# tests without options
%banner helloworld << EOF
hello world!
EOF
%banner hithere
Hi! As you see "<< EOF" is not necessary, but looks much better
EOF
%banner warning << EndOfBanner
"<< EOF" is not necessary, however "EOF" has to be
EndOfBanner
exit 1
EOF
# appending
%banner foo << EOF
foo
EOF
%banner foo -a << EOF
bar
EOF
# no showing all time
%banner bar -n << EOF
boom!
EOF
# threshold level tests, shows more important (smaller number), "noshows" less
important
%banner a -t1 << EOF
1
EOF
%banner b -t2 << EOF
2
EOF
%banner c -t3 << EOF
3
EOF
%banner d -t4 << EOF
4
EOF
%banner e -t5 << EOF
5
EOF
%banner f -t6 << EOF
6
EOF
%banner g -t7 << EOF
7
EOF
%banner h -t8 << EOF
8
EOF
%banner i -t9 << EOF
9
EOF
%banner j -t10 << EOF
10
EOF
%banner k -t11 << EOF
11
EOF
%banner l -t12 << EOF
12
EOF
# all options can be conbined but -t will overide -n
%preun
%postun
%files
%defattr(644,root,root,755)
%attr(755,root,root) /bin/*
/var/lib/banner
%define date %(echo `LC_ALL="C" date +"%a %b %d %Y"`)
%changelog
* %{date} PLD Team <[EMAIL PROTECTED]>
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log: template.spec,v $
_______________________________________________
pld-devel-en mailing list
[EMAIL PROTECTED]
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en