summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO15
-rw-r--r--.gitignore3
-rw-r--r--LICENSE22
-rw-r--r--PKGBUILD29
-rwxr-xr-xfile2uri30
-rwxr-xr-xuri2file31
6 files changed, 130 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..910b2cc3edf5
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = file-uri-tools
+ pkgdesc = Simple Perl scripts to convert to and from file:// URI
+ pkgver = 0.0.1
+ pkgrel = 1
+ arch = any
+ license = MIT
+ depends = perl-uri
+ provides = file-uri-tools
+ source = file2uri
+ source = uri2file
+ md5sums = SKIP
+ md5sums = SKIP
+
+pkgname = file-uri-tools
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..54b6d4e2e097
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+/src/
+/pkg/
+*.tar.xz
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000000000000..cc655d968596
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 Roman Savelyev
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..fad3af80941c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,29 @@
+pkgname=file-uri-tools
+pkgver=0.0.1
+pkgrel=1
+pkgdesc="Simple Perl scripts to convert to and from file:// URI"
+arch=('any')
+url=""
+license=('MIT')
+groups=()
+depends=('perl-uri')
+makedepends=()
+provides=("${pkgname}")
+conflicts=()
+replaces=()
+backup=()
+options=()
+install=
+source=("file2uri"
+ "uri2file"
+ )
+noextract=()
+md5sums=("SKIP"
+ "SKIP"
+ )
+
+package() {
+ install -m755 -d $pkgdir/usr/bin
+ install -m755 -t $pkgdir/usr/bin file2uri uri2file
+}
+
diff --git a/file2uri b/file2uri
new file mode 100755
index 000000000000..56ff931b20fb
--- /dev/null
+++ b/file2uri
@@ -0,0 +1,30 @@
+#!/usr/bin/env perl
+
+# The MIT License (MIT)
+#
+# Copyright (c) 2015 Roman Savelyev
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+use feature 'say';
+use strict;
+use URI::file;
+
+my $u = URI::file->new_abs($ARGV[0]) || die $!;
+say $u->as_string;
diff --git a/uri2file b/uri2file
new file mode 100755
index 000000000000..12c9c3d1b0bf
--- /dev/null
+++ b/uri2file
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+
+# The MIT License (MIT)
+#
+# Copyright (c) 2015 Roman Savelyev
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in all
+# copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# SOFTWARE.
+
+use feature 'say';
+use strict;
+use URI;
+
+my $u = URI->new($ARGV[0]) || die $!;
+say $u->path;
+