[Git][java-team/javatools][master] 4 commits: Remove redundant/unused assignments

Niels Thykier gitlab at salsa.debian.org
Mon Aug 6 11:57:47 BST 2018


Niels Thykier pushed to branch master at Debian Java Maintainers / javatools


Commits:
f0c58a1a by Niels Thykier at 2018-07-29T19:29:24Z
Remove redundant/unused assignments

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -
ac81f5b2 by Niels Thykier at 2018-07-29T19:29:24Z
Let debhelper handle auto-generated orbitdeps cache file

By using generated_file for creating the orbitdeps cache file,
dh_clean will automatically remove the file for us.  We still remove
the original file to assist people who might have old non-clean
packaging directories lying around.

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -
a680fd1d by Niels Thykier at 2018-07-29T19:29:24Z
jh_linkjars: Fix copy-waste mistake

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -
87f1497d by Niels Thykier at 2018-07-29T19:32:35Z
Avoid some fork+execs for trivial things

In recent versions of debhelper, some trivial operations are now
implemented in pure perl avoiding a fork+exec.

Signed-off-by: Niels Thykier <niels at thykier.net>

- - - - -


6 changed files:

- jh_clean
- jh_generateorbitdir
- jh_installeclipse
- jh_linkjars
- jh_setupenvironment
- lib/Debian/Javahelper/Eclipse.pm


Changes:

=====================================
jh_clean
=====================================
--- a/jh_clean
+++ b/jh_clean
@@ -3,7 +3,6 @@
 jh_build --clean "$@"
 jh_linkjars --unlink
 jh_setupenvironment --clean
-[ ! -f "debian/orbitdeps.debhelper" ] || rm "debian/orbitdeps.debhelper"
 if [ -f "debian/.javahelper_clean" ]; then
 	rm -f `cat debian/.javahelper_clean` debian/.javahelper_clean
 fi


=====================================
jh_generateorbitdir
=====================================
--- a/jh_generateorbitdir
+++ b/jh_generateorbitdir
@@ -70,10 +70,9 @@ created. Defauls to "debian/.eclipse_build/orbitdeps".
 =cut
 
 my $orbitdir = undef;
-my $cachefile = 'debian/orbitdeps.debhelper';
+my $cachefile = generated_file('_source', 'javahelper.orbitdeps');
 my $infile = 'debian/eclipse.orbitdeps';
 my @orbitdeps;
-my @include = (q{.}, '/usr/share/java');
 my $tmpdir = undef;
 my $orbit_fd;
 
@@ -102,7 +101,7 @@ if( ! $dh{NO_ACT}){
     open($orbit_fd, '>>', $cachefile);
 }
 
-doit('mkdir', '-p', $orbitdir);
+install_dir($orbitdir);
 
 foreach my $jar (find_jars(@orbitdeps)){
     my $manifest = read_manifest($jar);
@@ -127,10 +126,10 @@ foreach my $jar (find_jars(@orbitdeps)){
     }
     error("No touching $orbitdir/${symName}_${version}.jar - it is a dir")
         if( -d "$orbitdir/${symName}_${version}.jar");
-    doit('rm', '-f', "$orbitdir/${symName}_${version}.jar")
-        if( -e "$orbitdir/${symName}_${version}.jar");
+
+    rm_files("$orbitdir/${symName}_${version}.jar");
     print ${orbit_fd} "$jar, $symName, $version\n" unless($dh{NO_ACT});
-    doit('ln', '-s', $jar, "$orbitdir/${symName}_${version}.jar");
+    make_symlink_raw_target($jar, "$orbitdir/${symName}_${version}.jar");
 }
 
 if( ! $dh{NO_ACT}){


=====================================
jh_installeclipse
=====================================
--- a/jh_installeclipse
+++ b/jh_installeclipse
@@ -73,7 +73,7 @@ Specifies the directory from where pde-build was run. Defauls to
 my %archpackages;
 my $pdebdir = undef;
 my $fallback = undef;
-my $orbitcfile = 'debian/orbitdeps.debhelper';
+my $orbitcfile = generated_file('_source', 'javahelper.orbitdeps', 0);
 my @orbitdeps = ();
 my %needed;
 init(options => {
@@ -108,7 +108,6 @@ foreach my $arch (getpackages('arch')){
 foreach my $package (@{$dh{DOPACKAGES}}) {
     my $installfile = pkgfile($package, 'eh-install');
     my $dropins;
-    my $lineno = 0;
     my $defdname = $fallback;
     my @infiles;
     next if($installfile eq q{});


=====================================
jh_linkjars
=====================================
--- a/jh_linkjars
+++ b/jh_linkjars
@@ -12,9 +12,9 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-B<jh_classpath> [S<I<debhelper options>>]
+B<jh_linkjars> [S<I<debhelper options>>]
 
-B<jh_classpath> [S<I<debhelper options>>] [B<-p>I<package>] [B<--classpath=>I<cp>] [S<I<jar [...]>>]
+B<jh_linkjars> [S<I<debhelper options>>] I<directory>
 
 =head1 DESCRIPTION
 
@@ -58,7 +58,7 @@ Remove all files/links in the target directories that B<jh_linkjars> created
 
 =back
 
-Beyond the above, B<jh_classpath> also accepts the shared
+Beyond the above, B<jh_linkjars> also accepts the shared
 debhelper options documented in L<debhelper(7)>.
 
 =cut
@@ -159,7 +159,7 @@ if ($UNLINK_JARS) {
         rm_files(map {"${target_dir}/$_"} @basenames);
     }
 } else {
-    doit('mkdir', '-p', @TARGET_DIRS);
+    install_dir(@TARGET_DIRS);
     for my $target_dir (@TARGET_DIRS) {
         for my $jar (@JARS) {
             my $basename = basename($jar);


=====================================
jh_setupenvironment
=====================================
--- a/jh_setupenvironment
+++ b/jh_setupenvironment
@@ -57,7 +57,6 @@ to trace where it was.
 =cut
 
 my $builddir = undef;
-my $me = basename($0);
 my $clean = '';
 
 init(options => {
@@ -73,16 +72,16 @@ inhibit_log() if($clean);
 
 if($clean){
     doit('rm', '-fr', $builddir);
-    # clean up after jh_generateorbitdeps - dh_clean tend to miss this file
-    # because it does not "belong" to a package.
-    doit('rm', '-f', 'debian/orbitdeps.debhelper');
+    # We no longer create this file, but clean it up for now in case people have "dirty" build
+    # directories.
+    rm_files('debian/orbitdeps.debhelper');
 } else{
     my $bfile = 'debian/eclipse.environment';
     if( -f $bfile){
         push(@ARGV, filearray($bfile));
     }
     push(@ARGV, 'org.eclipse.*') unless(scalar(@ARGV) > 0);
-    doit('mkdir', '-p', $builddir);
+    install_dir($builddir);
     complex_doit('cp -far ' . join(' ', @ARGV) . " $builddir");
 }
 


=====================================
lib/Debian/Javahelper/Eclipse.pm
=====================================
--- a/lib/Debian/Javahelper/Eclipse.pm
+++ b/lib/Debian/Javahelper/Eclipse.pm
@@ -11,7 +11,7 @@ use warnings;
 use autodie;
 
 use Exporter qw(import);
-use Debian::Debhelper::Dh_Lib qw(doit error);
+use Debian::Debhelper::Dh_Lib qw(doit error rm_files make_symlink_raw_target install_dir);
 
 our %EXPORT_TAGS = (
     'constants' => [qw(EOB_SYM_NAME EOB_BUNDLE_VERSION EOB_SYS_JAR)],
@@ -115,7 +115,7 @@ sub install_zipped_feature{
     my $orbitdeps = shift//[];
     my $package = shift;
     my $needs = shift;
-    doit('mkdir', '-p', $loc);
+    install_dir($loc);
     doit('unzip', '-qq', '-n', '-d', $loc, $fzip);
     foreach my $orbitdep (@$orbitdeps){
         my $symname = $orbitdep->{${\EOB_SYM_NAME}};
@@ -127,8 +127,8 @@ sub install_zipped_feature{
                   'against javahelper.');
         }
         foreach my $match (@matches){
-            doit('rm', '-f', $match);
-            doit('ln', '-s', $sysjar, $match);
+            rm_files($match);
+            make_symlink_raw_target($sysjar, $match);
             if(defined($needs) && $sysjar =~ m@^/usr/share/java/@o){
                 $needs->{$sysjar} = {} unless(exists($needs->{$sysjar}));
                 $needs->{$sysjar}{$package} = 1;



View it on GitLab: https://salsa.debian.org/java-team/javatools/compare/9496bffc5ccc85a74ef0ebd051dda5db1f77a4a9...87f1497d8c8600c048704a4ccc4fb24dbc7c2570

-- 
View it on GitLab: https://salsa.debian.org/java-team/javatools/compare/9496bffc5ccc85a74ef0ebd051dda5db1f77a4a9...87f1497d8c8600c048704a4ccc4fb24dbc7c2570
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20180806/f61beaeb/attachment.html>


More information about the pkg-java-commits mailing list