Mailinglist Archive: yast-commit (195 mails)

< Previous Next >
[yast-commit] r63662 - in /branches/tmp/dmacvicar/zc10/packager: src/modules/URLRecode.pm yast2-packager.spec.in
Author: dmacvicar
Date: Thu Mar 24 16:18:48 2011
New Revision: 63662

URL: http://svn.opensuse.org/viewcvs/yast?rev=63662&view=rev
Log:
remove dependencies

Added:
branches/tmp/dmacvicar/zc10/packager/src/modules/URLRecode.pm
Modified:
branches/tmp/dmacvicar/zc10/packager/yast2-packager.spec.in

Added: branches/tmp/dmacvicar/zc10/packager/src/modules/URLRecode.pm
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/packager/src/modules/URLRecode.pm?rev=63662&view=auto
==============================================================================
--- branches/tmp/dmacvicar/zc10/packager/src/modules/URLRecode.pm (added)
+++ branches/tmp/dmacvicar/zc10/packager/src/modules/URLRecode.pm Thu Mar 24
16:18:48 2011
@@ -0,0 +1,87 @@
+#!/usr/bin/perl -w
+#
+# Author: Ladislav Slezák <lslezak@xxxxxxxxxx>
+#
+# $Id:$
+#
+# URLRecode.pm
+#
+# This is a replacement for URI::Encode perl module which cannot be used in
inst-sys
+# and to decrease the package dependencies
+#
+
+package URLRecode;
+
+use strict;
+use YaST::YCP qw(:LOGGING Boolean sformat);;
+
+our %TYPEINFO;
+use strict;
+
+# local cache for char -> hex string conversion
+our %escape_cache;
+
+# fill the cache
+sub InitCache
+{
+ for(0..255) {$escape_cache{chr($_)} = sprintf("%%%02x", $_);}
+}
+
+
+# Escape password, user name and fragment part of URL string
+# @param input input string
+# @return string Escaped string
+BEGIN{ $TYPEINFO{EscapePassword} = ["function", "string", "string"];}
+sub EscapePassword
+{
+ my ($self, $escaped) = @_;
+
+ if (!defined %escape_cache) { InitCache(); }
+
+ $escaped =~ s/([^A-Za-z0-9\\-_.!~*'()])/$escape_cache{$1}/ge;
+ return $escaped;
+}
+
+# Escape path part of URL string
+# @param input input string
+# @return string Escaped string
+BEGIN{ $TYPEINFO{EscapePath} = ["function", "string", "string"];}
+sub EscapePath
+{
+ my ($self, $escaped) = @_;
+
+ if (!defined %escape_cache) { InitCache() };
+
+ $escaped =~ s/([^A-Za-z0-9\-_.!~*'()\/])/$escape_cache{$1}/ge;
+ return $escaped;
+}
+
+# Escape query part of URL string
+# @param input input string
+# @return string Escaped string
+BEGIN{ $TYPEINFO{EscapeQuery} = ["function", "string", "string"];}
+sub EscapeQuery
+{
+ my ($self, $escaped) = @_;
+
+ if (!defined %escape_cache) { InitCache(); }
+
+ $escaped =~ s/([^A-Za-z0-9\\-_.!~*'()\/:=&])/$escape_cache{$1}/ge;
+ return $escaped;
+}
+
+
+# UnEscape an URL string, replace %<Hexnum><HexNum> sequences
+# by character
+# @param input input string
+# @return string Unescaped string
+BEGIN{ $TYPEINFO{UnEscape} = ["function", "string", "string"];}
+sub UnEscape
+{
+ my ($self, $input) = @_;
+
+ $input =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/ge;
+ return $input
+}
+
+1;

Modified: branches/tmp/dmacvicar/zc10/packager/yast2-packager.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/zc10/packager/yast2-packager.spec.in?rev=63662&r1=63661&r2=63662&view=diff
==============================================================================
--- branches/tmp/dmacvicar/zc10/packager/yast2-packager.spec.in (original)
+++ branches/tmp/dmacvicar/zc10/packager/yast2-packager.spec.in Thu Mar 24
16:18:48 2011
@@ -13,14 +13,17 @@
# "keeppackages" repo property
BuildRequires: yast2-pkg-bindings >= 2.17.27

+%if 0%{?suse_version} >= 1100
# Newly added RPM
Requires: yast2-country-data >= 2.16.3
+%else
+Requires: yast2-country
+%endif

# "keeppackages" repo property
Requires: yast2-pkg-bindings >= 2.17.27

-# URLRecode.pm
-Requires: yast2 >= 2.17.79
+Requires: yast2

# unzipping license file
Requires: unzip

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages