[pve-devel] r6298 - in pve-common/trunk: . data data/PVE debian
svn-commits at proxmox.com
svn-commits at proxmox.com
Thu Jul 14 12:09:25 CEST 2011
Author: dietmar
Date: 2011-07-14 12:09:25 +0200 (Thu, 14 Jul 2011)
New Revision: 6298
Modified:
pve-common/trunk/Makefile
pve-common/trunk/data/ChangeLog
pve-common/trunk/data/PVE/Tools.pm
pve-common/trunk/debian/changelog
pve-common/trunk/debian/control
Log:
move function from pve-access-control package
Modified: pve-common/trunk/Makefile
===================================================================
--- pve-common/trunk/Makefile 2011-07-14 05:12:58 UTC (rev 6297)
+++ pve-common/trunk/Makefile 2011-07-14 10:09:25 UTC (rev 6298)
@@ -1,7 +1,7 @@
RELEASE=2.0
VERSION=1.0
-PKGREL=1
+PKGREL=2
PACKAGE=libpve-common-perl
Modified: pve-common/trunk/data/ChangeLog
===================================================================
--- pve-common/trunk/data/ChangeLog 2011-07-14 05:12:58 UTC (rev 6297)
+++ pve-common/trunk/data/ChangeLog 2011-07-14 10:09:25 UTC (rev 6298)
@@ -1,3 +1,8 @@
+2011-07-14 Proxmox Support Team <support at proxmox.com>
+
+ * PVE/Tools.pm (encode_text, decode_text): useful functions to
+ store comments in config files (uri encoding)
+
2011-07-04 Proxmox Support Team <support at proxmox.com>
* PVE/JSONSchema.pm (check_format): allow to add '-opt' to format
Modified: pve-common/trunk/data/PVE/Tools.pm
===================================================================
--- pve-common/trunk/data/PVE/Tools.pm 2011-07-14 05:12:58 UTC (rev 6297)
+++ pve-common/trunk/data/PVE/Tools.pm 2011-07-14 10:09:25 UTC (rev 6298)
@@ -10,6 +10,8 @@
use IPC::Open3;
use Fcntl qw(:DEFAULT :flock);
use base 'Exporter';
+use URI::Escape;
+use Encode;
our @EXPORT_OK = qw(
lock_file
@@ -613,5 +615,20 @@
return "unable to read tail (got $br bytes)";
}
+# useful functions to store comments in config files
+sub encode_text {
+ my ($text) = @_;
+ # all control and hi-bit characters, and ':'
+ my $unsafe = "^\x20-\x39\x3b-\x7e";
+ return uri_escape(Encode::encode("utf8", $text), $unsafe);
+}
+
+sub decode_text {
+ my ($data) = @_;
+
+ return Encode::decode("utf8", uri_unescape($data));
+}
+
+
1;
Modified: pve-common/trunk/debian/changelog
===================================================================
--- pve-common/trunk/debian/changelog 2011-07-14 05:12:58 UTC (rev 6297)
+++ pve-common/trunk/debian/changelog 2011-07-14 10:09:25 UTC (rev 6298)
@@ -1,3 +1,9 @@
+libpve-common-perl (1.0-2) unstable; urgency=low
+
+ * depend on liburi-perl
+
+ -- Proxmox Support Team <support at proxmox.com> Thu, 14 Jul 2011 12:03:37 +0200
+
libpve-common-perl (1.0-1) unstable; urgency=low
* initial package
Modified: pve-common/trunk/debian/control
===================================================================
--- pve-common/trunk/debian/control 2011-07-14 05:12:58 UTC (rev 6297)
+++ pve-common/trunk/debian/control 2011-07-14 10:09:25 UTC (rev 6298)
@@ -7,6 +7,6 @@
Package: libpve-common-perl
Architecture: all
-Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl
+Depends: ${perl:Depends} ${misc:Depends}, libdevel-cycle-perl, libwww-perl, libjson-perl, liblinux-inotify2-perl, libio-stringy-perl, liburi-perl
Description: Proxmox VE base library
This package contains the base library used by other Proxmox VE components.
More information about the pve-devel
mailing list