@@ -105,20 +105,20 @@ private void addLink(Builder builder, String path, String target) throws NoSuchA
105105 }
106106
107107 private void addFile (Builder builder , String rootPath , File file , int mode ) throws NoSuchAlgorithmException , IOException {
108- rootPath += "/" + file .getName ();
109- Logger .info ("Adding file '" + file + "' to RPM builder as '" + rootPath + "'" );
110- builder .addFile (rootPath + "/" + file . getName () , file , mode );
108+ String filePath = rootPath + "/" + file .getName ();
109+ Logger .info ("Adding file '" + file + "' to RPM builder as '" + filePath + "'" );
110+ builder .addFile (filePath , file , mode );
111111 }
112112
113- private void addDirectory (Builder builder , String parentPath , File root , List <File > executionPermissions ) throws NoSuchAlgorithmException , IOException {
114- String rootPath = parentPath + "/" + root .getName ();
115- Logger .info ("Adding directory '" + root + "' to RPM builder as '" + rootPath + "'" );
116- builder .addDirectory (rootPath );
117- for (File f : root .listFiles ()) {
113+ private void addDirectory (Builder builder , String parentPath , File directory , List <File > executionPermissions ) throws NoSuchAlgorithmException , IOException {
114+ String dirPath = parentPath + "/" + directory .getName ();
115+ Logger .info ("Adding directory '" + directory + "' to RPM builder as '" + dirPath + "'" );
116+ builder .addDirectory (dirPath );
117+ for (File f : directory .listFiles ()) {
118118 if (f .isDirectory ())
119- addDirectory (builder , rootPath , f , executionPermissions );
119+ addDirectory (builder , dirPath , f , executionPermissions );
120120 else {
121- addFile (builder , rootPath , f , executionPermissions .contains (f ) ? 0755 : 0644 );
121+ addFile (builder , dirPath , f , executionPermissions .contains (f ) ? 0755 : 0644 );
122122 }
123123 }
124124 }
0 commit comments