aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-08-17 18:08:24 +0000
committerNicolas Vigier <boklm@mageia.org>2011-08-17 18:08:24 +0000
commitf065d3bf6798c9528ff33bd3a9a2794182b14877 (patch)
tree091e0631de8e50494403c9591aaddb6eb2bd578f /MgaRepo
parentfdade6c6883b1ccbb42ef72041401aef3d21f5ea (diff)
downloadmgarepo-f065d3bf6798c9528ff33bd3a9a2794182b14877.tar
mgarepo-f065d3bf6798c9528ff33bd3a9a2794182b14877.tar.gz
mgarepo-f065d3bf6798c9528ff33bd3a9a2794182b14877.tar.bz2
mgarepo-f065d3bf6798c9528ff33bd3a9a2794182b14877.tar.xz
mgarepo-f065d3bf6798c9528ff33bd3a9a2794182b14877.zip
update sync for new binrepo
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/rpmutil.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/MgaRepo/rpmutil.py b/MgaRepo/rpmutil.py
index 074f8ac..5d26237 100644
--- a/MgaRepo/rpmutil.py
+++ b/MgaRepo/rpmutil.py
@@ -497,6 +497,8 @@ def ispkgtopdir(path=None):
def sync(dryrun=False, commit=False, download=False):
svn = SVN()
topdir = getpkgtopdir()
+ spath = binrepo.sources_path(topdir)
+ binrepoentries = binrepo.parse_sources(spath)
# run svn info because svn st does not complain when topdir is not an
# working copy
svn.info(topdir)
@@ -532,7 +534,7 @@ def sync(dryrun=False, commit=False, download=False):
for source, url in sources.iteritems():
sourcepath = os.path.join(sourcesdir, source)
if sourcesst.get(source):
- if not os.path.islink(sourcepath) and sourcesst.get(source)[1] == '?':
+ if not (source in binrepoentries) and sourcesst.get(source)[1] == '?':
toadd.append(sourcepath)
elif not download and not os.path.isfile(sourcepath):
sys.stderr.write("warning: %s not found\n" % sourcepath)
@@ -564,7 +566,7 @@ def sync(dryrun=False, commit=False, download=False):
status = sourcesst.get(entry)
path = os.path.join(sourcesdir, entry)
if entry not in sources:
- if os.path.isfile(path) and (os.path.islink(path) or status is None):
+ if status is None or entry in binrepoentries:
toremove.append(path)
for path in toremove:
print "D\t%s" % path
@@ -656,7 +658,7 @@ def delete(paths, commit=False):
message = "%s: delete file %s" % (silent, path)
if binrepo.is_binary(path):
topdir = getpkgtopdir()
- binrepo.update_sources(topdir, removed=[path])
+ binrepo.update_sources(topdir, removed=[os.path.basename(path)])
if commit:
svn = SVN()
svn.commit(binrepo.sources_path(topdir), log=message)