Changeset 2370


Ignore:
Timestamp:
Feb 28, 2019, 2:39:10 AM (7 months ago)
Author:
bruno
Message:

Fix find + chmod call to always return true so that docker ends without error due to that
Now works with stop-on-errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • devel/pb/bin/pb

    r2365 r2370  
    29182918        print DOCKER "  # Cleanup first to avoid rights issues for root owned files e.g.\n";
    29192919        print DOCKER "  j=\`basename \$i\`\n";
    2920         print DOCKER "  rm -f \$TDIR/\$j\n";
     2920        print DOCKER "  if [ -d \$TDIR/\$j ]; then\n";
     2921        print DOCKER "    rmdir --ignore-fail-on-non-empty \$TDIR/\$j\n";
     2922        print DOCKER "  else\n";
     2923        print DOCKER "    rm -f \$TDIR/\$j\n";
     2924        print DOCKER "  fi\n";
    29212925        print DOCKER "  cp -r \$i \$TDIR\n";
    29222926        print DOCKER "done\n";
    2923         print DOCKER "find \$TDIR -type f -print0 | xargs -0 chmod 644\n";
    2924         print DOCKER "find \$TDIR -type d -print0 | xargs -0 chmod 777 2> /dev/null\n";
     2927        print DOCKER "find \$TDIR -type f -print0 | xargs -0 chmod 644 && /bin/true\n";
     2928        print DOCKER "find \$TDIR -type d -print0 | xargs -0 chmod 777 2> /dev/null && /bin/true\n";
    29252929        #print DOCKER "ls -al \$TDIR\n";
    29262930        print DOCKER "exit 0\n";
     
    29492953        pb_system("$cpcmd $cp2target/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}-$pbos->{'name'}-$pbos->{'version'}-$pbos->{'arch'} $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$ 2> /dev/null","Get package names in $cp2target");
    29502954        if (not -f "$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") {
    2951             pb_log(0,"ERROR with VM/RM $v on getting $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$\n");
     2955            pb_log(0,"ERROR with $v on getting $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$\n");
     2956            pb_exit(-1);
    29522957        } else {
    29532958            open(KEEP,"$ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$") || die "Unable to read $ENV{'PBBUILDDIR'}/pbgen-$ENV{'PBPROJVER'}-$ENV{'PBPROJTAG'}.$$";
     
    30963101                                $all_ok = 0;
    30973102                                pb_log(0,"ERROR: pid $pid failed\n");
     3103                                pb_log(0,"code: $code - signal: $signal - dump: $dump\n");
    30983104                            }
    30993105                        });
     
    34433449                                $all_ok = 0;
    34443450                                pb_log(0,"ERROR: pid $pid failed\n");
     3451                                pb_log(0,"code: $code - signal: $signal - dump: $dump\n");
    34453452                            }
    34463453                        });
Note: See TracChangeset for help on using the changeset viewer.