Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 151061 Details for
Bug 233384
splittree.py does not create os-discX dirs properly
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Fix for this issue
anaconda.patch (text/plain), 9.82 KB, created by
Prarit Bhargava
on 2007-03-27 18:46:51 UTC
(
hide
)
Description:
Fix for this issue
Filename:
MIME Type:
Creator:
Prarit Bhargava
Created:
2007-03-27 18:46:51 UTC
Size:
9.82 KB
patch
obsolete
>--- splittree.py 2005-05-16 12:11:52.000000000 -0400 >+++ /usr/lib/anaconda-runtime/splittree.py 2007-03-27 11:36:23.000000000 -0400 >@@ -104,16 +104,16 @@ > > > def getSize(self, path, blocksize=None): >- """Gets the size as reported by du -s""" >+ """Gets the size as reported by du -sL""" > > if blocksize: >- p = os.popen("du -s --block-size=1 %s" % path, 'r') >+ p = os.popen("du -sL --block-size=1 %s" % path, 'r') > thesize = p.read() > p.close() > thesize = long(string.split(thesize)[0]) > return thesize > else: >- p = os.popen("du -sh %s" % path, 'r') >+ p = os.popen("du -sLh %s" % path, 'r') > thesize = p.read() > p.close() > thesize = string.split(thesize)[0] >@@ -199,12 +199,12 @@ > > for i in range(self.bin_list[0], self.bin_list[-1] + 1): > if i == 1: >- p = os.popen('find %s/ -type f -not -name .discinfo' % self.dist_dir, 'r') >+ p = os.popen('find %s/ -type f -not -name .discinfo -not -name "*\.rpm"' % self.dist_dir, 'r') > filelist = p.read() > p.close() > filelist = string.split(filelist) > >- p = os.popen('find %s/ -type d -not -name RPMS -not -name SRPMS' % self.dist_dir, 'r') >+ p = os.popen('find %s/ -type d -not -name SRPMS' % self.dist_dir, 'r') > dirlist = p.read() > p.close() > dirlist = string.split(dirlist) >@@ -227,15 +227,12 @@ > except OSError, (errno, msg): > pass > >- # now create the product/RPMS dir >- os.makedirs("%s-disc%d/%s/RPMS" % (self.dist_dir, i, self.product_path)) >- > else: >- os.makedirs("%s-disc%d/%s/RPMS" % (self.dist_dir, i, self.product_path)) >+ os.makedirs("%s-disc%d/" % (self.dist_dir, i)) > self.linkFiles(self.dist_dir, "%s-disc%d" %(self.dist_dir, i), self.common_files) > self.createDiscInfo(i) > >- if (self.src_discs != 0): >+ if (self.src_discs != 0): > for i in range(self.src_list[0], self.src_list[-1] + 1): > os.makedirs("%s-disc%d/SRPMS" % (self.dist_dir, i)) > self.linkFiles(self.dist_dir, >@@ -249,14 +246,19 @@ > """Creates links in the split dirs for the RPMs""" > > packages = {} >- >- rpmlist = os.listdir("%s/%s/RPMS" % (self.dist_dir, self.product_path)) >+ >+ pkgdir = "%s" %(self.product_path,) >+ >+ rpmlist = os.listdir("%s/%s" %(self.dist_dir, pkgdir)) > rpmlist.sort() > > # create the packages dictionary in this format: n-v-r.a:['n-v-r.arch.rpm'] > for filename in rpmlist: >- filesize = os.path.getsize("%s/%s/RPMS/%s" % (self.dist_dir, self.product_path, filename)) >- pkg_nvr = nvra("%s/%s/RPMS/%s" %(self.dist_dir, self.product_path, filename)) >+ filesize = os.path.getsize("%s/%s/%s" % (self.dist_dir, pkgdir, filename)) >+ try: >+ pkg_nvr = nvra("%s/%s/%s" %(self.dist_dir, pkgdir, filename)) >+ except rpm.error, e: >+ continue > > if packages.has_key(pkg_nvr): > # append in case we have multiple packages with the >@@ -277,6 +279,7 @@ > file.close() > > # last package is the last package placed on the disc >+ firstpackage = '' > lastpackage = '' > > # packagenum resets when we change discs. It's used to >@@ -290,8 +293,9 @@ > if not packages.has_key(rpm_nvr): > continue > for file_name in packages[rpm_nvr]: >+ print """%s at top of loop, disc = %s""" % (file_name, disc) > curused = self.getSize("%s-disc%s" % (self.dist_dir, disc), blocksize=1) >- filesize = self.getSize("%s/%s/RPMS/%s" % (self.dist_dir, self.product_path, file_name), blocksize=1) >+ filesize = self.getSize("%s/%s/%s" % (self.dist_dir, pkgdir, file_name), blocksize=1) > newsize = filesize + curused > > # compensate for the size of the comps package which has yet to be created >@@ -299,7 +303,7 @@ > maxsize = self.target_size - self.comps_size - self.reserve_size > else: > maxsize = self.target_size >- >+ > packagenum = packagenum + 1 > > if packagenum == 1: >@@ -307,28 +311,34 @@ > > # move to the next disc if true > if newsize > maxsize: >+ print """newsize = %s maxsize= %s""" % (newsize, maxsize) > self.reportSizes(disc, firstpkg=firstpackage, lastpkg=lastpackage) > # try it, if we are already on the last disc then complain loudly > try: > nextdisc=self.bin_list.index(disc+1) > disc = self.bin_list[nextdisc] >- os.link("%s/%s/RPMS/%s" % (self.dist_dir, self.product_path, file_name), >- "%s-disc%d/%s/RPMS/%s" % (self.dist_dir, disc, self.product_path, file_name)) >+ print """disc = %s""" % (disc) >+ os.link("%s/%s/%s" % (self.dist_dir, pkgdir, file_name), >+ "%s-disc%d/%s/%s" % (self.dist_dir, disc, pkgdir, file_name)) > packagenum = 1 > firstpackage = file_name >- >+ continue >+ > except: > # back down to the last RPM disc and complain about the overflow > disc = disc - 1 > self.logfile.append("No more discs to put packages, overflowing on disc%d" % disc) > continue >- >+ > else: >- os.link("%s/%s/RPMS/%s" % (self.dist_dir, self.product_path, file_name), >- "%s-disc%d/%s/RPMS/%s" % (self.dist_dir, disc, self.product_path, file_name)) >+ os.link("%s/%s/%s" % (self.dist_dir, pkgdir, file_name), >+ "%s-disc%d/%s/%s" % (self.dist_dir, disc, pkgdir, file_name)) > lastpackage = file_name > > if reportSize == 1: >+ if firstpackage == '': >+ raise RuntimeError, "CRITICAL ERROR : Packages do not fit in given CD size" >+ > self.reportSizes(disc, firstpkg=firstpackage, lastpkg=lastpackage) > > >@@ -370,7 +380,7 @@ > self.logfile.append("Overflowing %s on disc%d" % (srpm_list[i][1], disc)) > break > else: >- discsize = self.getSize("%s-disc%d" % (self.dist_dir, srpm_disc_list[i])) >+ discsize = self.getSize("%s-disc%d" % (self.dist_dir, disc)) > self.logfile.append("%s-disc%d size: %s" % (self.arch, disc, discsize)) > self.src_list.pop(self.src_list.index(disc)) > os.link("%s/%s" % (self.src_dir, srpm_list[i][1]), >@@ -384,7 +394,7 @@ > """Just runs everything""" > self.createSplitDirs() > self.splitRPMS() >- if (self.src_discs != 0): >+ if (self.src_discs != 0): > self.splitSRPMS() > return self.logfile > >@@ -421,47 +431,77 @@ > else: > usage("You forgot to specify --arch") > >+ print timber.arch >+ > if options.has_key("--total-discs"): > timber.total_discs = int(options['--total-discs']) > else: > usage("You forgot to specify --total-discs") > >+ >+ print timber.total_discs >+ > if options.has_key("--bin-discs"): > timber.bin_discs = int(options['--bin-discs']) > else: > usage("You forgot to specify --bin-discs") > >+ >+ print timber.bin_discs >+ > if options.has_key("--src-discs"): > timber.src_discs = int(options['--src-discs']) > else: > usage("You forgot to specify --src-discs") > >+ >+ print timber.src_discs >+ > if options.has_key("--release-string"): > timber.release_str = options["--release-string"] > else: > usage("You forgot to specify --release-string") > >+ >+ print timber.release_str >+ > if options.has_key("--pkgorderfile"): > timber.package_order_file = options["--pkgorderfile"] > else: > usage("You forgot to specify --pkgorderfile") > >+ >+ print timber.package_order_file >+ > if options.has_key("--distdir"): > timber.dist_dir = options["--distdir"] > else: > usage("You forgot to specify --distdir") > >+ >+ print timber.dist_dir >+ > if options.has_key("--srcdir"): > timber.src_dir = options["--srcdir"] > else: > usage("You forgot to specify --srcdir") >- >+ >+ >+ print timber.src_dir >+ > if options.has_key("--productpath"): >- timber.product_path = options["--productpath"] >+ timber.product_path = options["--productpath"] >+ >+ >+ print timber.product_path > > if options.has_key("--reserve-size"): >- timber.reserve_size = float(options["--reserve_size"]) >+ timber.reserve_size = float(options["--reserve-size"]) >+ >+ >+ print timber.reserve_size > >+ print options > logfile = timber.main() > > for logentry in range(0, len(logfile)): >--- splittree.py.orig 2007-03-27 14:43:17.000000000 -0400 >+++ splittree.py 2007-03-27 14:43:45.000000000 -0400 >@@ -228,6 +228,8 @@ self.reserve_size : Additional size need > pass > > else: >+ for j in range(0, len(dirlist)): >+ os.makedirs("%s-disc%d/%s" % (self.dist_dir, i, dirlist[j])) > self.linkFiles(self.dist_dir, "%s-disc%d" %(self.dist_dir, i), self.common_files) > self.createDiscInfo(i) >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 233384
:
150631
|
151061
|
151121
|
153414