Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37542885
en ru br
Репозитории ALT
S:8.95.6-alt1
5.1: 8.79-alt0.M51.1
4.1: 8.69-alt1
4.0: 8.64-alt0.1
www.altlinux.org/Changes

Группа :: Архивирование/Прочее
Пакет: alien

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: alien-alt-plaintext-scripts.patch
Скачать


diff --git a/alien/Alien/Package/Rpm.pm b/alien/Alien/Package/Rpm.pm
index 77ca410..8deaeaa 100644
--- a/alien/Alien/Package/Rpm.pm
+++ b/alien/Alien/Package/Rpm.pm
@@ -349,22 +349,22 @@ sub prep {
 	if ($this->usescripts) {
 		if ($this->preinst) {
 			print OUT "\%pre\n";
-			print OUT $this->preinst."\n";
+			print OUT escape_percents($this->preinst)."\n";
 			print OUT "\n";
 		}
 		if ($this->postinst) {
 			print OUT "\%post\n";
-			print OUT $this->postinst."\n";
+			print OUT escape_percents($this->postinst)."\n";
 			print OUT "\n";
 		}
 		if ($this->prerm) {
 			print OUT "\%preun\n";
-			print OUT $this->prerm."\n";
+			print OUT escape_percents($this->prerm)."\n";
 			print OUT "\n";
 		}
 		if ($this->postrm) {
 			print OUT "\%postun\n";
-			print OUT $this->postrm."\n";
+			print OUT escape_percents($this->postrm)."\n";
 			print OUT "\n";
 		}
 	}
@@ -525,6 +525,7 @@ sub _script_helper {
 		$this->{$script} = $value;
 	}
 	$this->{$script} = shift if @_;
+	return $this->{$script};
 
 	# get
 	return unless defined wantarray; # optimization
@@ -560,6 +561,11 @@ sub prerm {
 	my $this=shift;
 	$this->_script_helper('prerm', @_);
 }
+sub escape_percents {
+	my $s=shift;
+	$s =~ s/\%/\%\%/g;
+	return $s;
+}
 
 =item arch
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin