Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecWriter.writeMove cannot handle toplevel dotfiles #112

Open
ncubede opened this issue May 16, 2019 · 1 comment
Open

SpecWriter.writeMove cannot handle toplevel dotfiles #112

ncubede opened this issue May 16, 2019 · 1 comment

Comments

@ncubede
Copy link

ncubede commented May 16, 2019

The generated move section in the spec file moves TMP_BUILD_ROOT/*, where it should move all files. If e.g. a .bashrc is packaged in a prefix, then it fails to build, as .bashrc is not moved, but is mentioned in the spec file.

That would be much less of an issue, if the move section could be overridden in configuration, but it can't be. A possible script that would work (assuming TMP_BUILD_ROOT is set instead of hardcoding it into the script in writeMove) is:

mkdir -p "$RPM_BUILD_ROOT"
find "$TMP_BUILD_ROOT" -depth 1 |
while read top
do
mv "$TMP_BUILD_ROOT/$top" "$RPM_BUILD_ROOT/"
done

I would stay away from moving /* and /.??*, which then may or may not exist.

@ncubede
Copy link
Author

ncubede commented May 16, 2019

private void writeMove()
{
 	final String tmpBuildRoot = FileHelper.toUnixPath( mojo.getBuildroot() );
    spec.println();
spec.println( "%install" );
    spec.println();
    spec.print( "TMP_BUILD_ROOT=\"");
    spec.print( tmpBuildRoot );
    spec.println( "\"" );
spec.println( "mkdir -p \"$RPM_BUILD_ROOT\"" );
    spec.println( "find \"$TMP_BUILD_ROOT\" -depth 1 | while read top ; do mv \"$top\" \"$RPM_BUILD_ROOT/\"; done" );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant