From b6ac61e549bdae0f73c98a8c91ad9fe9a7470bc1 Mon Sep 17 00:00:00 2001 From: Louie S Date: Fri, 4 Nov 2022 15:47:44 -0700 Subject: Replaced 'mkdir' with 'mkdir -p' --- Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d5985d4..836fe3c 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ clean: rm -rf $(DOCSET_DIR) $(ARCHIVE_FILE) tmp: - mkdir $@ + mkdir -p $@ $(ARCHIVE_FILE): $(DOCSET) tar --exclude='.DS_Store' -czf $@ $(DOCSET_DIR) @@ -32,16 +32,16 @@ $(MANUAL_FILE): tmp curl -o $@ $(MANUAL_URL) $(DOCSET_DIR): - mkdir $@ + mkdir -p $@ $(CONTENTS_DIR): $(DOCSET_DIR) - mkdir $@ + mkdir -p $@ $(RESOURCES_DIR): $(CONTENTS_DIR) - mkdir $@ + mkdir -p $@ $(DOCUMENTS_DIR): $(RESOURCES_DIR) $(MANUAL_FILE) - mkdir $@ + mkdir -p $@ tar -x -z -f $(MANUAL_FILE) -C $@ $(INFO_PLIST_FILE): src/Info.plist $(CONTENTS_DIR) -- cgit From f27dc560ad3e66f99d6ccabc7d51ddf3c329354c Mon Sep 17 00:00:00 2001 From: Benjamin Ragheb Date: Sat, 5 Nov 2022 13:01:37 -0400 Subject: Fix bug that prevented path from being printed --- src/index.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.rb b/src/index.rb index c719fcc..ec861a5 100755 --- a/src/index.rb +++ b/src/index.rb @@ -21,7 +21,7 @@ ARGV.each do |arg| if match printf INSERT_SQL, quote(match[1]), 'Guide', path.basename else - $stderr.puts "%{path.basename}: no title found" + $stderr.puts "#{path}: no title found" end end end -- cgit From 3c014cde4c3b533c045e6440fb509243582a3ac9 Mon Sep 17 00:00:00 2001 From: Benjamin Ragheb Date: Sat, 5 Nov 2022 13:14:19 -0400 Subject: Accomodate titles in newer GNU make versions @lshprung identified that newer versions of GNU make docs have titles with a suffix of "(GNU make)" instead of a prefix of "GNU make:". This change extracts any HTML title, and then removes either prefix or suffix, if found. --- src/index.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/index.rb b/src/index.rb index ec861a5..da58535 100755 --- a/src/index.rb +++ b/src/index.rb @@ -9,7 +9,7 @@ INSERT_SQL = %Q[ INSERT INTO searchIndex(name, type, path) VALUES ('%s','%s','%s'); ] -PATTERN = %r[GNU make: (.+)] +PATTERN = %r[(.+)] def quote(s) s.gsub(/&/, '&').gsub(/'/, "\\'") @@ -19,7 +19,10 @@ ARGV.each do |arg| Pathname.glob(arg) do |path| match = path.each_line.lazy.map { |line| PATTERN.match(line) }.find { |m| m } if match - printf INSERT_SQL, quote(match[1]), 'Guide', path.basename + title = match[1] + title.delete_prefix!('GNU make: ') # older docs + title.delete_suffix!(' (GNU make)') # newer docs + printf INSERT_SQL, quote(title), 'Guide', path.basename else $stderr.puts "#{path}: no title found" end -- cgit