This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 24931 - <sampledir>/examples/advanced is empty !
Summary: <sampledir>/examples/advanced is empty !
Status: CLOSED FIXED
Alias: None
Product: usersguide
Classification: Unclassified
Component: Code (show other bugs)
Version: 3.x
Hardware: All All
: P1 blocker (vote)
Assignee: Filip Rachunek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-19 08:40 UTC by Marian Mirilovic
Modified: 2003-07-01 15:24 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2002-06-19 08:40:25 UTC
[nb_dev](20020619), [jdk1.4.0](fcs)

after istallation by installer and only unzip
build zip.

Feel free to reassigne.
Comment 1 Marian Mirilovic 2002-06-19 08:43:44 UTC
rest sample directories contains all files 

So, today's build is beta2-build, please solve this one ASAP.

Thanks advance.
Comment 2 Patrick Keegan 2002-06-19 11:10:27 UTC
This seems to be a side-effect of removing the MemoryView example. Filip, could you clean this up?
Comment 3 Filip Rachunek 2002-06-19 11:15:04 UTC
I'm not sure if I can do anything with this issue. I was told that if
I remove all files from examples/advanced directory on CVS, cvs update
-P command should ignore this directory. Is there a way how to remove
empty directory from CVS server?
Comment 4 Patrick Keegan 2002-06-19 11:21:15 UTC
Hmm. Could it be a build script problem? Perhaps the examples dir wasn't cleaned?
Comment 5 Jesse Glick 2002-06-19 17:59:07 UTC
Works OK for me if I update -P. usersguide/demosrc/examples/advanced/
ought not be present in the source directory. Ruda?
Comment 6 rbalada 2002-06-19 19:10:15 UTC
It's strange. I went through night build tracelog and the update was
executed

cvs -z6 -q -d :pserver:rbalada@cvs.netbeans.org:/cvs update
'-D2002-06-19 01:00 +0000' -d -P _other_modules_ usersguide
_other_modules_

Source package doesn't have the directory ;-(
I found only one difference, that the source package repository was
updated with -A switch - reset sticky tag.

I updated build repository manualy with `cvs up -d -P`
usersguide/demosrc/examples directory and the advanced directory has
disappeared.

I changed night build shell script to use -A switch also for build
repository update.

I expect it will be OK in next builds.
Comment 7 Jesse Glick 2002-06-19 19:43:24 UTC
I think I know what happened. When someone else deletes the last file
from a CVS dir, and you have a checkout containing that dir, cvs up -P
will delete the file but leave the dir. The next cvs up -P will delete
the dir (assuming there are no backup files or other ignored trash
lying around in it). So we just needed to wait one round.
Comment 8 Marian Mirilovic 2002-06-20 09:45:38 UTC
Well, please do the same for clock examples.
clock folder is empty in [nb_dev](20020620) !!!
Comment 9 Filip Rachunek 2002-06-20 10:20:42 UTC
I am re-adding the removed examples back to CVS.
Comment 10 Marian Mirilovic 2002-06-20 15:44:38 UTC
verified in [nb34_b2](200206201200)
Comment 11 Marian Mirilovic 2002-06-26 09:08:14 UTC
verified in [nb_dev](20020626)
Comment 12 Marian Mirilovic 2002-07-09 10:47:10 UTC
Ok, guys the same happends in todays build [nb_dev](20020709),
advanced and clock folder are empty.

Both folders aren't empty in build [nb_dev](20020708).

My question is : 
Should we wait for new build, and will there be it ok? 
It seems like you again try to remove both example directories, Am I
right?

Tomorrow is Beta3 and we are going to high-resistance mode !!!

Reopen and rising priority to P1 - it's regression.

Comment 13 Filip Rachunek 2002-07-09 10:51:26 UTC
I think it should be okay in a new build. When I perform cvs update
-P, both empty directories disappear.
We removed these examples according to the proposal on nbui@netbeans.org.
Comment 14 Jesse Glick 2002-07-09 15:08:33 UTC
Note that if you do a cvs update -P -d and interrupt it partway
through, you will be left with these empty dirs.

It is probably better to change the build system to not rely on
whether these dirs are empty or not. Suggestions:

1. Include the attr filesonly="true" on <zip> in 'tojar' target of
usersguide/build.xml. Excludes directories. However this would
probably cause sampledir unpacking to fail, unless
usersguide/src/.../UGModule.java were patched in makeExamplesDir():

---%<---
if (entry.isDirectory ()) {
    if (! new File (dir, name).mkdirs ()) throw new IOException ();
} else {
    OutputStream os = new FileOutputStream (new File (dir, name));
    try {
        int read;
        while ((read = zis.read (buf, 0, buf.length)) != -1) {
            os.write (buf, 0, read);
        }
    } finally {
        os.close ();
    }
}
--%<---

==>

---%<---
if (entry.isDirectory()) continue;
File f = new File(dir, name);
f.getParentFile().mkdirs();
OutputStream os = new FileOutputStream(f);
try {
    int read;
    while ((read = zis.read (buf, 0, buf.length)) != -1) {
        os.write (buf, 0, read);
    }
} finally {
    os.close ();
}
--%<---

2. Fix the build script to not include empty dirs. Add to .cvsignore:

---%<---
demosrc-tmp
---%<---

and change build.xml's tojar target:

---%<---
<target name="tojar" depends="compile">
  <mkdir dir="demosrc-tmp"/>
  <copy todir="demosrc-tmp" preservelastmodified="true"
includeemptydirs="false">
    <!-- Source and classes both. -->
    <fileset dir="demosrc"/>
  </copy>
  <zip compress="true"
zipfile="src/org/netbeans/modules/usersguide/demosrc.zip">
    <fileset dir="demosrc-tmp"/>
  </zip>
</target>
---%<---

and add to its clean target:

---%<---
<delete dir="demosrc-tmp"/>
---%<---

Did not actually try either of these fixes, but something like them
may be useful.
Comment 15 Filip Rachunek 2002-07-10 09:59:06 UTC
I have checked it in build 20020710-0552 [nbdev], there are no empty
directories in examples folder.
Comment 16 Marian Mirilovic 2002-07-17 11:39:13 UTC
verified in [nb_release34](20020717)
Comment 17 Quality Engineering 2003-07-01 15:24:42 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.