juhp / cabal-rpm

Haskell Cabal RPM packaging tool
https://hackage.haskell.org/package/cabal-rpm
GNU General Public License v3.0
25 stars 8 forks source link

reuse of existing spec filename #3

Closed jan-matejka closed 10 years ago

jan-matejka commented 10 years ago
cabal-rpm spec xmonad
cabal-rpm spec cabal-rpm

Results into xmonad.spec first time and then xmonad.spec.cblrpm second time where xmonad.spac.cblrpm is generated for the cabal-rpm package

jan-matejka commented 10 years ago

Note this seems to be a regression when compared to 0.8.6

juhp commented 10 years ago

I see - so you want to be able to generate multiple spec files in the same directory?

But first of all cabal-rpm spec cabal-rpm should not generate xmonad.spec.cblrpm I agree.

juhp commented 10 years ago

BTW a workaround is to use --force but I agree that is not obvious.

I guess I need to compare the potential %pkg_names of .spec files.

jan-matejka commented 10 years ago

I see - so you want to be able to generate multiple spec files in the same directory?

Well, Yes and No. I was testing some stuff and ran cabal-rpm spec just to see what it will generate but given there was already *.spec file it did this thing and it just confused me for a while.

juhp commented 10 years ago

Which version did you test with?

I can't reproduce with cabal-rpm-0.8.11 and current git.

Perhaps this was already fixed in 0.8.11 or earlier?

jan-matejka commented 10 years ago

I believe 0.8.6, 0.8.11 and now on master.

~/data/suse/cabal-rpm git:master
yac@carolyn % git pull
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (11/11), done.
From https://github.com/juhp/cabal-rpm
   66f532f..cee1604  master     -> upstream/master
Updating 66f532f..cee1604
Fast-forward
 src/Main.hs | 60 +++++++++++++++++++++++++-----------------------------------
 1 file changed, 25 insertions(+), 35 deletions(-)
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm git:master
yac@carolyn % cabal build
Building cabal-rpm-0.8.11.1...
Preprocessing executable 'cblrpm' for cabal-rpm-0.8.11.1...
[12 of 12] Compiling Main             ( src/Main.hs, dist/build/cblrpm/cblrpm-tmp/Main.o )
Linking dist/build/cblrpm/cblrpm ...
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm git:master
yac@carolyn % cd dist/build/cblrpm/
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm/dist/build/cblrpm git:master
yac@carolyn % ls
cblrpm*  cblrpm-tmp/
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm/dist/build/cblrpm git:master
yac@carolyn % ./cblrpm spec xmonad
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm/dist/build/cblrpm git:master
yac@carolyn % ls
cblrpm*  cblrpm-tmp/  xmonad.spec
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm/dist/build/cblrpm git:master
yac@carolyn % ./cblrpm spec xmobar
xmonad.spec exists: creating xmonad.spec.cblrpm
--------------------------------------------------------------------------------
~/data/suse/cabal-rpm/dist/build/cblrpm git:master
yac@carolyn % ls
cblrpm*  cblrpm-tmp/  xmonad.spec  xmonad.spec.cblrpm
juhp commented 10 years ago

Thanks reproduced. Earlier I was testing in a dir with more than one .spec which works...

juhp commented 10 years ago

Thanks for reporting this. Should be fixed with commit 6a5449c.

jan-matejka commented 10 years ago

Confirming fix. Thanks.