This patch avoid oscar-packager to fail if destination already contains the
generated rpm (same name). Upon oscar-packager failure, the destination
/tftpboot/oscar/%ARCH% must be erased before retrying the build.
This can be a problem when some packages have been manualy generated (using
opkgc, build_rpm or with rpmbuild)
This patch changes this behaviour. When opkgc has successfully generated a
package, if destination already exists, it is removed before trying to move the
freshly built package.
This patch does not check if the file removing is successfull. If it fails,
it'll fail the usual way anyway.
Olivier.
--
Olivier LAHAYE
CEA DRT/LIST/DCSI/DIR
Index: opkgc/trunk/src/OpkgcLib/Compiler.py
===================================================================
--- opkgc/trunk/src/OpkgcLib/Compiler.py (révision 9469)
+++ opkgc/trunk/src/OpkgcLib/Compiler.py (copie de travail)
@@ -168,7 +168,11 @@
if Tools.command("%s --clean -bb %s" % (self.buildCmd, specfile), "./"):
Logger().info("Moving generated files to %s" % self.dest_dir)
for file in glob.glob(os.path.join(self.getMacro('%_rpmdir'), "*/opkg-%s*.rpm" % self.opkgName)):
- Logger().info("Moving files: %s" % file)
+ dest_file = os.path.join(self.dest_dir, os.path.basename(file))
+ if os.path.exists(dest_file):
+ Logger().info("Removing existing file: %s" % dest_file)
+ os.unlink(dest_file)
+ Logger().info("Moving file: %s" % file)
shutil.move(file, self.dest_dir)
else:
Logger().error("Binary package generation failed")
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel