OSDN Git Service

fix perl dependent file for Debian.
authorgn64_jp <gn64@rec10.org>
Sun, 2 Jun 2013 06:18:06 +0000 (15:18 +0900)
committergn64_jp <gn64@rec10.org>
Sun, 2 Jun 2013 06:18:06 +0000 (15:18 +0900)
etc_process.sh
index/pdf2xml.py
www/pdfmanager.pl

index a00f162..df850ca 100644 (file)
@@ -4,4 +4,7 @@ cp ./conf/libre10.conf /etc/libre10.conf
 chmod 644 /etc/libre10.conf
 python ./index/pdf2xml.py
 chmod -R 777 /var/lib/libre10
+mkdir /tmp/libre10
+chmod -R 777 /tmp/libre10
+
 
index 8952451..5188877 100644 (file)
@@ -143,8 +143,9 @@ for st in argvs[1:]:
         #rd=hashlib.sha224(os.path.splitext(st)[0]).hexdigest()
         #rd2=hashlib.sha224(os.path.abspath(st)).hexdigest()
         #rd = base64.b64encode(os.path.abspath(st))[]
+        filepath=os.path.abspath(st)
         rd = hashlib.md5()
-        rd.update(os.path.abspath(st))
+        rd.update(filepath)
         rdl=rd.hexdigest()
         c = dbcon.cursor()
         c.execute(u"select count(*),changed from pdffile where id=?",(rdl,))
@@ -159,7 +160,7 @@ for st in argvs[1:]:
         print rdl
         print filecount
         if int(filecount)<1 or changed >0:
-            PDF2TEXT(st.decode("utf-8"),str(rdl)+".txt",rdl)
+            PDF2TEXT(filepath.decode("utf-8"),str(rdl)+".txt",rdl)
             c2 = dbcon.cursor()
             c2.execute(u"UPDATE pdffile SET changed=0 where id=?",(rdl,))
             index_rebuild()
index 1f20862..766ff06 100755 (executable)
@@ -9,7 +9,7 @@ use DBD::SQLite;
 use DBI;
 use Data::Dumper;
 use Encode 'decode';
-use File::Slurp;
+use Perl6::Slurp;
 use YAML::XS;
 use URI::Escape;
 
@@ -56,7 +56,7 @@ if ( $mode eq 'partpdf' ) {
        print "Content-Type: application/pdf\n";
        print "Content-Length: $length\n";
        print "\n";
-       print read_file("$temppath.pdf");
+       print slurp("$temppath.pdf");
        exit;
 }
 elsif ( $mode eq 'showpagediff' ) {