]> git.ipfire.org Git - pakfire.git/commitdiff
perl: Behave like the other dependency scripts
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Dec 2022 18:07:07 +0000 (18:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 7 Dec 2022 18:07:07 +0000 (18:07 +0000)
The only argument will be the BUILDROOT path and the filelist will be
passed to stdin.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/perl.prov
src/scripts/perl.req

index ba34130c3c4efa574e11bc0ba359b19ac3bcf32f..955bde486a56dc575ad09dcdb739cfa9ab3b608f 100644 (file)
 
 my $perl_ns = "perl";
 
-if ("@ARGV") {
-  foreach (@ARGV) {
-    process_file($_);
-  }
-} else {
+my $BUILDROOT = shift;
 
-  # notice we are passed a list of filenames NOT as common in unix the
-  # contents of the file.
+# Check if BUILDROOT is set
+unless ($BUILDROOT) {
+       die "BUILDROOT is not set";
+}
 
-  foreach (<>) {
-    process_file($_);
-  }
+# Process the passed filelist
+foreach (<>) {
+       process_file("${BUILDROOT}/$_");
 }
 
 
index 6a0346e9af943a385ff8cbf22d4aa044b991b6cd..4932001080b071c75ab2f940558e2a0015210e08 100644 (file)
 
 my $perl_ns = "perl";
 
+my $BUILDROOT = shift;
+
+# Check if BUILDROOT is set
+unless ($BUILDROOT) {
+       die "BUILDROOT is not set";
+}
+
 $HAVE_VERSION = 0;
 eval { require version; $HAVE_VERSION = 1; };
 
@@ -33,25 +40,13 @@ if ( -e "$dir/perl.prov" ) {
   $prov_script = "$dir/perl.prov";
 }
 
-if ("@ARGV") {
-  foreach my $file (@ARGV) {
-    process_file($file);
-    process_file_provides($file);
-    compute_global_requires();
-  }
-} else {
-
-  # notice we are passed a list of filenames NOT as common in unix the
-  # contents of the file.
-
-  foreach my $file (<>) {
-    process_file($file);
-    process_file_provides($file);
-    compute_global_requires();
-  }
+# Process the passed filelist
+foreach (<>) {
+       process_file("${BUILDROOT}/$_");
+       process_file_provides("${BUILDROOT}/$_");
+       compute_global_requires();
 }
 
-
 foreach $perlver (sort keys %perlreq) {
   print "$perl_ns(:VERSION) >= $perlver\n";
 }