Paul van Tilburg wrote:

> Ideally, setup.rb --install does this and does so in the configured
> install dir (incl. destdir).

Ok. Here's a patch for setup.rb. It will make the shebange line only be
replaced in the bin dir.

Tobias



--- libsetup-ruby-3.4.1.orig/setup.rb
+++ libsetup-ruby-3.4.1/setup.rb
@@ -1246,11 +1246,7 @@
     exec_task_traverse 'setup'
   end
 
-  def setup_dir_bin(rel)
-    files_of(curr_srcdir()).each do |fname|
-      update_shebang_line "#{curr_srcdir()}/#{fname}"
-    end
-  end
+  alias setup_dir_bin noop
 
   alias setup_dir_lib noop
 
@@ -1296,10 +1292,10 @@
   end
 
   def open_atomic_writer(path, &block)
-    tmpfile = File.basename(path) + '.tmp'
+    tmpfile = path + '.tmp'
     begin
       File.open(tmpfile, 'wb', &block)
-      File.rename tmpfile, File.basename(path)
+      File.rename tmpfile, path
     ensure
       File.unlink tmpfile if File.exist?(tmpfile)
     end
@@ -1344,6 +1340,11 @@
 
   def install_dir_bin(rel)
     install_files targetfiles(), "#{config('bindir')}/#{rel}", 0755
+
+    bin_target = File.join(@config.install_prefix, config('bindir'), rel)
+    files_of(bin_target).each do |fname|
+      update_shebang_line "#{bin_target}/#{fname}"
+    end
   end
 
   def install_dir_lib(rel)

Reply via email to