From 31ce029c7042dc34e1c9edb4de361a3db36d1724 Mon Sep 17 00:00:00 2001 From: Damir Dzeko Date: Fri, 8 Apr 2005 00:03:10 +0000 Subject: [PATCH] r46: -ispravka u cp-update (regexp-match = default) -dodan man-entry za cp_check_root -promjena verzije iz 2.2 u 2.1.1 -ispravka u control/Descriptionu --- carnet-tools.7 | 18 +++++++++++++----- changelog.CARNet | 3 +-- cp-update | 4 ++-- cp-update.1 | 13 ++++++------- debian/control | 6 +++--- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/carnet-tools.7 b/carnet-tools.7 index 37d10f8..1b6288a 100644 --- a/carnet-tools.7 +++ b/carnet-tools.7 @@ -118,12 +118,20 @@ greske vrati prazni \fBRET\fR. Kome treba greska neka ga ne koristi. Funkcija je namijenjena koristenju na mjestu gdje se inace poziva \fBdb_get\fR, sto znaci da korisnik mora sam napraviti sve potrebne predradnje, od \fB. /usr/share/debconf/confmodule\fR nadalje. +.TP +\fBcp_check_root\fR +Funkcija za provjeru efektivnog izvrsitelja skripte. U slucaju da +funkciju poziva skripta koja se izvrsava pod root korisnikom ova ce +funkcija vratiti 'true' vrijednost (return code 0), a u RET varijabli +vrijednost '\fBy\fR'. U protivnom biti ce vracena vrijednost 'false' +(return code 1), a u RET varijabli '\fBn\fR'. Ako provjera ne uspije +biti ce ispisana greska, a RET varijabla ce biti prazna. .PP -Funkcije cije ime pocinje sa \fBcp_get_\fR pohranjuju rezultat u varijabli \fB$RET\fR, -a one s prefiksom cp_check_ kao rezultat vracaju exit status. U pozivnoj -skripti se mogu definirati sljedece varijable koje utjecu na rad svih -pomocnih funkcija: - +U pravilu, funkcije cije ime pocinje sa \fBcp_get_\fR pohranjuju rezultat +u varijabli \fB$RET\fR, a one s prefiksom cp_check_ kao rezultat vracaju +exit status. Pogledajte dolje koje se varijable okruzja mogu upotrijebiti +za utjecaj na nacin vracanja povratne vrijednosti. +.\" .SH PRIMJER Poziv \fBcp_get_\fRxxx funkcije i preuzimanje rezultata: .Sp diff --git a/changelog.CARNet b/changelog.CARNet index d5680ff..1539402 100644 --- a/changelog.CARNet +++ b/changelog.CARNet @@ -1,8 +1,7 @@ -carnet-tools-cn (2.2) testing; urgency=low +carnet-tools-cn (2.1.1) testing; urgency=low * cp-update: Ispravka uvjeta za upozorenje kod implicitnog pozicioniranja ubacenog bloka na kraj datoteke - * functions.sh: Nova funkcija: cp_check_root -- Damir Dzeko Tue, 05 Apr 2005 11:24:20 +0200 diff --git a/cp-update b/cp-update index ecac2f7..d5b2ab2 100755 --- a/cp-update +++ b/cp-update @@ -69,7 +69,6 @@ $UsageLong = " -i | --insert-after x Insert after this/matching line. -f | --insert-before x Insert before this/matching line. - -R | --regexp-match Use regexp mode for line matching. - Manipulating block marks: @@ -120,6 +119,7 @@ use constant DO_INSERT => 1; # Operation defaults $InsertRemove = DO_INSERT; $Placement = APPEND_AT_END; +$RegexpMatch = 1; $Comment = '#'; $CommentEnd = ''; $MatchLine = ''; @@ -166,7 +166,7 @@ while (@ARGV) { $Placement = INSERT_ON_TOP; } elsif (/^-R$/ || /^--regexp(?:-match|-mode)?$/) { - $RegexpMatch = 1; + $RegexpMatch = 1; # it's the default } elsif (/^-h$/ || /^--help$/) { die $UsageLong; diff --git a/cp-update.1 b/cp-update.1 index eb8cde1..cd6dc2b 100644 --- a/cp-update.1 +++ b/cp-update.1 @@ -100,9 +100,8 @@ Insert after the first line that matches given pattern. .TP \fB\-f\fR | \fB\-\-insert\-before\fR \fIpattern\fR Insert before the first line that matches given pattern. -.TP -\fB\-R\fR | \fB\-\-regexp\-match\fR | \fB\-\-regexp\fR -Use regexp mode for line matching. +.PP +Line-matching patterns are PCREs (Perl-compatible regular expressions). .SS Manipulating block marks .TP \fB\-c\fR | \fB\-\-comment\fR \fIstring\fR @@ -167,7 +166,7 @@ the inserted block between customized markers): .RS .Sp .Vb 4 -\& cp-update --regexp --insert-before '' \\ +\& cp-update --insert-before '' \\ \& --comment '' \\ \& gentoo-cn /etc/gentoorc < gentoo-cn.ins .Ve @@ -177,9 +176,9 @@ the same markers as we did when the block was inserted): .RS .Sp .Vb 4 -\& cp-update -r --regexp --insert-before '' \\ -\& --comment '' \\ -\& gentoo-cn /etc/gentoorc +\& cp-update -r --insert-before '' \\ +\& --comment '' \\ +\& gentoo-cn /etc/gentoorc .Ve .RE .\" diff --git a/debian/control b/debian/control index 9726265..6fe9fa8 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,6 @@ Conflicts: carnet-tools Provides: carnet-tools Replaces: carnet-tools Description: CARNet tools for Debian packaging - CARNet tools for Debian packaging. Include: - - functions.sh - - cp-update + CARNet tools for Debian packaging. Package includes: + - carnet-tools/functions.sh + - cp-update perl script -- 1.7.10.4