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

Disabling add parent directories option not working #387

Open
midmarch opened this issue Nov 17, 2020 · 1 comment
Open

Disabling add parent directories option not working #387

midmarch opened this issue Nov 17, 2020 · 1 comment

Comments

@midmarch
Copy link

midmarch commented Nov 17, 2020

The options addParentDirs = false as provided in the example:

from('endorsed') {
            // Will tell redline-rpm not to auto create directories, which
            // is sometimes necessary to avoid rpm directory conflicts
            addParentDirs = false
            into '/usr/share/tomcat/endorsed'
        }

does not seem to work.

Trying

from('scripts/anet.service') {
ospackage {
  release = '2'
  os = LINUX
  into '/opt'
  from(jpackageImage.outputs.files)
  from('anet.yml') {
    rename('anet.yml', 'anet.yml.template')
    into 'anet/docs'
  }
  from('docs/INSTALL.md') { into 'anet/docs' }
  from('docs/TROUBLESHOOT.md') { into 'anet/docs' }
  from('anet-dictionary.yml') {
    rename('anet-dictionary.yml', 'anet-dictionary.yml.template')
    into 'anet/docs'
  }
  from('prepare-psql.sql') {
    into 'anet/docs'
  }
  from('prepare-mssql.sql') {
    into 'anet/docs'
  }
  from('scripts/anet.service') {
    addParentDirs = false // <-------------------------------------------
    into '/etc/systemd/system/'
  }
}
[root@test-ansible-redhat76-01 ~]# rpm -qlp /opt/ansible/anet/anet-2.1.33-133-g529c3de10-2.x86_64.rpm | grep systemd 

outputs:

/etc/systemd
/etc/systemd/system
/etc/systemd/system/anet.service

expected output:

/etc/systemd/system/anet.service

causing error:

Transaction check error:
  file /etc/systemd from install of anet-0:2.1.33~133~g529c3de10-2.x86_64 conflicts with file from package systemd-219-62.el7_6.16.x86_64
  file /etc/systemd/system from install of anet-0:2.1.33~133~g529c3de10-2.x86_64 conflicts with file from package systemd-219-62.el7_6.16.x86_64

Causing: NCI-Agency/anet#3303
Related: #120, #355, https://serverfault.com/questions/775647/installing-rpm-package-to-systemd/775653

@midmarch midmarch reopened this Nov 17, 2020
@midmarch midmarch changed the title Report bounced back to draft after submission Add parent directories option not working Nov 17, 2020
@midmarch midmarch changed the title Add parent directories option not working Disabling add parent directories option not working Nov 18, 2020
@midmarch
Copy link
Author

midmarch commented Nov 18, 2020

After moving addParentDirs to distRpm:

task distRpm(dependsOn: "jpackageImage", type: Rpm) {
  arch = 'x86_64'
  prefix '/opt' // Relocations: /opt
  into '/opt'
  from('scripts/anet.service') {
    addParentDirs = false // <-------------------------------------------
    into '/etc/systemd/system/'
  }
}

it removed each folder, not just the parents of /etc/systemd/system/anet.service

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